From 000a18d3b98e26ccfc6d74148d3276e1a6d641da Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Dec 2021 15:11:06 +0800 Subject: [PATCH 01/54] [java][okhttp-gson-nextgen] Better null handling in oneOf, anyOf model (#11056) * better null handling in oneOf model * update anyof with better null handling * add null test --- .../libraries/okhttp-gson-nextgen/anyof_model.mustache | 5 +++++ .../libraries/okhttp-gson-nextgen/oneof_model.mustache | 5 +++++ .../src/main/java/org/openapitools/client/model/Fruit.java | 5 +++++ .../main/java/org/openapitools/client/model/FruitReq.java | 5 +++++ .../main/java/org/openapitools/client/model/GmFruit.java | 5 +++++ .../main/java/org/openapitools/client/model/Mammal.java | 5 +++++ .../java/org/openapitools/client/model/NullableShape.java | 5 +++++ .../src/main/java/org/openapitools/client/model/Pig.java | 5 +++++ .../java/org/openapitools/client/model/Quadrilateral.java | 5 +++++ .../src/main/java/org/openapitools/client/model/Shape.java | 5 +++++ .../java/org/openapitools/client/model/ShapeOrNull.java | 5 +++++ .../main/java/org/openapitools/client/model/Triangle.java | 5 +++++ .../src/test/java/org/openapitools/client/JSONTest.java | 7 +++++++ 13 files changed, 67 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index a4c5c86ca2..04f8a08934 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -50,6 +50,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return (TypeAdapter) new TypeAdapter<{{classname}}>() { @Override public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + {{#anyOf}} // check if the actual instance is of the type `{{.}}` if (value.getActualInstance() instanceof {{.}}) { diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index 0b7c8b6369..84c4846dc5 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -50,6 +50,11 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return (TypeAdapter) new TypeAdapter<{{classname}}>() { @Override public void write(JsonWriter out, {{classname}} value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + {{#oneOf}} // check if the actual instance is of the type `{{.}}` if (value.getActualInstance() instanceof {{.}}) { diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 6f907a92f0..4b162d79ae 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -78,6 +78,11 @@ public class Fruit extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Fruit value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Apple` if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 303049b600..13436b1d6e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -78,6 +78,11 @@ public class FruitReq extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, FruitReq value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `AppleReq` if (value.getActualInstance() instanceof AppleReq) { JsonObject obj = adapterAppleReq.toJsonTree((AppleReq)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 441f0330de..1d07fdfd6b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -78,6 +78,11 @@ public class GmFruit extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, GmFruit value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Apple` if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index 466644f4b7..fcd1935126 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -79,6 +79,11 @@ public class Mammal extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Mammal value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Pig` if (value.getActualInstance() instanceof Pig) { JsonObject obj = adapterPig.toJsonTree((Pig)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index 67b42a3057..bb11f4eb0e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -77,6 +77,11 @@ public class NullableShape extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, NullableShape value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Quadrilateral` if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index ea0b58cbf9..9e2015ba67 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -77,6 +77,11 @@ public class Pig extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Pig value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `BasquePig` if (value.getActualInstance() instanceof BasquePig) { JsonObject obj = adapterBasquePig.toJsonTree((BasquePig)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index b91dda2eec..04a317679b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -77,6 +77,11 @@ public class Quadrilateral extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Quadrilateral value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `ComplexQuadrilateral` if (value.getActualInstance() instanceof ComplexQuadrilateral) { JsonObject obj = adapterComplexQuadrilateral.toJsonTree((ComplexQuadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index df7274029b..babaf6be36 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -77,6 +77,11 @@ public class Shape extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Shape value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Quadrilateral` if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 7c6f090482..6b413bce9a 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -77,6 +77,11 @@ public class ShapeOrNull extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, ShapeOrNull value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `Quadrilateral` if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index e9e70e6be7..f9a3276d9b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -79,6 +79,11 @@ public class Triangle extends AbstractOpenApiSchema { return (TypeAdapter) new TypeAdapter() { @Override public void write(JsonWriter out, Triangle value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + // check if the actual instance is of the type `EquilateralTriangle` if (value.getActualInstance() instanceof EquilateralTriangle) { JsonObject obj = adapterEquilateralTriangle.toJsonTree((EquilateralTriangle)value.getActualInstance()).getAsJsonObject(); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index c6b3c2345d..4c3fbb12ec 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -314,6 +314,13 @@ public class JSONTest { assertEquals(inst2.getMealy(), false); assertEquals(json.getGson().toJson(inst2), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); } + { + // test to ensure the oneOf object can be serialized to "null" correctly + FruitReq o = new FruitReq(); + assertEquals(o.getActualInstance(), null); + assertEquals(json.getGson().toJson(o), "null"); + assertEquals(json.getGson().toJson(null), "null"); + } { // Same test, but this time with additional (undeclared) properties. // Since FruitReq has additionalProperties: false, deserialization should fail. From 192126be6b90f58f512cda583aa830fec8d07be9 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Dec 2021 16:22:46 +0800 Subject: [PATCH 02/54] [java][okhttp-gson-next-gen] fix serialization, add tests (#11057) * fix serialization, add tests * add new files --- .../okhttp-gson-nextgen/anyof_model.mustache | 1 + .../okhttp-gson-nextgen/oneof_model.mustache | 1 + ...sting-with-http-signature-okhttp-gson.yaml | 6 + .../.openapi-generator/FILES | 2 + .../java/okhttp-gson-nextgen/README.md | 1 + .../java/okhttp-gson-nextgen/api/openapi.yaml | 6 + .../java/okhttp-gson-nextgen/docs/GmFruit.md | 2 +- .../okhttp-gson-nextgen/docs/Pineapple.md | 13 ++ .../java/org/openapitools/client/JSON.java | 1 + .../org/openapitools/client/model/Fruit.java | 2 + .../openapitools/client/model/FruitReq.java | 2 + .../openapitools/client/model/GmFruit.java | 56 +++++- .../org/openapitools/client/model/Mammal.java | 3 + .../client/model/NullableShape.java | 2 + .../org/openapitools/client/model/Pig.java | 2 + .../openapitools/client/model/Pineapple.java | 162 ++++++++++++++++++ .../client/model/Quadrilateral.java | 2 + .../org/openapitools/client/model/Shape.java | 2 + .../client/model/ShapeOrNull.java | 2 + .../openapitools/client/model/Triangle.java | 3 + .../org/openapitools/client/JSONTest.java | 31 ++++ .../client/model/PineappleTest.java | 51 ++++++ 22 files changed, 347 insertions(+), 6 deletions(-) create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index 04f8a08934..e1727ddc04 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -60,6 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im if (value.getActualInstance() instanceof {{.}}) { JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } {{/anyOf}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index 84c4846dc5..48da5e472c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -60,6 +60,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im if (value.getActualInstance() instanceof {{.}}) { JsonObject obj = adapter{{.}}.toJsonTree(({{.}})value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } {{/oneOf}} diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml index 92b32a4767..bf85279739 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -1888,6 +1888,11 @@ components: type: string pattern: /^[A-Z\s]*$/i nullable: true + pineapple: + type: object + properties: + origin: + type: string banana: type: object properties: @@ -1950,6 +1955,7 @@ components: color: type: string anyOf: + - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' additionalProperties: false diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES index 39148a7980..29da59bcd3 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES @@ -66,6 +66,7 @@ docs/ParentPet.md docs/Pet.md docs/PetApi.md docs/Pig.md +docs/Pineapple.md docs/Quadrilateral.md docs/QuadrilateralInterface.md docs/ReadOnlyFirst.md @@ -178,6 +179,7 @@ src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Pig.java +src/main/java/org/openapitools/client/model/Pineapple.java src/main/java/org/openapitools/client/model/Quadrilateral.java src/main/java/org/openapitools/client/model/QuadrilateralInterface.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md index 6110aea0fa..3a81849aa6 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/README.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/README.md @@ -213,6 +213,7 @@ Class | Method | HTTP request | Description - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) + - [Pineapple](docs/Pineapple.md) - [Quadrilateral](docs/Quadrilateral.md) - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml index 8e64d05d5f..e2ecf87a05 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -2053,6 +2053,11 @@ components: pattern: /^[A-Z\s]*$/i type: string type: object + pineapple: + properties: + origin: + type: string + type: object banana: properties: lengthCm: @@ -2113,6 +2118,7 @@ components: gmFruit: additionalProperties: false anyOf: + - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' properties: diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md index 1536d68968..d91eec57f8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **color** | **String** | | [optional] -**cultivar** | **String** | | [optional] **origin** | **String** | | [optional] +**cultivar** | **String** | | [optional] **lengthCm** | **BigDecimal** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md new file mode 100644 index 0000000000..b7980a3b95 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/Pineapple.md @@ -0,0 +1,13 @@ + + +# Pineapple + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**origin** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java index 40146a3e6f..33e8ed752e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -270,6 +270,7 @@ public class JSON { .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.Pineapple.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 4b162d79ae..03436bd35b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -87,12 +87,14 @@ public class Fruit extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Banana` if (value.getActualInstance() instanceof Banana) { JsonObject obj = adapterBanana.toJsonTree((Banana)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Apple, Banana"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 13436b1d6e..6a6ea0c82f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -87,12 +87,14 @@ public class FruitReq extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof AppleReq) { JsonObject obj = adapterAppleReq.toJsonTree((AppleReq)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `BananaReq` if (value.getActualInstance() instanceof BananaReq) { JsonObject obj = adapterBananaReq.toJsonTree((BananaReq)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: AppleReq, BananaReq"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 1d07fdfd6b..4085fd34c1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; +import org.openapitools.client.model.Pineapple; import javax.ws.rs.core.GenericType; @@ -74,6 +75,7 @@ public class GmFruit extends AbstractOpenApiSchema { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterApple = gson.getDelegateAdapter(this, TypeToken.get(Apple.class)); final TypeAdapter adapterBanana = gson.getDelegateAdapter(this, TypeToken.get(Banana.class)); + final TypeAdapter adapterPineapple = gson.getDelegateAdapter(this, TypeToken.get(Pineapple.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -87,15 +89,24 @@ public class GmFruit extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof Apple) { JsonObject obj = adapterApple.toJsonTree((Apple)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Banana` if (value.getActualInstance() instanceof Banana) { JsonObject obj = adapterBanana.toJsonTree((Banana)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } - throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: Apple, Banana"); + // check if the actual instance is of the type `Pineapple` + if (value.getActualInstance() instanceof Pineapple) { + JsonObject obj = adapterPineapple.toJsonTree((Pineapple)value.getActualInstance()).getAsJsonObject(); + elementAdapter.write(out, obj); + return; + } + + throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: Apple, Banana, Pineapple"); } @Override @@ -126,6 +137,18 @@ public class GmFruit extends AbstractOpenApiSchema { log.log(Level.FINER, "Input data does not match schema 'Banana'", e); } + // deserialize Pineapple + try { + deserialized = gson.fromJson(in, Pineapple.class); + log.log(Level.FINER, "Input data matches schema 'Pineapple'"); + GmFruit ret = new GmFruit(); + ret.setActualInstance(deserialized); + return ret; + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Pineapple'", e); + } + throw new IOException("Failed deserialization for GmFruit: no match found."); } }.nullSafe(); @@ -149,11 +172,18 @@ public class GmFruit extends AbstractOpenApiSchema { setActualInstance(o); } + public GmFruit(Pineapple o) { + super("anyOf", Boolean.FALSE); + setActualInstance(o); + } + static { schemas.put("Apple", new GenericType() { }); schemas.put("Banana", new GenericType() { }); + schemas.put("Pineapple", new GenericType() { + }); } @Override @@ -164,7 +194,7 @@ public class GmFruit extends AbstractOpenApiSchema { /** * Set the instance that matches the anyOf child schema, check * the instance parameter is valid against the anyOf child schemas: - * Apple, Banana + * Apple, Banana, Pineapple * * It could be an instance of the 'anyOf' schemas. * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). @@ -181,14 +211,19 @@ public class GmFruit extends AbstractOpenApiSchema { return; } - throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); + if (instance instanceof Pineapple) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Apple, Banana, Pineapple"); } /** * Get the actual instance, which can be the following: - * Apple, Banana + * Apple, Banana, Pineapple * - * @return The actual instance (Apple, Banana) + * @return The actual instance (Apple, Banana, Pineapple) */ @Override public Object getActualInstance() { @@ -217,5 +252,16 @@ public class GmFruit extends AbstractOpenApiSchema { return (Banana)super.getActualInstance(); } + /** + * Get the actual instance of `Pineapple`. If the actual instance is not `Pineapple`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Pineapple` + * @throws ClassCastException if the instance is not `Pineapple` + */ + public Pineapple getPineapple() throws ClassCastException { + return (Pineapple)super.getActualInstance(); + } + } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index fcd1935126..1298c95a72 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -88,18 +88,21 @@ public class Mammal extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof Pig) { JsonObject obj = adapterPig.toJsonTree((Pig)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Whale` if (value.getActualInstance() instanceof Whale) { JsonObject obj = adapterWhale.toJsonTree((Whale)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Zebra` if (value.getActualInstance() instanceof Zebra) { JsonObject obj = adapterZebra.toJsonTree((Zebra)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Pig, Whale, Zebra"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index bb11f4eb0e..9da8d1671b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -86,12 +86,14 @@ public class NullableShape extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Triangle` if (value.getActualInstance() instanceof Triangle) { JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index 9e2015ba67..5271006630 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -86,12 +86,14 @@ public class Pig extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof BasquePig) { JsonObject obj = adapterBasquePig.toJsonTree((BasquePig)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `DanishPig` if (value.getActualInstance() instanceof DanishPig) { JsonObject obj = adapterDanishPig.toJsonTree((DanishPig)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: BasquePig, DanishPig"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java new file mode 100644 index 0000000000..284058b93a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pineapple.java @@ -0,0 +1,162 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * Pineapple + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class Pineapple { + public static final String SERIALIZED_NAME_ORIGIN = "origin"; + @SerializedName(SERIALIZED_NAME_ORIGIN) + private String origin; + + public Pineapple() { + } + + public Pineapple origin(String origin) { + + this.origin = origin; + return this; + } + + /** + * Get origin + * @return origin + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String getOrigin() { + return origin; + } + + + public void setOrigin(String origin) { + this.origin = origin; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Pineapple pineapple = (Pineapple) o; + return Objects.equals(this.origin, pineapple.origin); + } + + @Override + public int hashCode() { + return Objects.hash(origin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Pineapple {\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("origin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!Pineapple.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Pineapple' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Pineapple.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, Pineapple value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public Pineapple read(JsonReader in) throws IOException { + JsonObject obj = elementAdapter.read(in).getAsJsonObject(); + Set> entries = obj.entrySet();//will return members of your object + // check to see if the JSON string contains additional fields + for (Entry entry: entries) { + if (!Pineapple.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Pineapple` properties"); + } + } + + return thisAdapter.fromJsonTree(obj); + } + + }.nullSafe(); + } + } +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index 04a317679b..40785f69a7 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -86,12 +86,14 @@ public class Quadrilateral extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof ComplexQuadrilateral) { JsonObject obj = adapterComplexQuadrilateral.toJsonTree((ComplexQuadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `SimpleQuadrilateral` if (value.getActualInstance() instanceof SimpleQuadrilateral) { JsonObject obj = adapterSimpleQuadrilateral.toJsonTree((SimpleQuadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index babaf6be36..c6ebebc4a3 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -86,12 +86,14 @@ public class Shape extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Triangle` if (value.getActualInstance() instanceof Triangle) { JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 6b413bce9a..ddb66a3ec6 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -86,12 +86,14 @@ public class ShapeOrNull extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof Quadrilateral) { JsonObject obj = adapterQuadrilateral.toJsonTree((Quadrilateral)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `Triangle` if (value.getActualInstance() instanceof Triangle) { JsonObject obj = adapterTriangle.toJsonTree((Triangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index f9a3276d9b..a0f2a5847f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -88,18 +88,21 @@ public class Triangle extends AbstractOpenApiSchema { if (value.getActualInstance() instanceof EquilateralTriangle) { JsonObject obj = adapterEquilateralTriangle.toJsonTree((EquilateralTriangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `IsoscelesTriangle` if (value.getActualInstance() instanceof IsoscelesTriangle) { JsonObject obj = adapterIsoscelesTriangle.toJsonTree((IsoscelesTriangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } // check if the actual instance is of the type `ScaleneTriangle` if (value.getActualInstance() instanceof ScaleneTriangle) { JsonObject obj = adapterScaleneTriangle.toJsonTree((ScaleneTriangle)value.getActualInstance()).getAsJsonObject(); elementAdapter.write(out, obj); + return; } throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index 4c3fbb12ec..aab71f4c46 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -286,6 +286,36 @@ public class JSONTest { return offset; } + /** + * Validate an anyOf schema can be deserialized into the expected class. + * The anyOf schema does not have a discriminator. + */ + @Test + public void testAnyOfSchemaWithoutDiscriminator() throws Exception { + { + String str = "{ \"cultivar\": \"golden delicious\", \"origin\": \"japan\" }"; + String str2 = "{ \"origin_typo\": \"japan\" }"; + + // make sure deserialization works for pojo object + Apple a = json.getGson().fromJson(str, Apple.class); + assertEquals(a.getCultivar(), "golden delicious"); + assertEquals(a.getOrigin(), "japan"); + + GmFruit o = json.getGson().fromJson(str, GmFruit.class); + assertTrue(o.getActualInstance() instanceof Apple); + Apple inst = (Apple) o.getActualInstance(); + assertEquals(inst.getCultivar(), "golden delicious"); + assertEquals(inst.getOrigin(), "japan"); + assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + + // no match + Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + GmFruit o2 = json.getGson().fromJson(str2, GmFruit.class); + }); + } + } + /** * Validate a oneOf schema can be deserialized into the expected class. * The oneOf schema does not have a discriminator. @@ -308,6 +338,7 @@ public class JSONTest { assertEquals(inst.getCultivar(), "golden delicious"); assertEquals(inst.getMealy(), false); assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); AppleReq inst2 = o.getAppleReq(); assertEquals(inst2.getCultivar(), "golden delicious"); diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java new file mode 100644 index 0000000000..33c1e27f36 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PineappleTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for Pineapple + */ +public class PineappleTest { + private final Pineapple model = new Pineapple(); + + /** + * Model tests for Pineapple + */ + @Test + public void testPineapple() { + // TODO: test Pineapple + } + + /** + * Test the property 'origin' + */ + @Test + public void originTest() { + // TODO: test origin + } + +} From a489a2e828acc8e21c7d4e761ee197b3c7fb4d2a Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 Dec 2021 21:38:54 +0800 Subject: [PATCH 03/54] [java][okhttp-gson-next-gen] better error message in oneOf/anyOf (#11059) * better error message * update tests --- .../okhttp-gson-nextgen/anyof_model.mustache | 10 +-- .../okhttp-gson-nextgen/oneof_model.mustache | 6 +- ...sting-with-http-signature-okhttp-gson.yaml | 6 -- .../.openapi-generator/FILES | 2 - .../java/okhttp-gson-nextgen/README.md | 1 - .../java/okhttp-gson-nextgen/api/openapi.yaml | 6 -- .../java/okhttp-gson-nextgen/docs/GmFruit.md | 2 +- .../java/org/openapitools/client/JSON.java | 1 - .../org/openapitools/client/model/Fruit.java | 4 +- .../openapitools/client/model/FruitReq.java | 4 +- .../openapitools/client/model/GmFruit.java | 62 +++---------------- .../org/openapitools/client/model/Mammal.java | 4 +- .../client/model/NullableShape.java | 4 +- .../org/openapitools/client/model/Pig.java | 4 +- .../client/model/Quadrilateral.java | 4 +- .../org/openapitools/client/model/Shape.java | 4 +- .../client/model/ShapeOrNull.java | 4 +- .../openapitools/client/model/Triangle.java | 4 +- .../org/openapitools/client/JSONTest.java | 16 ++++- 19 files changed, 51 insertions(+), 97 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index e1727ddc04..2b41e44940 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -64,12 +64,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} - throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}"); } @Override public {{classname}} read(JsonReader in) throws IOException { Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + {{#useOneOfDiscriminatorLookup}} {{#discriminator}} // use discriminator value for faster anyOf lookup @@ -78,7 +80,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im switch (discriminatorValue) { {{#mappedModels}} case "{{{mappingName}}}": - deserialized = gson.fromJson(in, {{{modelName}}}.class); + deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; {{/mappedModels}} @@ -92,7 +94,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{#anyOf}} // deserialize {{{.}}} try { - deserialized = gson.fromJson(in, {{.}}.class); + deserialized = adapter{{.}}.fromJsonTree(jsonObject); log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); {{classname}} ret = new {{classname}}(); ret.setActualInstance(deserialized); @@ -103,7 +105,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} - throw new IOException("Failed deserialization for {{classname}}: no match found."); + throw new IOException(String.format("Failed deserialization for {{classname}} as data doesn't match anyOf schmeas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObject.toString())); } }.nullSafe(); } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index 48da5e472c..a9300854de 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -64,7 +64,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/oneOf}} - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}"); } @Override @@ -80,7 +80,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im switch (discriminatorValue) { {{#mappedModels}} case "{{{mappingName}}}": - deserialized = adapter{{.}}.fromJsonTree(jsonObject); + deserialized = adapter{{modelName}}.fromJsonTree(jsonObject); new{{classname}}.setActualInstance(deserialized); return new{{classname}}; {{/mappedModels}} @@ -110,7 +110,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im return ret; } - throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for {{classname}}: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml index bf85279739..92b32a4767 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -1888,11 +1888,6 @@ components: type: string pattern: /^[A-Z\s]*$/i nullable: true - pineapple: - type: object - properties: - origin: - type: string banana: type: object properties: @@ -1955,7 +1950,6 @@ components: color: type: string anyOf: - - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' additionalProperties: false diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES index 29da59bcd3..39148a7980 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES @@ -66,7 +66,6 @@ docs/ParentPet.md docs/Pet.md docs/PetApi.md docs/Pig.md -docs/Pineapple.md docs/Quadrilateral.md docs/QuadrilateralInterface.md docs/ReadOnlyFirst.md @@ -179,7 +178,6 @@ src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java src/main/java/org/openapitools/client/model/Pig.java -src/main/java/org/openapitools/client/model/Pineapple.java src/main/java/org/openapitools/client/model/Quadrilateral.java src/main/java/org/openapitools/client/model/QuadrilateralInterface.java src/main/java/org/openapitools/client/model/ReadOnlyFirst.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md index 3a81849aa6..6110aea0fa 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/README.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/README.md @@ -213,7 +213,6 @@ Class | Method | HTTP request | Description - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) - [Pig](docs/Pig.md) - - [Pineapple](docs/Pineapple.md) - [Quadrilateral](docs/Quadrilateral.md) - [QuadrilateralInterface](docs/QuadrilateralInterface.md) - [ReadOnlyFirst](docs/ReadOnlyFirst.md) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml index e2ecf87a05..8e64d05d5f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -2053,11 +2053,6 @@ components: pattern: /^[A-Z\s]*$/i type: string type: object - pineapple: - properties: - origin: - type: string - type: object banana: properties: lengthCm: @@ -2118,7 +2113,6 @@ components: gmFruit: additionalProperties: false anyOf: - - $ref: '#/components/schemas/pineapple' - $ref: '#/components/schemas/apple' - $ref: '#/components/schemas/banana' properties: diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md index d91eec57f8..1536d68968 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/GmFruit.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **color** | **String** | | [optional] -**origin** | **String** | | [optional] **cultivar** | **String** | | [optional] +**origin** | **String** | | [optional] **lengthCm** | **BigDecimal** | | [optional] diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java index 33e8ed752e..40146a3e6f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -270,7 +270,6 @@ public class JSON { .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.Pineapple.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ReadOnlyFirst.CustomTypeAdapterFactory()) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 03436bd35b..7ed501ad6d 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -97,7 +97,7 @@ public class Fruit extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Apple, Banana"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Apple, Banana"); } @Override @@ -133,7 +133,7 @@ public class Fruit extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 6a6ea0c82f..5c886b122b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -97,7 +97,7 @@ public class FruitReq extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: AppleReq, BananaReq"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AppleReq, BananaReq"); } @Override @@ -133,7 +133,7 @@ public class FruitReq extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 4085fd34c1..36a4bd8b24 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -26,7 +26,6 @@ import java.io.IOException; import java.math.BigDecimal; import org.openapitools.client.model.Apple; import org.openapitools.client.model.Banana; -import org.openapitools.client.model.Pineapple; import javax.ws.rs.core.GenericType; @@ -75,7 +74,6 @@ public class GmFruit extends AbstractOpenApiSchema { final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); final TypeAdapter adapterApple = gson.getDelegateAdapter(this, TypeToken.get(Apple.class)); final TypeAdapter adapterBanana = gson.getDelegateAdapter(this, TypeToken.get(Banana.class)); - final TypeAdapter adapterPineapple = gson.getDelegateAdapter(this, TypeToken.get(Pineapple.class)); return (TypeAdapter) new TypeAdapter() { @Override @@ -99,23 +97,18 @@ public class GmFruit extends AbstractOpenApiSchema { return; } - // check if the actual instance is of the type `Pineapple` - if (value.getActualInstance() instanceof Pineapple) { - JsonObject obj = adapterPineapple.toJsonTree((Pineapple)value.getActualInstance()).getAsJsonObject(); - elementAdapter.write(out, obj); - return; - } - - throw new IOException("Failed to deserialize as the type doesn't match anyOf schemas: Apple, Banana, Pineapple"); + throw new IOException("Failed to serialize as the type doesn't match anyOf schemas: Apple, Banana"); } @Override public GmFruit read(JsonReader in) throws IOException { Object deserialized = null; + JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); + // deserialize Apple try { - deserialized = gson.fromJson(in, Apple.class); + deserialized = adapterApple.fromJsonTree(jsonObject); log.log(Level.FINER, "Input data matches schema 'Apple'"); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); @@ -127,7 +120,7 @@ public class GmFruit extends AbstractOpenApiSchema { // deserialize Banana try { - deserialized = gson.fromJson(in, Banana.class); + deserialized = adapterBanana.fromJsonTree(jsonObject); log.log(Level.FINER, "Input data matches schema 'Banana'"); GmFruit ret = new GmFruit(); ret.setActualInstance(deserialized); @@ -137,19 +130,7 @@ public class GmFruit extends AbstractOpenApiSchema { log.log(Level.FINER, "Input data does not match schema 'Banana'", e); } - // deserialize Pineapple - try { - deserialized = gson.fromJson(in, Pineapple.class); - log.log(Level.FINER, "Input data matches schema 'Pineapple'"); - GmFruit ret = new GmFruit(); - ret.setActualInstance(deserialized); - return ret; - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'Pineapple'", e); - } - - throw new IOException("Failed deserialization for GmFruit: no match found."); + throw new IOException(String.format("Failed deserialization for GmFruit as data doesn't match anyOf schmeas: Apple, Banana. JSON: %s", jsonObject.toString())); } }.nullSafe(); } @@ -172,18 +153,11 @@ public class GmFruit extends AbstractOpenApiSchema { setActualInstance(o); } - public GmFruit(Pineapple o) { - super("anyOf", Boolean.FALSE); - setActualInstance(o); - } - static { schemas.put("Apple", new GenericType() { }); schemas.put("Banana", new GenericType() { }); - schemas.put("Pineapple", new GenericType() { - }); } @Override @@ -194,7 +168,7 @@ public class GmFruit extends AbstractOpenApiSchema { /** * Set the instance that matches the anyOf child schema, check * the instance parameter is valid against the anyOf child schemas: - * Apple, Banana, Pineapple + * Apple, Banana * * It could be an instance of the 'anyOf' schemas. * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). @@ -211,19 +185,14 @@ public class GmFruit extends AbstractOpenApiSchema { return; } - if (instance instanceof Pineapple) { - super.setActualInstance(instance); - return; - } - - throw new RuntimeException("Invalid instance type. Must be Apple, Banana, Pineapple"); + throw new RuntimeException("Invalid instance type. Must be Apple, Banana"); } /** * Get the actual instance, which can be the following: - * Apple, Banana, Pineapple + * Apple, Banana * - * @return The actual instance (Apple, Banana, Pineapple) + * @return The actual instance (Apple, Banana) */ @Override public Object getActualInstance() { @@ -252,16 +221,5 @@ public class GmFruit extends AbstractOpenApiSchema { return (Banana)super.getActualInstance(); } - /** - * Get the actual instance of `Pineapple`. If the actual instance is not `Pineapple`, - * the ClassCastException will be thrown. - * - * @return The actual instance of `Pineapple` - * @throws ClassCastException if the instance is not `Pineapple` - */ - public Pineapple getPineapple() throws ClassCastException { - return (Pineapple)super.getActualInstance(); - } - } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index 1298c95a72..21834a0903 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -105,7 +105,7 @@ public class Mammal extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Pig, Whale, Zebra"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Pig, Whale, Zebra"); } @Override @@ -151,7 +151,7 @@ public class Mammal extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index 9da8d1671b..f2946ec60e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -96,7 +96,7 @@ public class NullableShape extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); } @Override @@ -132,7 +132,7 @@ public class NullableShape extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index 5271006630..54982ba3f8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -96,7 +96,7 @@ public class Pig extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: BasquePig, DanishPig"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BasquePig, DanishPig"); } @Override @@ -132,7 +132,7 @@ public class Pig extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index 40785f69a7..aad102d305 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -96,7 +96,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral"); } @Override @@ -132,7 +132,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index c6ebebc4a3..23b4c43b00 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -96,7 +96,7 @@ public class Shape extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); } @Override @@ -132,7 +132,7 @@ public class Shape extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index ddb66a3ec6..871b888129 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -96,7 +96,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Quadrilateral, Triangle"); } @Override @@ -132,7 +132,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index a0f2a5847f..9311228bf0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -105,7 +105,7 @@ public class Triangle extends AbstractOpenApiSchema { return; } - throw new IOException("Failed to deserialize as the type doesn't match oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); } @Override @@ -151,7 +151,7 @@ public class Triangle extends AbstractOpenApiSchema { return ret; } - throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1", match)); + throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1. JSON: %s", match, jsonObject.toString())); } }.nullSafe(); } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index aab71f4c46..e7d783574f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -294,7 +294,6 @@ public class JSONTest { public void testAnyOfSchemaWithoutDiscriminator() throws Exception { { String str = "{ \"cultivar\": \"golden delicious\", \"origin\": \"japan\" }"; - String str2 = "{ \"origin_typo\": \"japan\" }"; // make sure deserialization works for pojo object Apple a = json.getGson().fromJson(str, Apple.class); @@ -309,8 +308,19 @@ public class JSONTest { assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + String str2 = "{ \"origin_typo\": \"japan\" }"; // no match - Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { + Exception exception = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Apple o3 = json.getGson().fromJson(str2, Apple.class); + }); + + // no match + Exception exception3 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Banana o2 = json.getGson().fromJson(str2, Banana.class); + }); + + // no match + Exception exception4 = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { GmFruit o2 = json.getGson().fromJson(str2, GmFruit.class); }); } @@ -359,7 +369,7 @@ public class JSONTest { Exception exception = assertThrows(com.google.gson.JsonSyntaxException.class, () -> { FruitReq o = json.getGson().fromJson(str, FruitReq.class); }); - assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result")); + assertTrue(exception.getMessage().contains("Failed deserialization for FruitReq: 0 classes match result, expected 1. JSON: {\"cultivar\":\"golden delicious\",\"mealy\":false,\"garbage_prop\":\"abc\"}")); } { String str = "{ \"lengthCm\": 17 }"; From 2ff6f833e2f9dc6885f73375e0adc9e17d504a0f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 Dec 2021 09:39:42 +0800 Subject: [PATCH 04/54] add more tests for oneOf (#11068) --- .../src/test/java/org/openapitools/client/JSONTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index e7d783574f..6b631a5a98 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -382,6 +382,8 @@ public class JSONTest { assertTrue(o.getActualInstance() instanceof BananaReq); BananaReq inst = (BananaReq) o.getActualInstance(); assertEquals(inst.getLengthCm(), new java.math.BigDecimal(17)); + assertEquals(json.getGson().toJson(o), "{\"lengthCm\":17}"); + assertEquals(json.getGson().toJson(inst), "{\"lengthCm\":17}"); } { // Try to deserialize empty object. This should fail 'oneOf' because none will match From c9410447019068af88971143b979d4ec02b8ac17 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Wed, 8 Dec 2021 17:07:49 +0000 Subject: [PATCH 05/54] [swift5][client] allow request cancellation and authentication flow to work together (#11019) * [swift5][client] allow request cancellation and authentication flow to work together * [swift5][client] allow request cancellation and authentication flow to work together * [swift5][client] rename OpenAPIRequestCancellable to RequestTask * [swift5][client] rename OpenAPIRequestCancellable to RequestTask --- .../src/main/resources/swift5/APIs.mustache | 5 +- .../src/main/resources/swift5/Models.mustache | 30 +++++- .../src/main/resources/swift5/api.mustache | 22 ++--- .../AlamofireImplementations.mustache | 8 +- .../URLSessionImplementations.mustache | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../OpenAPIs/AlamofireImplementations.swift | 8 +- .../Classes/OpenAPIs/Models.swift | 14 +++ .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 96 +++++++++---------- .../APIs/FakeClassnameTags123API.swift | 8 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 72 +++++++------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 32 +++---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 64 ++++++------- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 6 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 72 +++++++------- .../APIs/FakeClassnameTags123API.swift | 6 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 54 +++++------ .../Classes/OpenAPIs/APIs/StoreAPI.swift | 24 ++--- .../Classes/OpenAPIs/APIs/UserAPI.swift | 48 +++++----- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 28 +++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 16 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../Classes/OpenAPIs/APIs/DefaultAPI.swift | 2 +- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 6 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 4 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 48 +++++----- .../APIs/FakeClassnameTags123API.swift | 4 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 36 +++---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 16 ++-- .../Classes/OpenAPIs/APIs/UserAPI.swift | 32 +++---- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 6 +- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../client/petstore/swift5/swift5_test_all.sh | 13 ++- .../Sources/PetstoreClient/APIs.swift | 5 +- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 2 +- .../Sources/PetstoreClient/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Sources/PetstoreClient/APIs/PetAPI.swift | 18 ++-- .../PetstoreClient/APIs/StoreAPI.swift | 8 +- .../Sources/PetstoreClient/APIs/UserAPI.swift | 16 ++-- .../Sources/PetstoreClient/Models.swift | 13 +++ .../URLSessionImplementations.swift | 8 +- .../xcshareddata/swiftpm/Package.resolved | 4 +- .../BearerDecodableRequestBuilder.swift | 12 ++- .../SwaggerClientTests/PetAPITests.swift | 14 +-- .../SwaggerClientTests/StoreAPITests.swift | 12 +-- .../SwaggerClientTests/UserAPITests.swift | 6 +- .../SwaggerClientTests/run_xcodebuild.sh | 4 +- .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++--- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 ++-- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++-- .../Classes/OpenAPIs/Models.swift | 13 +++ .../OpenAPIs/URLSessionImplementations.swift | 8 +- 138 files changed, 1005 insertions(+), 784 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache index dcca24f56d..847e9be559 100644 --- a/modules/openapi-generator/src/main/resources/swift5/APIs.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/APIs.mustache @@ -36,6 +36,7 @@ import Vapor {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let parameters: [String: Any]? {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let method: String {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let URLString: String + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available.{{#useURLSession}} /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -58,8 +59,8 @@ import Vapor } @discardableResult - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func addHeader(name: String, value: String) -> Self { diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index 1195d5ea9c..28d9935dd5 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -4,7 +4,8 @@ // https://openapi-generator.tech // -import Foundation +import Foundation{{#useAlamofire}} +import Alamofire{{/useAlamofire}} protocol JSONEncodable { func encodeToJSON() -> Any @@ -78,3 +79,30 @@ extension CaseIterableDefaultsLast { self.init(statusCode: response.statusCode, header: header, body: body) } } + +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} final class RequestTask { +{{#useAlamofire}} + private var request: Request? + + internal func set(request: Request) { + self.request = request + } + + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func cancel() { + request?.cancel() + request = nil + } +{{/useAlamofire}} +{{^useAlamofire}} + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func cancel() { + task?.cancel() + task = nil + } +{{/useAlamofire}} +} diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 42b44955aa..5ae1f5513d 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -57,7 +57,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) -> URLSessionTask? { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ data: {{{returnType}}}{{^returnType}}Void{{/returnType}}?, _ error: Error?) -> Void)) -> RequestTask { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} @@ -124,7 +124,7 @@ extension {{projectName}}API { {{/isDeprecated}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> Observable<{{{returnType}}}{{^returnType}}Void{{/returnType}}> { return Observable.create { observer -> Disposable in - let task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + let requestTask = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -141,7 +141,7 @@ extension {{projectName}}API { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -161,9 +161,9 @@ extension {{projectName}}API { {{/isDeprecated}} @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) -> AnyPublisher<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<{{{returnType}}}{{^returnType}}Void{{/returnType}}, Error> { promise in - task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + requestTask = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -179,7 +179,7 @@ extension {{projectName}}API { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -199,7 +199,7 @@ extension {{projectName}}API { {{/isDeprecated}} @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) async throws{{#returnType}} -> {{{returnType}}}{{/returnType}} { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -208,7 +208,7 @@ extension {{projectName}}API { return } - task = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in + requestTask = {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} case let .success(response): @@ -223,8 +223,8 @@ extension {{projectName}}API { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } {{/useAsyncAwait}} @@ -241,7 +241,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 48105ef58d..5ec281b054 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -79,7 +79,7 @@ private var managerStore = SynchronizedDictionary() } @discardableResult - override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let managerId = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createAlamofireSession() @@ -125,6 +125,8 @@ private var managerStore = SynchronizedDictionary() } } + requestTask.set(request: upload) + self.processRequest(request: upload, managerId, apiResponseQueue, completion) } else if contentType == "application/x-www-form-urlencoded" { encoding = URLEncoding(destination: .httpBody) @@ -142,10 +144,10 @@ private var managerStore = SynchronizedDictionary() onProgressReady(request.uploadProgress) } processRequest(request: request, managerId, apiResponseQueue, completion) - return request.task + requestTask.set(request: request) } - return nil + return requestTask } fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index 707577e0da..eeae3c98ae 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -100,7 +100,7 @@ private var credentialStore = SynchronizedDictionary() } @discardableResult - override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} func execute(_ apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ private var credentialStore = SynchronizedDictionary() dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index 9ffe15ebc9..4222b4cbae 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. public var onProgressReady: ((Progress) -> Void)? @@ -47,8 +48,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454..5e179af64e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a5165719f1..d980142c6a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c55..34e8c9c7f2 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index bd5c091925..254930e777 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f253922686..c111e83013 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4..5e01a4a7c3 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index c8f1b66343..577abc9a6a 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -79,7 +79,7 @@ open class AlamofireRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let managerId = UUID().uuidString // Create a new manager for each request to customize its request header let manager = createAlamofireSession() @@ -125,6 +125,8 @@ open class AlamofireRequestBuilder: RequestBuilder { } } + requestTask.set(request: upload) + self.processRequest(request: upload, managerId, apiResponseQueue, completion) } else if contentType == "application/x-www-form-urlencoded" { encoding = URLEncoding(destination: .httpBody) @@ -142,10 +144,10 @@ open class AlamofireRequestBuilder: RequestBuilder { onProgressReady(request.uploadProgress) } processRequest(request: request, managerId, apiResponseQueue, completion) - return request.task + requestTask.set(request: request) } - return nil + return requestTask } fileprivate func processRequest(request: DataRequest, _ managerId: String, _ apiResponseQueue: DispatchQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..fc69bffcc1 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -5,6 +5,7 @@ // import Foundation +import Alamofire protocol JSONEncodable { func encodeToJSON() -> Any @@ -78,3 +79,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var request: Request? + + internal func set(request: Request) { + self.request = request + } + + public func cancel() { + request?.cancel() + request = nil + } +} diff --git a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 31f90f6acf..9dfbc9aa46 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -26,7 +26,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh index 19e1e06dad..719b9c8418 100755 --- a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 4877906db1..bd8044516f 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -21,7 +21,7 @@ open class AnotherFakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class AnotherFakeAPI { return } - task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -39,8 +39,8 @@ open class AnotherFakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 8e449d22dc..1b105b037f 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -20,7 +20,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Bool { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -29,7 +29,7 @@ open class FakeAPI { return } - task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -38,8 +38,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -75,7 +75,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> OuterComposite { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -84,7 +84,7 @@ open class FakeAPI { return } - task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -93,8 +93,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -130,7 +130,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Double { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -139,7 +139,7 @@ open class FakeAPI { return } - task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -148,8 +148,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -185,7 +185,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -194,7 +194,7 @@ open class FakeAPI { return } - task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -203,8 +203,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -240,7 +240,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -249,7 +249,7 @@ open class FakeAPI { return } - task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -258,8 +258,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -296,7 +296,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -305,7 +305,7 @@ open class FakeAPI { return } - task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -314,8 +314,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -355,7 +355,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -364,7 +364,7 @@ open class FakeAPI { return } - task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -373,8 +373,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -425,7 +425,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -434,7 +434,7 @@ open class FakeAPI { return } - task = testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in + requestTask = testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -443,8 +443,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -590,7 +590,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -599,7 +599,7 @@ open class FakeAPI { return } - task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + requestTask = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -608,8 +608,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -673,7 +673,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -682,7 +682,7 @@ open class FakeAPI { return } - task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + requestTask = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -691,8 +691,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -742,7 +742,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -751,7 +751,7 @@ open class FakeAPI { return } - task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + requestTask = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -760,8 +760,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -799,7 +799,7 @@ open class FakeAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -808,7 +808,7 @@ open class FakeAPI { return } - task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + requestTask = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -817,8 +817,8 @@ open class FakeAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 66d801132d..6313692d6d 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -21,7 +21,7 @@ open class FakeClassnameTags123API { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class FakeClassnameTags123API { return } - task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -39,8 +39,8 @@ open class FakeClassnameTags123API { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index f169ed382d..d541b28938 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -21,7 +21,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class PetAPI { return } - task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -39,8 +39,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -81,7 +81,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -90,7 +90,7 @@ open class PetAPI { return } - task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + requestTask = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -99,8 +99,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -153,7 +153,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -162,7 +162,7 @@ open class PetAPI { return } - task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + requestTask = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -171,8 +171,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -217,7 +217,7 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -226,7 +226,7 @@ open class PetAPI { return } - task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + requestTask = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -235,8 +235,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -281,7 +281,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Pet { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -290,7 +290,7 @@ open class PetAPI { return } - task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + requestTask = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -299,8 +299,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -344,7 +344,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -353,7 +353,7 @@ open class PetAPI { return } - task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -362,8 +362,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -405,7 +405,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -414,7 +414,7 @@ open class PetAPI { return } - task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + requestTask = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -423,8 +423,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -477,7 +477,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -486,7 +486,7 @@ open class PetAPI { return } - task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -495,8 +495,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -549,7 +549,7 @@ open class PetAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -558,7 +558,7 @@ open class PetAPI { return } - task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -567,8 +567,8 @@ open class PetAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 41d3a6047d..510311783b 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -21,7 +21,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class StoreAPI { return } - task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -39,8 +39,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -80,7 +80,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [String: Int] { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -89,7 +89,7 @@ open class StoreAPI { return } - task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -98,8 +98,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -139,7 +139,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -148,7 +148,7 @@ open class StoreAPI { return } - task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -157,8 +157,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -199,7 +199,7 @@ open class StoreAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -208,7 +208,7 @@ open class StoreAPI { return } - task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -217,8 +217,8 @@ open class StoreAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f0e57f333c..7cc9a77f01 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -21,7 +21,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -30,7 +30,7 @@ open class UserAPI { return } - task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -39,8 +39,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -78,7 +78,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -87,7 +87,7 @@ open class UserAPI { return } - task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -96,8 +96,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -134,7 +134,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -143,7 +143,7 @@ open class UserAPI { return } - task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -152,8 +152,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -190,7 +190,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -199,7 +199,7 @@ open class UserAPI { return } - task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -208,8 +208,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -250,7 +250,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> User { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -259,7 +259,7 @@ open class UserAPI { return } - task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -268,8 +268,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -310,7 +310,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -319,7 +319,7 @@ open class UserAPI { return } - task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + requestTask = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): continuation.resume(returning: response.body) @@ -328,8 +328,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -371,7 +371,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -380,7 +380,7 @@ open class UserAPI { return } - task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -389,8 +389,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } @@ -427,7 +427,7 @@ open class UserAPI { */ @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { - var task: URLSessionTask? + var requestTask: RequestTask? return try await withTaskCancellationHandler { try Task.checkCancellation() return try await withCheckedThrowingContinuation { continuation in @@ -436,7 +436,7 @@ open class UserAPI { return } - task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + requestTask = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: continuation.resume(returning: ()) @@ -445,8 +445,8 @@ open class UserAPI { } } } - } onCancel: { [task] in - task?.cancel() + } onCancel: { [requestTask] in + requestTask?.cancel() } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 724845424e..e0457cb53c 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -25,9 +25,9 @@ open class AnotherFakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -37,7 +37,7 @@ open class AnotherFakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 27b455e59f..565fb17c66 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -24,9 +24,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -36,7 +36,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -75,9 +75,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -87,7 +87,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -126,9 +126,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -138,7 +138,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -177,9 +177,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -189,7 +189,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -228,9 +228,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -240,7 +240,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -280,9 +280,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + requestTask = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -292,7 +292,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -335,9 +335,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -347,7 +347,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -401,9 +401,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in + requestTask = testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -413,7 +413,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -562,9 +562,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + requestTask = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -574,7 +574,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -641,9 +641,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + requestTask = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -653,7 +653,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -706,9 +706,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + requestTask = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -718,7 +718,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -759,9 +759,9 @@ open class FakeAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + requestTask = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -771,7 +771,7 @@ open class FakeAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index f953861047..a8ad34b07b 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -25,9 +25,9 @@ open class FakeClassnameTags123API { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -37,7 +37,7 @@ open class FakeClassnameTags123API { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 71225a5b53..3f9674b43f 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -25,9 +25,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -37,7 +37,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -81,9 +81,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + requestTask = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -93,7 +93,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -149,9 +149,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<[Pet], Error> { promise in - task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + requestTask = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -161,7 +161,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -209,9 +209,9 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[Pet], Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<[Pet], Error> { promise in - task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + requestTask = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -221,7 +221,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -269,9 +269,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + requestTask = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -281,7 +281,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -328,9 +328,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -340,7 +340,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -385,9 +385,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + requestTask = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -397,7 +397,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -453,9 +453,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -465,7 +465,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -521,9 +521,9 @@ open class PetAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + requestTask = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -533,7 +533,7 @@ open class PetAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index ec3368c105..623d072590 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -25,9 +25,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -37,7 +37,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -80,9 +80,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher<[String: Int], Error> { - var task: URLSessionTask? + var requestTask: RequestTask? return Future<[String: Int], Error> { promise in - task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -92,7 +92,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -135,9 +135,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + requestTask = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -147,7 +147,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -191,9 +191,9 @@ open class StoreAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -203,7 +203,7 @@ open class StoreAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 5ec63243c5..28231e9be5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -25,9 +25,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -37,7 +37,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -78,9 +78,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -90,7 +90,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -130,9 +130,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + requestTask = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -142,7 +142,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -182,9 +182,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -194,7 +194,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -238,9 +238,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + requestTask = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -250,7 +250,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -294,9 +294,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + requestTask = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): promise(.success(response.body)) @@ -306,7 +306,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -351,9 +351,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + requestTask = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -363,7 +363,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } @@ -403,9 +403,9 @@ open class UserAPI { #if canImport(Combine) @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> AnyPublisher { - var task: URLSessionTask? + var requestTask: RequestTask? return Future { promise in - task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + requestTask = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: promise(.success(())) @@ -415,7 +415,7 @@ open class UserAPI { } } .handleEvents(receiveCancel: { - task?.cancel() + requestTask?.cancel() }) .eraseToAnyPublisher() } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index d384b276b4..730957420e 100644 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } } ] diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 6136098ee5..29c50819e2 100644 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -30,7 +30,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh index 79520c7fc3..719b9c8418 100755 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454..5e179af64e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index bf154f2e1d..78c64f76f1 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -20,7 +20,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createXmlItem(xmlItem: XmlItem, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createXmlItem(xmlItem: XmlItem, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createXmlItemWithRequestBuilder(xmlItem: xmlItem).execute(apiResponseQueue) { result in switch result { case .success: @@ -63,7 +63,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -105,7 +105,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -147,7 +147,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -189,7 +189,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -231,7 +231,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -274,7 +274,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -320,7 +320,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -377,7 +377,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -529,7 +529,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -599,7 +599,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -699,7 +699,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: @@ -752,7 +752,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testQueryParameterCollectionFormat(pipe: [String], ioutil: [String], http: [String], url: [String], context: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testQueryParameterCollectionFormatWithRequestBuilder(pipe: pipe, ioutil: ioutil, http: http, url: url, context: context).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c55..34e8c9c7f2 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 655b2358c5..6d37af7299 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: Set, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Set?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: Set, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Set?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f253922686..c111e83013 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4..5e01a4a7c3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index d384b276b4..730957420e 100644 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } } ] diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 31f90f6acf..9dfbc9aa46 100644 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -26,7 +26,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh index 19e1e06dad..719b9c8418 100755 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift index b40334cece..79ef8ff207 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 59a82575aa..ed7c4d5c1f 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(pet: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(pet: pet).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 0f5624f3e1..b09bede078 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(order: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(order: order).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 26c12a61e6..c68667274c 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: @@ -113,7 +113,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(user: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(user: user).execute(apiResponseQueue) { result in switch result { case .success: @@ -159,7 +159,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -209,7 +209,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -256,7 +256,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -304,7 +304,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -350,7 +350,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, user: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, user: user).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift index 571d0564ce..2dc59ba173 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ internal class RequestBuilder { internal let parameters: [String: Any]? internal let method: String internal let URLString: String + internal let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ internal class RequestBuilder { } @discardableResult - internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } internal func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index f5d2ab74a2..fee5f2b8cc 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ internal class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 31c875915a..344309b20b 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -485,7 +485,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ internal class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index e6f46831cf..ff9d932c5a 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ internal class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 74aa56a14e..84428b2b76 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ internal class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ internal class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 111ce53225..226802df83 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ internal class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index f8a4404579..352cb794c3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ internal class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + internal class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 60869f63ef..7fcbd1ee51 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ internal class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +internal final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + internal func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 0d4c11bc1a..929cbc5f04 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ internal class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override internal func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ internal class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index d84e62c007..c8199c1635 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 5396fe8dd3..3211e37fe6 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -485,7 +485,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 153aaa15d8..897771399d 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 58fbeae4d6..851cba5071 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ import AnyCodable */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index c4c37878af..333059bb10 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index fc6c823089..6a9da2b760 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ import AnyCodable - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift index 312ef27277..96e432a19d 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift index 0fabebe641..f17b96cd1f 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/APIs/DefaultAPI.swift @@ -18,7 +18,7 @@ open class DefaultAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func rootGet(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Fruit?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func rootGet(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Fruit?, _ error: Error?) -> Void)) -> RequestTask { return rootGetWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index 63ce26f05e..b1a805eecf 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,13 +6,13 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } }, { "package": "PromiseKit", - "repositoryURL": "https://github.com/mxcl/PromiseKit.git", + "repositoryURL": "https://github.com/mxcl/PromiseKit", "state": { "branch": null, "revision": "d2f7ba14bcdc45e18f4f60ad9df883fb9055f081", diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index b29dfa48ec..ff6de167c8 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -27,7 +27,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh index 79520c7fc3..719b9c8418 100755 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454..5e179af64e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a5165719f1..d980142c6a 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c55..34e8c9c7f2 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index bd5c091925..254930e777 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f253922686..c111e83013 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4..5e01a4a7c3 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index c097bc87b6..c684ae4fad 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -19,6 +19,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -41,8 +42,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 03e84c9a2e..2c96460870 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index db0c4cb351..e347440638 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 0749c5c9dc..bc8e16a86d 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the result */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 33bc3ed33a..d88ad67da7 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[Pet], ErrorResponse>) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 6ce5440ab9..766f89065f 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String: Int], ErrorResponse>) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<[String: Int], ErrorResponse>) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index bca3f08fe8..0a40144f75 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the result */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ result: Swift.Result) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index 34db22eeb1..336e8a19e3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -22,7 +22,7 @@ open class AnotherFakeAPI { */ open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -33,7 +33,7 @@ open class AnotherFakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 4d998a5321..e27e0b6c2d 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -21,7 +21,7 @@ open class FakeAPI { */ open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -32,7 +32,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -69,7 +69,7 @@ open class FakeAPI { */ open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -80,7 +80,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -117,7 +117,7 @@ open class FakeAPI { */ open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -128,7 +128,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -165,7 +165,7 @@ open class FakeAPI { */ open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -176,7 +176,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -213,7 +213,7 @@ open class FakeAPI { */ open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -224,7 +224,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -262,7 +262,7 @@ open class FakeAPI { */ open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in + let requestTask = testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -273,7 +273,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -314,7 +314,7 @@ open class FakeAPI { */ open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -325,7 +325,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -377,7 +377,7 @@ open class FakeAPI { */ open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in + let requestTask = testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -388,7 +388,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -535,7 +535,7 @@ open class FakeAPI { */ open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in + let requestTask = testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -546,7 +546,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -611,7 +611,7 @@ open class FakeAPI { */ open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in + let requestTask = testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -622,7 +622,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -673,7 +673,7 @@ open class FakeAPI { */ open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in + let requestTask = testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -684,7 +684,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -723,7 +723,7 @@ open class FakeAPI { */ open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in + let requestTask = testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -734,7 +734,7 @@ open class FakeAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index a19dd70dd4..bd7da53d60 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -22,7 +22,7 @@ open class FakeClassnameTags123API { */ open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -33,7 +33,7 @@ open class FakeClassnameTags123API { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 73e4a43c65..a1fa17f78b 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -22,7 +22,7 @@ open class PetAPI { */ open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -33,7 +33,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -75,7 +75,7 @@ open class PetAPI { */ open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in + let requestTask = deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -86,7 +86,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -140,7 +140,7 @@ open class PetAPI { */ open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in - let task = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in + let requestTask = findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -151,7 +151,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -197,7 +197,7 @@ open class PetAPI { @available(*, deprecated, message: "This operation is deprecated.") open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[Pet]> { return Observable.create { observer -> Disposable in - let task = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in + let requestTask = findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -208,7 +208,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -254,7 +254,7 @@ open class PetAPI { */ open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in + let requestTask = getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -265,7 +265,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -310,7 +310,7 @@ open class PetAPI { */ open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -321,7 +321,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -364,7 +364,7 @@ open class PetAPI { */ open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in + let requestTask = updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -375,7 +375,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -429,7 +429,7 @@ open class PetAPI { */ open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in + let requestTask = uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -440,7 +440,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -494,7 +494,7 @@ open class PetAPI { */ open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in + let requestTask = uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -505,7 +505,7 @@ open class PetAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 09ef361562..283b7332c5 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -22,7 +22,7 @@ open class StoreAPI { */ open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + let requestTask = deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -33,7 +33,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -74,7 +74,7 @@ open class StoreAPI { */ open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable<[String: Int]> { return Observable.create { observer -> Disposable in - let task = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in + let requestTask = getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -85,7 +85,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -126,7 +126,7 @@ open class StoreAPI { */ open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in + let requestTask = getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -137,7 +137,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -179,7 +179,7 @@ open class StoreAPI { */ open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -190,7 +190,7 @@ open class StoreAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index be932ce5e3..c0be612ac9 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -22,7 +22,7 @@ open class UserAPI { */ open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -33,7 +33,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -72,7 +72,7 @@ open class UserAPI { */ open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -83,7 +83,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -121,7 +121,7 @@ open class UserAPI { */ open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in + let requestTask = createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -132,7 +132,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -170,7 +170,7 @@ open class UserAPI { */ open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + let requestTask = deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -181,7 +181,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -223,7 +223,7 @@ open class UserAPI { */ open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in + let requestTask = getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -234,7 +234,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -276,7 +276,7 @@ open class UserAPI { */ open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in + let requestTask = loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): observer.onNext(response.body) @@ -287,7 +287,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -330,7 +330,7 @@ open class UserAPI { */ open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in + let requestTask = logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -341,7 +341,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } @@ -379,7 +379,7 @@ open class UserAPI { */ open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) -> Observable { return Observable.create { observer -> Disposable in - let task = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in + let requestTask = updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: observer.onNext(()) @@ -390,7 +390,7 @@ open class UserAPI { } return Disposables.create { - task?.cancel() + requestTask.cancel() } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index 231d853696..dde8565ecf 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,13 +6,13 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } }, { "package": "RxSwift", - "repositoryURL": "https://github.com/ReactiveX/RxSwift.git", + "repositoryURL": "https://github.com/ReactiveX/RxSwift", "state": { "branch": null, "revision": "7c17a6ccca06b5c107cfa4284e634562ddaf5951", diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index db7609caf0..d5da81a120 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -28,7 +28,7 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh index 79520c7fc3..719b9c8418 100755 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/swift5_test_all.sh b/samples/client/petstore/swift5/swift5_test_all.sh index faeb4ca6aa..5fdedca328 100755 --- a/samples/client/petstore/swift5/swift5_test_all.sh +++ b/samples/client/petstore/swift5/swift5_test_all.sh @@ -5,13 +5,12 @@ set -e DIRECTORY=`dirname $0` # example project with unit tests -# temporarily commment them because they are flaky -# mvn -f $DIRECTORY/alamofireLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/combineLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/default/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/promisekitLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/rxswiftLibrary/SwaggerClientTests/pom.xml integration-test -# mvn -f $DIRECTORY/urlsessionLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/alamofireLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/combineLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/default/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/promisekitLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/rxswiftLibrary/SwaggerClientTests/pom.xml integration-test +mvn -f $DIRECTORY/urlsessionLibrary/SwaggerClientTests/pom.xml integration-test # spm build mvn -f $DIRECTORY/alamofireLibrary/pom.xml integration-test diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 7759248e53..20dfa6d14c 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -23,7 +23,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 80d050c6d3..f336d4b552 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -22,7 +22,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -64,7 +64,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -106,7 +106,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -148,7 +148,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -190,7 +190,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -233,7 +233,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -279,7 +279,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -336,7 +336,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -488,7 +488,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -558,7 +558,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -614,7 +614,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -658,7 +658,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index f796858836..e1608abb40 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -23,7 +23,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index ffcf8725e9..551edaf0db 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -23,7 +23,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -70,7 +70,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -129,7 +129,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -180,7 +180,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -231,7 +231,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -281,7 +281,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -329,7 +329,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -388,7 +388,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -447,7 +447,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 8c57ab9497..052761d676 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -23,7 +23,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -69,7 +69,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -115,7 +115,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -162,7 +162,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index 90bc5143fa..242239a1a9 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -23,7 +23,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -110,7 +110,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -153,7 +153,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -200,7 +200,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -247,7 +247,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -295,7 +295,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -338,7 +338,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved index d384b276b4..730957420e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Flight-School/AnyCodable", "state": { "branch": null, - "revision": "876d162385e9862ae8b3c8d65dc301312b040005", - "version": "0.6.0" + "revision": "b1a7a8a6186f2fcb28f7bda67cfc545de48b3c80", + "version": "0.6.2" } } ] diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift index a28a4c90c0..b1f37b4ea8 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClient/BearerDecodableRequestBuilder.swift @@ -20,8 +20,8 @@ class BearerRequestBuilderFactory: RequestBuilderFactory { } class BearerRequestBuilder: URLSessionRequestBuilder { - override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, Error>) -> Void) { - + @discardableResult + override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, ErrorResponse>) -> Void) -> RequestTask { // Before making the request, we can validate if we have a bearer token to be able to make a request BearerTokenHandler.refreshTokenIfDoesntExist { @@ -61,12 +61,14 @@ class BearerRequestBuilder: URLSessionRequestBuilder { } } } + + return requestTask } } class BearerDecodableRequestBuilder: URLSessionDecodableRequestBuilder { - override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, Error>) -> Void) { - + @discardableResult + override func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (Result, ErrorResponse>) -> Void) -> RequestTask { // Before making the request, we can validate if we have a bearer token to be able to make a request BearerTokenHandler.refreshTokenIfDoesntExist { @@ -106,6 +108,8 @@ class BearerDecodableRequestBuilder: URLSessionDecodableRequestBui } } } + + return requestTask } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 31f90f6acf..f1a26cdd41 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -26,11 +26,11 @@ class PetAPITests: XCTestCase { func test1CreatePet() { let expectation = self.expectation(description: "testCreatePet") - let category = PetstoreClient.Category(id: 1234, name: "eyeColor") - let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) + let category = PetstoreClientAPI.Category(id: 1234, name: "eyeColor") + let tags = [PetstoreClientAPI.Tag(id: 1234, name: "New York"), PetstoreClientAPI.Tag(id: 124321, name: "Jose")] + let newPet = PetstoreClientAPI.Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) - PetAPI.addPet(body: newPet) { (_, error) in + PetstoreClientAPI.PetAPI.addPet(body: newPet) { (_, error) in guard error == nil else { XCTFail("error creating pet") return @@ -45,7 +45,7 @@ class PetAPITests: XCTestCase { func test2GetPet() { let expectation = self.expectation(description: "testGetPet") - PetAPI.getPetById(petId: 1000) { (pet, error) in + PetstoreClientAPI.PetAPI.getPetById(petId: 1000) { (pet, error) in guard error == nil else { XCTFail("error retrieving pet") return @@ -74,7 +74,7 @@ class PetAPITests: XCTestCase { fatalError() } - PetAPI.uploadFile(petId: 1000, additionalMetadata: "additionalMetadata", file: imageURL) { (_, error) in + PetstoreClientAPI.PetAPI.uploadFile(petId: 1000, additionalMetadata: "additionalMetadata", file: imageURL) { (_, error) in guard error == nil else { FileUtils.deleteFile(fileURL: imageURL) XCTFail("error uploading file") @@ -91,7 +91,7 @@ class PetAPITests: XCTestCase { func test4DeletePet() { let expectation = self.expectation(description: "testDeletePet") - PetAPI.deletePet(petId: 1000) { (_, error) in + PetstoreClientAPI.PetAPI.deletePet(petId: 1000) { (_, error) in guard error == nil else { XCTFail("error deleting pet") return diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift index 94cb489e5f..6975264238 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -19,10 +19,10 @@ class StoreAPITests: XCTestCase { func test1PlaceOrder() { // use explicit naming to reference the enum so that we test we don't regress on enum naming let shipDate = Date() - let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) + let order = PetstoreClientAPI.Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) let expectation = self.expectation(description: "testPlaceOrder") - StoreAPI.placeOrder(body: order) { (order, error) in + PetstoreClientAPI.StoreAPI.placeOrder(body: order) { (order, error) in guard error == nil else { XCTFail("error placing order: \(error.debugDescription)") return @@ -45,7 +45,7 @@ class StoreAPITests: XCTestCase { func test2GetOrder() { let expectation = self.expectation(description: "testGetOrder") - StoreAPI.getOrderById(orderId: 1000) { (order, error) in + PetstoreClientAPI.StoreAPI.getOrderById(orderId: 1000) { (order, error) in guard error == nil else { XCTFail("error retrieving order: \(error.debugDescription)") return @@ -59,14 +59,14 @@ class StoreAPITests: XCTestCase { expectation.fulfill() } } - + self.waitForExpectations(timeout: testTimeout, handler: nil) } func test3DeleteOrder() { let expectation = self.expectation(description: "testDeleteOrder") - StoreAPI.deleteOrder(orderId: "1000") { (response, error) in + PetstoreClientAPI.StoreAPI.deleteOrder(orderId: "1000") { (response, error) in guard error == nil else { XCTFail("error deleting order") return @@ -86,7 +86,7 @@ class StoreAPITests: XCTestCase { func testDownloadProgress() { let responseExpectation = self.expectation(description: "obtain response") let progressExpectation = self.expectation(description: "obtain progress") - let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) + let requestBuilder = PetstoreClientAPI.StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) requestBuilder.onProgressReady = { (_) in progressExpectation.fulfill() diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift index 0a1ca3902e..2041d1208e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -27,7 +27,7 @@ class UserAPITests: XCTestCase { func testLogin() { let expectation = self.expectation(description: "testLogin") - UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in + PetstoreClientAPI.UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in guard error == nil else { XCTFail("error logging in") return @@ -42,7 +42,7 @@ class UserAPITests: XCTestCase { func testLogout() { let expectation = self.expectation(description: "testLogout") - UserAPI.logoutUser { (_, error) in + PetstoreClientAPI.UserAPI.logoutUser { (_, error) in guard error == nil else { XCTFail("error logging out") return @@ -58,7 +58,7 @@ class UserAPITests: XCTestCase { // The path for this operation is /user/{userId}. In order to make a usable path, // then we must make sure that {userId} is percent-escaped when it is substituted // into the path. So we intentionally introduce a path with spaces. - let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") + let userRequestBuilder = PetstoreClientAPI.UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") let urlContainsSpace = userRequestBuilder.URLString.contains(" ") XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh index 19e1e06dad..719b9c8418 100755 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,5 +1,3 @@ #!/bin/sh -pod install - -xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454..5e179af64e 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index a5165719f1..d980142c6a 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c55..34e8c9c7f2 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index bd5c091925..254930e777 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, requiredFile: requiredFile, additionalMetadata: additionalMetadata).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f253922686..c111e83013 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4..5e01a4a7c3 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { From 347b75a024452d8fbdfc3864084d2f613004d7ca Mon Sep 17 00:00:00 2001 From: Justin Black Date: Wed, 8 Dec 2021 13:03:08 -0800 Subject: [PATCH 06/54] Fixes paramName and dataType for request body anyType parameters (#11075) * Adds request body of any type * Fixes param dataType, paramName, and baseName * Uses updateRequestBodyForPrimitiveType as the else case for anyType request bodies like the code used to do * Samples updated * Samples regenerated --- .../openapitools/codegen/DefaultCodegen.java | 2 + .../resources/3_0/oneOfArrayMapImport.yaml | 10 ++++ .../Classes/OpenAPIs/APIs.swift | 5 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 ++++----- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 +++---- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +-- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 +++--- .../Classes/OpenAPIs/Models.swift | 13 +++++ .../OpenAPIs/URLSessionImplementations.swift | 8 +-- .../builds/default/api/default.service.ts | 51 +++++++++++++++++++ 12 files changed, 118 insertions(+), 41 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index e97a6caf55..e76b78d6e5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -6721,6 +6721,8 @@ public class DefaultCodegen implements CodegenConfig { } else if (ModelUtils.isObjectSchema(schema)) { // object type schema OR (AnyType schema with properties defined) this.addBodyModelSchema(codegenParameter, name, schema, imports, bodyParameterName, false); + } else { + updateRequestBodyForPrimitiveType(codegenParameter, schema, bodyParameterName, imports); } addVarsRequiredVarsAdditionalProps(schema, codegenParameter); } else { diff --git a/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml b/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml index 9fb06fc38f..ed2a9f02e3 100644 --- a/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/oneOfArrayMapImport.yaml @@ -12,6 +12,16 @@ paths: application/json: schema: $ref: '#/components/schemas/fruit' + put: + operationId: test + parameters: [] + requestBody: + content: + application/json: + schema: {} + responses: + '204': + description: Success components: schemas: fruit: diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift index a7933c418a..485585212d 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -27,6 +27,7 @@ open class RequestBuilder { public let parameters: [String: Any]? public let method: String public let URLString: String + public let requestTask: RequestTask = RequestTask() /// Optional block to obtain a reference to the request's progress instance when available. /// With the URLSession http client the request's progress only works on iOS 11.0, macOS 10.13, macCatalyst 13.0, tvOS 11.0, watchOS 4.0. @@ -49,8 +50,8 @@ open class RequestBuilder { } @discardableResult - open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { - return nil + open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { + return requestTask } public func addHeader(name: String, value: String) -> Self { diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index ac45c1f454..5e179af64e 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -20,7 +20,7 @@ open class AnotherFakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return call123testSpecialTagsWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 9f5c7a495e..eac6aeb1a3 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -19,7 +19,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -61,7 +61,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterCompositeSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -103,7 +103,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterNumberSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -145,7 +145,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return fakeOuterStringSerializeWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -187,7 +187,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithFileSchemaWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -230,7 +230,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testBodyWithQueryParamsWithRequestBuilder(query: query, body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -276,7 +276,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClientModelWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -333,7 +333,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEndpointParameters(integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, number: Double, float: Float? = nil, double: Double, string: String? = nil, patternWithoutDelimiter: String, byte: Data, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEndpointParametersWithRequestBuilder(integer: integer, int32: int32, int64: int64, number: number, float: float, double: double, string: string, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute(apiResponseQueue) { result in switch result { case .success: @@ -485,7 +485,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute(apiResponseQueue) { result in switch result { case .success: @@ -555,7 +555,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testGroupParametersWithRequestBuilder(requiredStringGroup: requiredStringGroup, requiredBooleanGroup: requiredBooleanGroup, requiredInt64Group: requiredInt64Group, stringGroup: stringGroup, booleanGroup: booleanGroup, int64Group: int64Group).execute(apiResponseQueue) { result in switch result { case .success: @@ -611,7 +611,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testInlineAdditionalPropertiesWithRequestBuilder(param: param).execute(apiResponseQueue) { result in switch result { case .success: @@ -655,7 +655,7 @@ open class FakeAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index ac274a7c55..34e8c9c7f2 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -20,7 +20,7 @@ open class FakeClassnameTags123API { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) -> RequestTask { return testClassnameWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index 2baca7e644..1fc238359a 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -20,7 +20,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return addPetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -67,7 +67,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deletePet(apiKey: String? = nil, petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deletePetWithRequestBuilder(apiKey: apiKey, petId: petId).execute(apiResponseQueue) { result in switch result { case .success: @@ -126,7 +126,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByStatusWithRequestBuilder(status: status).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -177,7 +177,7 @@ open class PetAPI { */ @available(*, deprecated, message: "This operation is deprecated.") @discardableResult - open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) -> RequestTask { return findPetsByTagsWithRequestBuilder(tags: tags).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -228,7 +228,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) -> RequestTask { return getPetByIdWithRequestBuilder(petId: petId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -278,7 +278,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -326,7 +326,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute(apiResponseQueue) { result in switch result { case .success: @@ -385,7 +385,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -444,7 +444,7 @@ open class PetAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func uploadFileWithRequiredFile(petId: Int64, additionalMetadata: String? = nil, requiredFile: URL, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) -> RequestTask { return uploadFileWithRequiredFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, requiredFile: requiredFile).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index f253922686..c111e83013 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -20,7 +20,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteOrderWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case .success: @@ -66,7 +66,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) -> RequestTask { return getInventoryWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -112,7 +112,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return getOrderByIdWithRequestBuilder(orderId: orderId).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -159,7 +159,7 @@ open class StoreAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) -> RequestTask { return placeOrderWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case let .success(response): diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 3fc59f9ef4..5e01a4a7c3 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -20,7 +20,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUserWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -64,7 +64,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithArrayInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -107,7 +107,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return createUsersWithListInputWithRequestBuilder(body: body).execute(apiResponseQueue) { result in switch result { case .success: @@ -150,7 +150,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return deleteUserWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case .success: @@ -197,7 +197,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) -> RequestTask { return getUserByNameWithRequestBuilder(username: username).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -244,7 +244,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) -> RequestTask { return loginUserWithRequestBuilder(username: username, password: password).execute(apiResponseQueue) { result in switch result { case let .success(response): @@ -292,7 +292,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return logoutUserWithRequestBuilder().execute(apiResponseQueue) { result in switch result { case .success: @@ -335,7 +335,7 @@ open class UserAPI { - parameter completion: completion handler to receive the data and the error objects */ @discardableResult - open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> URLSessionTask? { + open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) -> RequestTask { return updateUserWithRequestBuilder(username: username, body: body).execute(apiResponseQueue) { result in switch result { case .success: diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift index 7787127c40..7cb4e06d16 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -78,3 +78,16 @@ open class Response { self.init(statusCode: response.statusCode, header: header, body: body) } } + +public final class RequestTask { + private var task: URLSessionTask? + + internal func set(task: URLSessionTask) { + self.task = task + } + + public func cancel() { + task?.cancel() + task = nil + } +} diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index fe7fb6683b..23df908ca3 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -100,7 +100,7 @@ open class URLSessionRequestBuilder: RequestBuilder { } @discardableResult - override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> URLSessionTask? { + override open func execute(_ apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue, _ completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) -> RequestTask { let urlSession = createURLSession() guard let xMethod = HTTPMethod(rawValue: method) else { @@ -172,14 +172,14 @@ open class URLSessionRequestBuilder: RequestBuilder { dataTask.resume() - return dataTask + requestTask.set(task: dataTask) } catch { apiResponseQueue.async { completion(.failure(ErrorResponse.error(415, nil, nil, error))) } - - return nil } + + return requestTask } fileprivate func processRequestResponse(urlRequest: URLRequest, data: Data?, response: URLResponse?, error: Error?, completion: @escaping (_ result: Swift.Result, ErrorResponse>) -> Void) { diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts index 6a74ef3266..7363f44f94 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts @@ -128,4 +128,55 @@ export class DefaultService { ); } + /** + * @param body + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public test(body?: any, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable; + public test(body?: any, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public test(body?: any, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined,}): Observable>; + public test(body?: any, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined,}): Observable { + + let localVarHeaders = this.defaultHeaders; + + let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept; + if (localVarHttpHeaderAcceptSelected === undefined) { + // to determine the Accept header + const httpHeaderAccepts: string[] = [ + ]; + localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); + } + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' = 'json'; + if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } + + return this.httpClient.put(`${this.configuration.basePath}/`, + body, + { + responseType: responseType_, + withCredentials: this.configuration.withCredentials, + headers: localVarHeaders, + observe: observe, + reportProgress: reportProgress + } + ); + } + } From b755ae288afe9b4d23de14e72ff6dc7735686690 Mon Sep 17 00:00:00 2001 From: Tomasz Prus Date: Wed, 8 Dec 2021 22:15:26 +0100 Subject: [PATCH 07/54] [Python] Add option to select/detect content-type. (#10978) * [Python] Add option to select/detect content-type. * Regenerate samples after rebase. * Update samples. * test: fix assertion --- .../src/main/resources/python/api.mustache | 5 + .../main/resources/python/api_client.mustache | 34 +++-- .../petstore_api/api/another_fake_api.py | 5 + .../python/petstore_api/api/fake_api.py | 80 ++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../python/petstore_api/api/pet_api.py | 45 ++++++ .../python/petstore_api/api/store_api.py | 20 +++ .../python/petstore_api/api/user_api.py | 40 +++++ .../python/petstore_api/api_client.py | 34 +++-- .../petstore/python/test/test_fake_api.py | 1 + .../petstore/python/tests/test_api_client.py | 10 ++ .../petstore/python/tests/test_pet_api.py | 25 +++- .../petstore_api/api/another_fake_api.py | 5 + .../petstore_api/api/fake_api.py | 80 ++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../petstore_api/api/pet_api.py | 45 ++++++ .../petstore_api/api/store_api.py | 20 +++ .../petstore_api/api/user_api.py | 40 +++++ .../petstore_api/api_client.py | 34 +++-- .../test/test_fake_api.py | 1 + .../python/x_auth_id_alias/api/usage_api.py | 20 +++ .../python/x_auth_id_alias/api_client.py | 34 +++-- .../python/dynamic_servers/api/usage_api.py | 10 ++ .../python/dynamic_servers/api_client.py | 34 +++-- .../petstore_api/api/another_fake_api.py | 5 + .../python/petstore_api/api/default_api.py | 5 + .../python/petstore_api/api/fake_api.py | 140 ++++++++++++++++++ .../api/fake_classname_tags_123_api.py | 5 + .../python/petstore_api/api/pet_api.py | 35 +++++ .../python/petstore_api/api/store_api.py | 20 +++ .../python/petstore_api/api/user_api.py | 40 +++++ .../python/petstore_api/api_client.py | 34 +++-- 32 files changed, 855 insertions(+), 61 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/python/api.mustache b/modules/openapi-generator/src/main/resources/python/api.mustache index 841ac8bb85..bba20b6210 100644 --- a/modules/openapi-generator/src/main/resources/python/api.mustache +++ b/modules/openapi-generator/src/main/resources/python/api.mustache @@ -270,6 +270,9 @@ class {{classname}}(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -298,6 +301,8 @@ class {{classname}}(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') {{#requiredParams}} kwargs['{{paramName}}'] = \ diff --git a/modules/openapi-generator/src/main/resources/python/api_client.mustache b/modules/openapi-generator/src/main/resources/python/api_client.mustache index 91591e10cc..b083d401dd 100644 --- a/modules/openapi-generator/src/main/resources/python/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/python/api_client.mustache @@ -129,7 +129,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -584,10 +585,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -595,6 +598,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -685,7 +693,8 @@ class Endpoint(object): '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -698,7 +707,8 @@ class Endpoint(object): '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -845,12 +855,16 @@ class Endpoint(object): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 2ae65760a3..1411f08cbc 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -119,6 +119,9 @@ class AnotherFakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -147,6 +150,8 @@ class AnotherFakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index 4afa17e3cb..a21d5838f4 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -1132,6 +1132,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1160,6 +1163,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_model_endpoint.call_with_http_info(**kwargs) @@ -1194,6 +1199,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1222,6 +1230,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.boolean_endpoint.call_with_http_info(**kwargs) @@ -1258,6 +1268,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1286,6 +1299,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['xml_item'] = \ xml_item @@ -1322,6 +1337,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1350,6 +1368,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -1384,6 +1404,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1412,6 +1435,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) @@ -1446,6 +1471,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1474,6 +1502,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_endpoint.call_with_http_info(**kwargs) @@ -1508,6 +1538,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1536,6 +1569,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_enum_endpoint.call_with_http_info(**kwargs) @@ -1572,6 +1607,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1600,6 +1638,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1639,6 +1679,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1667,6 +1710,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query @@ -1707,6 +1752,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1735,6 +1783,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1781,6 +1831,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1809,6 +1862,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query_integer'] = \ query_integer @@ -1871,6 +1926,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1899,6 +1957,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['number'] = \ number @@ -1948,6 +2008,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1976,6 +2039,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) @@ -2019,6 +2084,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2047,6 +2115,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['required_string_group'] = \ required_string_group @@ -2088,6 +2158,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2116,6 +2189,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param @@ -2155,6 +2230,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2183,6 +2261,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 54fdf7f892..76e35824fb 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,9 @@ class FakeClassnameTags123Api(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -149,6 +152,8 @@ class FakeClassnameTags123Api(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index 1a8a4c51fd..13fb1d981f 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -584,6 +584,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -612,6 +615,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -650,6 +655,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -678,6 +686,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -716,6 +726,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -744,6 +757,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['status'] = \ status @@ -782,6 +797,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -810,6 +828,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['tags'] = \ tags @@ -848,6 +868,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -876,6 +899,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -913,6 +938,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -941,6 +969,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -980,6 +1010,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1008,6 +1041,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1048,6 +1083,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1076,6 +1114,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1116,6 +1156,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1144,6 +1187,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index cd573a9112..934c552599 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -265,6 +265,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -293,6 +296,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -328,6 +333,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -356,6 +364,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.get_inventory_endpoint.call_with_http_info(**kwargs) @@ -392,6 +402,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -420,6 +433,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -457,6 +472,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -485,6 +503,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 3088eb159f..78cc2f4a8b 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -452,6 +452,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -480,6 +483,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -517,6 +522,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -545,6 +553,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -582,6 +592,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -610,6 +623,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -648,6 +663,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -676,6 +694,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -713,6 +733,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -741,6 +764,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -780,6 +805,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -808,6 +836,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -844,6 +874,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -872,6 +905,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.logout_user_endpoint.call_with_http_info(**kwargs) @@ -910,6 +945,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -938,6 +976,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index 9e6f152349..7b4eea830e 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -131,7 +131,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ class Endpoint(object): '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ class Endpoint(object): '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ class Endpoint(object): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index 9275f2047c..c8345a8760 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -121,6 +121,7 @@ class TestFakeApi(unittest.TestCase): call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, + _content_type=None, _host_index=None, _preload_content=True, _request_timeout=None, diff --git a/samples/client/petstore/python/tests/test_api_client.py b/samples/client/petstore/python/tests/test_api_client.py index c249bf1fc5..35747c8421 100644 --- a/samples/client/petstore/python/tests/test_api_client.py +++ b/samples/client/petstore/python/tests/test_api_client.py @@ -122,6 +122,16 @@ class ApiClientTests(unittest.TestCase): content_type = self.api_client.select_header_content_type(content_types) self.assertEqual(content_type, 'application/json') + content_types = ['application/json-patch+json', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types, + 'PATCH', [{ "op": "add", "path": "/myPath", "value": ["myValue"]}]) + self.assertEqual(content_type, 'application/json-patch+json') + + content_types = ['application/json-patch+json', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types, + 'PATCH', {"value": ["myValue"]}) + self.assertEqual(content_type, 'application/json') + def test_sanitize_for_serialization(self): # None data = None diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 38d7a1cc0b..0753f64b23 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -391,7 +391,6 @@ class PetApiTests(unittest.TestCase): file.close() self.pet_api.upload_file(pet_id=self.pet.id, file=file) - def test_delete_pet(self): self.pet_api.add_pet(self.pet) self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") @@ -402,5 +401,29 @@ class PetApiTests(unittest.TestCase): except ApiException as e: self.assertEqual(404, e.status) + @patch.object(petstore_api.ApiClient, 'call_api') + @patch.object(petstore_api.ApiClient, 'select_header_content_type') + def test_call_select_header_content_type(self, mock_select_ct, mock_call_api): + mock_select_ct.return_value = 'application/json' + self.pet_api.add_pet(self.pet) + # check if all arguments are passed to select_header_content_type + mock_select_ct.assert_called_once_with( + ['application/json', 'application/xml'], + 'POST', + self.pet) + mock_call_api.assert_called_once() + self.assertEqual(mock_call_api.mock_calls[0][1][4], + {'Content-Type': 'application/json'}) + + @patch.object(petstore_api.ApiClient, 'call_api') + def test_call_with_forced_content_type(self, mock_call_api): + # force content-type + self.pet_api.add_pet(self.pet, _content_type='application/xml') + mock_call_api.assert_called_once() + # check if content-type is used + self.assertEqual(mock_call_api.mock_calls[0][1][4], + {'Content-Type': 'application/xml'}) + + if __name__ == '__main__': unittest.main() diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py index 2ae65760a3..1411f08cbc 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/another_fake_api.py @@ -119,6 +119,9 @@ class AnotherFakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -147,6 +150,8 @@ class AnotherFakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py index 4afa17e3cb..a21d5838f4 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_api.py @@ -1132,6 +1132,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1160,6 +1163,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_model_endpoint.call_with_http_info(**kwargs) @@ -1194,6 +1199,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1222,6 +1230,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.boolean_endpoint.call_with_http_info(**kwargs) @@ -1258,6 +1268,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1286,6 +1299,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['xml_item'] = \ xml_item @@ -1322,6 +1337,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1350,6 +1368,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -1384,6 +1404,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1412,6 +1435,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) @@ -1446,6 +1471,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1474,6 +1502,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_endpoint.call_with_http_info(**kwargs) @@ -1508,6 +1538,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1536,6 +1569,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_enum_endpoint.call_with_http_info(**kwargs) @@ -1572,6 +1607,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1600,6 +1638,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1639,6 +1679,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1667,6 +1710,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query @@ -1707,6 +1752,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1735,6 +1783,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -1781,6 +1831,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1809,6 +1862,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query_integer'] = \ query_integer @@ -1871,6 +1926,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1899,6 +1957,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['number'] = \ number @@ -1948,6 +2008,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1976,6 +2039,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) @@ -2019,6 +2084,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2047,6 +2115,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['required_string_group'] = \ required_string_group @@ -2088,6 +2158,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2116,6 +2189,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param @@ -2155,6 +2230,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2183,6 +2261,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py index 54fdf7f892..76e35824fb 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,9 @@ class FakeClassnameTags123Api(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -149,6 +152,8 @@ class FakeClassnameTags123Api(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py index 1a8a4c51fd..13fb1d981f 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/pet_api.py @@ -584,6 +584,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -612,6 +615,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -650,6 +655,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -678,6 +686,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -716,6 +726,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -744,6 +757,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['status'] = \ status @@ -782,6 +797,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -810,6 +828,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['tags'] = \ tags @@ -848,6 +868,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -876,6 +899,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -913,6 +938,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -941,6 +969,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -980,6 +1010,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1008,6 +1041,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1048,6 +1083,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1076,6 +1114,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -1116,6 +1156,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1144,6 +1187,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py index cd573a9112..934c552599 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/store_api.py @@ -265,6 +265,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -293,6 +296,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -328,6 +333,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -356,6 +364,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.get_inventory_endpoint.call_with_http_info(**kwargs) @@ -392,6 +402,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -420,6 +433,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -457,6 +472,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -485,6 +503,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py index 3088eb159f..78cc2f4a8b 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api/user_api.py @@ -452,6 +452,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -480,6 +483,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -517,6 +522,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -545,6 +553,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -582,6 +592,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -610,6 +623,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -648,6 +663,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -676,6 +694,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -713,6 +733,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -741,6 +764,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -780,6 +805,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -808,6 +836,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -844,6 +874,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -872,6 +905,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.logout_user_endpoint.call_with_http_info(**kwargs) @@ -910,6 +945,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -938,6 +976,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py index 9e6f152349..7b4eea830e 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/api_client.py @@ -131,7 +131,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ class Endpoint(object): '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ class Endpoint(object): '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ class Endpoint(object): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py index 9275f2047c..c8345a8760 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_fake_api.py @@ -121,6 +121,7 @@ class TestFakeApi(unittest.TestCase): call_with_http_info.assert_called_with( _check_input_type=True, _check_return_type=True, + _content_type=None, _host_index=None, _preload_content=True, _request_timeout=None, diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py index b9bc47de2b..b636697b0c 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api/usage_api.py @@ -243,6 +243,9 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -271,6 +274,8 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.any_key_endpoint.call_with_http_info(**kwargs) @@ -304,6 +309,9 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -332,6 +340,8 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.both_keys_endpoint.call_with_http_info(**kwargs) @@ -365,6 +375,9 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -393,6 +406,8 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.key_in_header_endpoint.call_with_http_info(**kwargs) @@ -426,6 +441,9 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -454,6 +472,8 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.key_in_query_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py index a3407d97a8..0da4612227 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/api_client.py @@ -131,7 +131,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ class Endpoint(object): '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ class Endpoint(object): '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ class Endpoint(object): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py index d9e5929e14..ec975f752c 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api/usage_api.py @@ -198,6 +198,9 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -226,6 +229,8 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.custom_server_endpoint.call_with_http_info(**kwargs) @@ -259,6 +264,9 @@ class UsageApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -287,6 +295,8 @@ class UsageApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.default_server_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py index a2dce8f710..a7d12d3e3c 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py +++ b/samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/api_client.py @@ -131,7 +131,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -664,7 +672,8 @@ class Endpoint(object): '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -677,7 +686,8 @@ class Endpoint(object): '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -824,12 +834,16 @@ class Endpoint(object): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py index c99ba19bce..52d1fc410d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/another_fake_api.py @@ -119,6 +119,9 @@ class AnotherFakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -147,6 +150,8 @@ class AnotherFakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['client'] = \ client diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py index 4d23104e6b..26a35b8e65 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/default_api.py @@ -107,6 +107,9 @@ class DefaultApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -135,6 +138,8 @@ class DefaultApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.foo_get_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py index 0f93d1cfde..dd2db14c8a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_api.py @@ -1720,6 +1720,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1748,6 +1751,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.additional_properties_with_array_of_enums_endpoint.call_with_http_info(**kwargs) @@ -1782,6 +1787,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1810,6 +1818,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_model_endpoint.call_with_http_info(**kwargs) @@ -1843,6 +1853,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1871,6 +1884,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.array_of_enums_endpoint.call_with_http_info(**kwargs) @@ -1905,6 +1920,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1933,6 +1951,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.boolean_endpoint.call_with_http_info(**kwargs) @@ -1967,6 +1987,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -1995,6 +2018,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.composed_one_of_number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -2030,6 +2055,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2058,6 +2086,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['file_name'] = \ file_name @@ -2093,6 +2123,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2121,6 +2154,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.enum_test_endpoint.call_with_http_info(**kwargs) @@ -2153,6 +2188,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2181,6 +2219,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.fake_health_get_endpoint.call_with_http_info(**kwargs) @@ -2217,6 +2257,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2245,6 +2288,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['mammal'] = \ mammal @@ -2281,6 +2326,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2309,6 +2357,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.number_with_validations_endpoint.call_with_http_info(**kwargs) @@ -2343,6 +2393,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2371,6 +2424,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.object_model_with_ref_props_endpoint.call_with_http_info(**kwargs) @@ -2404,6 +2459,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2432,6 +2490,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.post_inline_additional_properties_payload_endpoint.call_with_http_info(**kwargs) @@ -2465,6 +2525,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2493,6 +2556,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.post_inline_additional_properties_ref_payload_endpoint.call_with_http_info(**kwargs) @@ -2527,6 +2592,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2555,6 +2623,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_endpoint.call_with_http_info(**kwargs) @@ -2589,6 +2659,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2617,6 +2690,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.string_enum_endpoint.call_with_http_info(**kwargs) @@ -2653,6 +2728,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2681,6 +2759,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['file_schema_test_class'] = \ file_schema_test_class @@ -2720,6 +2800,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2748,6 +2831,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['query'] = \ query @@ -2788,6 +2873,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2816,6 +2904,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['client'] = \ client @@ -2870,6 +2960,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2898,6 +2991,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['number'] = \ number @@ -2947,6 +3042,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -2975,6 +3073,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.test_enum_parameters_endpoint.call_with_http_info(**kwargs) @@ -3018,6 +3118,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3046,6 +3149,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['required_string_group'] = \ required_string_group @@ -3087,6 +3192,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3115,6 +3223,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['request_body'] = \ request_body @@ -3154,6 +3264,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3182,6 +3295,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['param'] = \ param @@ -3230,6 +3345,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3258,6 +3376,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pipe'] = \ pipe @@ -3301,6 +3421,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3329,6 +3452,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.tx_rx_any_of_model_endpoint.call_with_http_info(**kwargs) @@ -3364,6 +3489,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3392,6 +3520,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['body'] = \ body @@ -3430,6 +3560,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3458,6 +3591,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['file'] = \ file @@ -3493,6 +3628,9 @@ class FakeApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -3521,6 +3659,8 @@ class FakeApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.upload_files_endpoint.call_with_http_info(**kwargs) diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index efcf30af12..0284c348b3 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -121,6 +121,9 @@ class FakeClassnameTags123Api(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -149,6 +152,8 @@ class FakeClassnameTags123Api(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['client'] = \ client diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py index 1ae658e16d..d555b6995a 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/pet_api.py @@ -472,6 +472,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -500,6 +503,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet'] = \ pet @@ -538,6 +543,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -566,6 +574,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -604,6 +614,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -632,6 +645,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['status'] = \ status @@ -670,6 +685,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -698,6 +716,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['tags'] = \ tags @@ -736,6 +756,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -764,6 +787,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id @@ -801,6 +826,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -829,6 +857,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet'] = \ pet @@ -868,6 +898,9 @@ class PetApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -896,6 +929,8 @@ class PetApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['pet_id'] = \ pet_id diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py index 26a6bfe222..c1cb69094f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/store_api.py @@ -267,6 +267,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -295,6 +298,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -330,6 +335,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -358,6 +366,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.get_inventory_endpoint.call_with_http_info(**kwargs) @@ -394,6 +404,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -422,6 +435,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order_id'] = \ order_id @@ -459,6 +474,9 @@ class StoreApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -487,6 +505,8 @@ class StoreApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['order'] = \ order diff --git a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py index 67b33352dd..da2217633f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api/user_api.py @@ -460,6 +460,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -488,6 +491,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['user'] = \ user @@ -525,6 +530,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -553,6 +561,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['user'] = \ user @@ -590,6 +600,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -618,6 +631,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['user'] = \ user @@ -656,6 +671,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -684,6 +702,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -721,6 +741,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -749,6 +772,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -788,6 +813,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -816,6 +844,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username @@ -852,6 +882,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -880,6 +913,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') return self.logout_user_endpoint.call_with_http_info(**kwargs) @@ -918,6 +953,9 @@ class UserApi(object): _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. + _content_type (str/None): force body content-type. + Default is None and content-type will be predicted by allowed + content-types and body. _host_index (int/None): specifies the index of the server that we want to use. Default is read from the configuration. @@ -946,6 +984,8 @@ class UserApi(object): kwargs['_check_return_type'] = kwargs.get( '_check_return_type', True ) + kwargs['_content_type'] = kwargs.get( + '_content_type') kwargs['_host_index'] = kwargs.get('_host_index') kwargs['username'] = \ username diff --git a/samples/openapi3/client/petstore/python/petstore_api/api_client.py b/samples/openapi3/client/petstore/python/petstore_api/api_client.py index 29ae24dd01..86cddf1a7b 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/api_client.py +++ b/samples/openapi3/client/petstore/python/petstore_api/api_client.py @@ -131,7 +131,8 @@ class ApiClient(object): _preload_content: bool = True, _request_timeout: typing.Optional[typing.Union[int, float, typing.Tuple]] = None, _host: typing.Optional[str] = None, - _check_type: typing.Optional[bool] = None + _check_type: typing.Optional[bool] = None, + _content_type: typing.Optional[str] = None ): config = self.configuration @@ -572,10 +573,12 @@ class ApiClient(object): else: return ', '.join(accepts) - def select_header_content_type(self, content_types): + def select_header_content_type(self, content_types, method=None, body=None): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. + :param method: http method (e.g. POST, PATCH). + :param body: http body to send. :return: Content-Type (e.g. application/json). """ if not content_types: @@ -583,6 +586,11 @@ class ApiClient(object): content_types = [x.lower() for x in content_types] + if (method == 'PATCH' and + 'application/json-patch+json' in content_types and + isinstance(body, list)): + return 'application/json-patch+json' + if 'application/json' in content_types or '*/*' in content_types: return 'application/json' else: @@ -671,7 +679,8 @@ class Endpoint(object): '_request_timeout', '_return_http_data_only', '_check_input_type', - '_check_return_type' + '_check_return_type', + '_content_type' ]) self.params_map['nullable'].extend(['_request_timeout']) self.validations = root_map['validations'] @@ -684,7 +693,8 @@ class Endpoint(object): '_request_timeout': (none_type, float, (float,), [float], int, (int,), [int]), '_return_http_data_only': (bool,), '_check_input_type': (bool,), - '_check_return_type': (bool,) + '_check_return_type': (bool,), + '_content_type': (none_type, str) } self.openapi_types.update(extra_types) self.attribute_map = root_map['attribute_map'] @@ -831,12 +841,16 @@ class Endpoint(object): params['header']['Accept'] = self.api_client.select_header_accept( accept_headers_list) - content_type_headers_list = self.headers_map['content_type'] - if content_type_headers_list: - if params['body'] != "": - header_list = self.api_client.select_header_content_type( - content_type_headers_list) - params['header']['Content-Type'] = header_list + if kwargs.get('_content_type'): + params['header']['Content-Type'] = kwargs['_content_type'] + else: + content_type_headers_list = self.headers_map['content_type'] + if content_type_headers_list: + if params['body'] != "": + header_list = self.api_client.select_header_content_type( + content_type_headers_list, self.settings['http_method'], + params['body']) + params['header']['Content-Type'] = header_list return self.api_client.call_api( self.settings['endpoint_path'], self.settings['http_method'], From 550c0781dca1505762e8348f7b692d751b28c766 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Fri, 10 Dec 2021 02:08:17 +0800 Subject: [PATCH 08/54] [okhttp-gson-next-gen] new option for error object (#10995) * add error body and type to api exception class * add option to specify error object * add option, update api doc with better error handling * update samples * update doc --- docs/generators/java.md | 1 + .../codegen/languages/JavaClientCodegen.java | 23 +++++ .../okhttp-gson-nextgen/api.mustache | 28 +++++- .../okhttp-gson-nextgen/apiException.mustache | 40 +++++++++ .../okhttp-gson-nextgen/api_doc.mustache | 22 +++-- .../docs/AnotherFakeApi.md | 6 +- .../okhttp-gson-nextgen/docs/DefaultApi.md | 6 +- .../java/okhttp-gson-nextgen/docs/FakeApi.md | 90 ++++--------------- .../docs/FakeClassnameTags123Api.md | 6 +- .../java/okhttp-gson-nextgen/docs/PetApi.md | 54 ++--------- .../java/okhttp-gson-nextgen/docs/StoreApi.md | 24 +---- .../java/okhttp-gson-nextgen/docs/UserApi.md | 48 ++-------- .../org/openapitools/client/ApiException.java | 40 +++++++++ .../client/api/AnotherFakeApi.java | 11 ++- .../openapitools/client/api/DefaultApi.java | 11 ++- .../org/openapitools/client/api/FakeApi.java | 71 ++++++++++++--- .../client/api/FakeClassnameTags123Api.java | 11 ++- .../org/openapitools/client/api/PetApi.java | 51 ++++++++--- .../org/openapitools/client/api/StoreApi.java | 31 +++++-- .../org/openapitools/client/api/UserApi.java | 21 ++++- 20 files changed, 351 insertions(+), 244 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index 1160c36f8b..4d086325a0 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |gradleProperties|Append additional Gradle proeprties to the gradle.properties file| |null| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index 965da6dbd7..f675c9a9c3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -66,6 +66,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen public static final String DYNAMIC_OPERATIONS = "dynamicOperations"; public static final String SUPPORT_STREAMING = "supportStreaming"; public static final String GRADLE_PROPERTIES= "gradleProperties"; + public static final String ERROR_OBJECT_TYPE= "errorObjectType"; + public static final String ERROR_OBJECT_SUBTYPE= "errorObjectSubtype"; public static final String PLAY_24 = "play24"; public static final String PLAY_25 = "play25"; @@ -118,6 +120,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected boolean dynamicOperations = false; protected boolean supportStreaming = false; protected String gradleProperties; + protected String errorObjectType; + protected List errorObjectSubtype; protected String authFolder; protected String serializationLibrary = null; @@ -163,6 +167,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen cliOptions.add(CliOption.newBoolean(DYNAMIC_OPERATIONS, "Generate operations dynamically at runtime from an OAS", this.dynamicOperations)); cliOptions.add(CliOption.newBoolean(SUPPORT_STREAMING, "Support streaming endpoint (beta)", this.supportStreaming)); cliOptions.add(CliOption.newString(GRADLE_PROPERTIES, "Append additional Gradle proeprties to the gradle.properties file")); + cliOptions.add(CliOption.newString(ERROR_OBJECT_TYPE, "Error Object type. (This option is for okhttp-gson-next-gen only)")); cliOptions.add(CliOption.newString(CONFIG_KEY, "Config key in @RegisterRestClient. Default to none. Only `microprofile` supports this option.")); supportedLibraries.put(JERSEY1, "HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead."); @@ -343,6 +348,16 @@ public class JavaClientCodegen extends AbstractJavaCodegen } additionalProperties.put(GRADLE_PROPERTIES, gradleProperties); + if (additionalProperties.containsKey(ERROR_OBJECT_TYPE)) { + this.setErrorObjectType(additionalProperties.get(ERROR_OBJECT_TYPE).toString()); + } + additionalProperties.put(ERROR_OBJECT_TYPE, errorObjectType); + + if (additionalProperties.containsKey(ERROR_OBJECT_SUBTYPE)) { + this.setErrorObjectSubtype((List)additionalProperties.get(ERROR_OBJECT_SUBTYPE)); + } + additionalProperties.put(ERROR_OBJECT_SUBTYPE, errorObjectSubtype); + final String invokerFolder = (sourceFolder + '/' + invokerPackage).replace(".", "/"); final String apiFolder = (sourceFolder + '/' + apiPackage).replace(".", "/"); final String modelsFolder = (sourceFolder + File.separator + modelPackage().replace('.', File.separatorChar)).replace('/', File.separatorChar); @@ -1030,6 +1045,14 @@ public class JavaClientCodegen extends AbstractJavaCodegen this.gradleProperties= gradleProperties; } + public void setErrorObjectType(final String errorObjectType) { + this.errorObjectType= errorObjectType; + } + + public void setErrorObjectSubtype(final List errorObjectSubtype) { + this.errorObjectSubtype= errorObjectSubtype; + } + /** * Serialization library. * diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache index 525d56fa5d..2b623d2cf8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api.mustache @@ -51,6 +51,7 @@ import java.util.Map; import java.io.InputStream; {{/supportStreaming}} {{/fullJavaUtil}} +import javax.ws.rs.core.GenericType; {{#operations}} public class {{classname}} { @@ -294,13 +295,32 @@ public class {{classname}} { {{/isDeprecated}} public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-streaming}} InputStream {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.executeStream(localVarCall, localVarReturnType);{{/returnType}} + {{#returnType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.executeStream(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); + e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); + throw e; + } + {{/returnType}} } {{/vendorExtensions.x-streaming}}{{^vendorExtensions.x-streaming}} ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { okhttp3.Call localVarCall = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}null); - {{#returnType}}Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType);{{/returnType}}{{^returnType}}return localVarApiClient.execute(localVarCall);{{/returnType}} + {{^returnType}} + return localVarApiClient.execute(localVarCall); + {{/returnType}} + {{#returnType}} + try { + Type localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}.getType())); + e.setErrorObjectType(new GenericType<{{{errorObjectType}}}{{^errorObjectType}}{{{returnType}}}{{/errorObjectType}}>(){}); + throw e; + } + {{/returnType}} } {{/vendorExtensions.x-streaming}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache index 4bec51da93..59da3c51c2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/apiException.mustache @@ -9,6 +9,8 @@ import java.util.Map.Entry; import java.util.TreeMap; {{/caseInsensitiveResponseHeaders}} +import javax.ws.rs.core.GenericType; + /** *

ApiException class.

*/ @@ -18,6 +20,8 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject = null; + private GenericType errorObjectType = null; /** *

Constructor for ApiException.

@@ -156,4 +160,40 @@ public class ApiException extends{{#useRuntimeException}} RuntimeException {{/us public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public {{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject({{{errorObjectType}}}{{^errorObjectType}}Object{{/errorObjectType}} errorObject) { + this.errorObject = errorObject; + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache index 5a4e3969c9..616ad65a5a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/api_doc.mustache @@ -63,11 +63,23 @@ public class Example { .execute();{{/vendorExtensions.x-group-parameters}}{{#returnType}} System.out.println(result);{{/returnType}} } catch (ApiException e) { - System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + {{=< >=}} + <#errorObjectSubtype> + <^-first>} else if (e.getErrorObject() instanceof <&.>) { + // do something here + <#-last> + } else { + // something else happened + System.err.println("Exception when calling {{{classname}}}#{{{operationId}}}"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + + + <={{ }}=> + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md index 149488eff9..af82f73feb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/AnotherFakeApi.md @@ -35,11 +35,7 @@ public class Example { Client result = apiInstance.call123testSpecialTags(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#call123testSpecialTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md index 311c4fa6bb..c77f189afd 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/DefaultApi.md @@ -32,11 +32,7 @@ public class Example { InlineResponseDefault result = apiInstance.fooGet(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling DefaultApi#fooGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md index 3401bb6eeb..bee5368024 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md @@ -46,11 +46,7 @@ public class Example { HealthCheckResult result = apiInstance.fakeHealthGet(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeHealthGet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -105,11 +101,7 @@ public class Example { Boolean result = apiInstance.fakeOuterBooleanSerialize(body); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -167,11 +159,7 @@ public class Example { OuterComposite result = apiInstance.fakeOuterCompositeSerialize(outerComposite); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -229,11 +217,7 @@ public class Example { BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -291,11 +275,7 @@ public class Example { String result = apiInstance.fakeOuterStringSerialize(body); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -350,11 +330,7 @@ public class Example { List result = apiInstance.getArrayOfEnums(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#getArrayOfEnums"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -408,11 +384,7 @@ public class Example { try { apiInstance.testBodyWithFileSchema(fileSchemaTestClass); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testBodyWithFileSchema"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -468,11 +440,7 @@ public class Example { try { apiInstance.testBodyWithQueryParams(query, user); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -531,11 +499,7 @@ public class Example { Client result = apiInstance.testClientModel(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testClientModel"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -611,11 +575,7 @@ public class Example { try { apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -693,11 +653,7 @@ public class Example { try { apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEnumParameters"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -776,11 +732,7 @@ public class Example { .int64Group(int64Group) .execute(); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testGroupParameters"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -840,11 +792,7 @@ public class Example { try { apiInstance.testInlineAdditionalProperties(requestBody); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -900,11 +848,7 @@ public class Example { try { apiInstance.testJsonFormData(param, param2); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testJsonFormData"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -966,11 +910,7 @@ public class Example { try { apiInstance.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); } catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testQueryParameterCollectionFormat"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md index dbd12c37f0..5212d7c778 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeClassnameTags123Api.md @@ -42,11 +42,7 @@ public class Example { Client result = apiInstance.testClassname(client); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md index cca26664de..8cdb1506fb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetApi.md @@ -46,11 +46,7 @@ public class Example { try { apiInstance.addPet(pet); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -111,11 +107,7 @@ public class Example { try { apiInstance.deletePet(petId, apiKey); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -180,11 +172,7 @@ public class Example { List result = apiInstance.findPetsByStatus(status); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -249,11 +237,7 @@ public class Example { List result = apiInstance.findPetsByTags(tags); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -319,11 +303,7 @@ public class Example { Pet result = apiInstance.getPetById(petId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -386,11 +366,7 @@ public class Example { try { apiInstance.updatePet(pet); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -454,11 +430,7 @@ public class Example { try { apiInstance.updatePetWithForm(petId, name, status); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -523,11 +495,7 @@ public class Example { ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -592,11 +560,7 @@ public class Example { ModelApiResponse result = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFileWithRequiredFile"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md index 270388f5e4..8d9dee8e68 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/StoreApi.md @@ -37,11 +37,7 @@ public class Example { try { apiInstance.deleteOrder(orderId); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#deleteOrder"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -106,11 +102,7 @@ public class Example { Map result = apiInstance.getInventory(); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getInventory"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -165,11 +157,7 @@ public class Example { Order result = apiInstance.getOrderById(orderId); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getOrderById"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -227,11 +215,7 @@ public class Example { Order result = apiInstance.placeOrder(order); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling StoreApi#placeOrder"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md index 26a0642e32..5c8ee4c6f5 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/UserApi.md @@ -41,11 +41,7 @@ public class Example { try { apiInstance.createUser(user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -100,11 +96,7 @@ public class Example { try { apiInstance.createUsersWithArrayInput(user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -159,11 +151,7 @@ public class Example { try { apiInstance.createUsersWithListInput(user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithListInput"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -220,11 +208,7 @@ public class Example { try { apiInstance.deleteUser(username); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -281,11 +265,7 @@ public class Example { User result = apiInstance.getUserByName(username); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserByName"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -344,11 +324,7 @@ public class Example { String result = apiInstance.loginUser(username, password); System.out.println(result); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#loginUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -404,11 +380,7 @@ public class Example { try { apiInstance.logoutUser(); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#logoutUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } @@ -463,11 +435,7 @@ public class Example { try { apiInstance.updateUser(username, user); } catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); + } } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java index 5851f0405a..60e4f9a5e7 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/ApiException.java @@ -16,6 +16,8 @@ package org.openapitools.client; import java.util.Map; import java.util.List; +import javax.ws.rs.core.GenericType; + /** *

ApiException class.

*/ @@ -25,6 +27,8 @@ public class ApiException extends Exception { private int code = 0; private Map> responseHeaders = null; private String responseBody = null; + private Object errorObject = null; + private GenericType errorObjectType = null; /** *

Constructor for ApiException.

@@ -151,4 +155,40 @@ public class ApiException extends Exception { public String getResponseBody() { return responseBody; } + + /** + * Get the error object type. + * + * @return Error object type + */ + public GenericType getErrorObjectType() { + return errorObjectType; + } + + /** + * Set the error object type. + * + * @param errorObjectType object type + */ + public void setErrorObjectType(GenericType errorObjectType) { + this.errorObjectType = errorObjectType; + } + + /** + * Get the error object. + * + * @return Error object + */ + public Object getErrorObject() { + return errorObject; + } + + /** + * Get the error object. + * + * @param errorObject Error object + */ + public void setErrorObject(Object errorObject) { + this.errorObject = errorObject; + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index e258256633..b0269aea9f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class AnotherFakeApi { private ApiClient localVarApiClient; @@ -143,8 +144,14 @@ public class AnotherFakeApi { */ public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { okhttp3.Call localVarCall = call123testSpecialTagsValidateBeforeCall(client, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java index c4e26ea2b1..1c8e2d2485 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class DefaultApi { private ApiClient localVarApiClient; @@ -135,8 +136,14 @@ public class DefaultApi { */ public ApiResponse fooGetWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = fooGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java index 3c5114fef1..271df76973 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java @@ -43,6 +43,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeApi { private ApiClient localVarApiClient; @@ -144,8 +145,14 @@ public class FakeApi { */ public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = fakeHealthGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -251,8 +258,14 @@ public class FakeApi { */ public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { okhttp3.Call localVarCall = fakeOuterBooleanSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -359,8 +372,14 @@ public class FakeApi { */ public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { okhttp3.Call localVarCall = fakeOuterCompositeSerializeValidateBeforeCall(outerComposite, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -467,8 +486,14 @@ public class FakeApi { */ public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { okhttp3.Call localVarCall = fakeOuterNumberSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -575,8 +600,14 @@ public class FakeApi { */ public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { okhttp3.Call localVarCall = fakeOuterStringSerializeValidateBeforeCall(body, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -680,8 +711,14 @@ public class FakeApi { */ public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getArrayOfEnumsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -1023,8 +1060,14 @@ public class FakeApi { */ public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { okhttp3.Call localVarCall = testClientModelValidateBeforeCall(client, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index f9449ed442..db7a5f435f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class FakeClassnameTags123Api { private ApiClient localVarApiClient; @@ -143,8 +144,14 @@ public class FakeClassnameTags123Api { */ public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { okhttp3.Call localVarCall = testClassnameValidateBeforeCall(client, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java index d88ee6f9c3..98d73aa76f 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/PetApi.java @@ -36,6 +36,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class PetApi { private ApiClient localVarApiClient; @@ -379,8 +380,14 @@ public class PetApi { */ public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { okhttp3.Call localVarCall = findPetsByStatusValidateBeforeCall(status, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -507,8 +514,14 @@ public class PetApi { @Deprecated public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { okhttp3.Call localVarCall = findPetsByTagsValidateBeforeCall(tags, null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -630,8 +643,14 @@ public class PetApi { */ public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { okhttp3.Call localVarCall = getPetByIdValidateBeforeCall(petId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1003,8 +1022,14 @@ public class PetApi { */ public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { okhttp3.Call localVarCall = uploadFileValidateBeforeCall(petId, additionalMetadata, file, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -1138,8 +1163,14 @@ public class PetApi { */ public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { okhttp3.Call localVarCall = uploadFileWithRequiredFileValidateBeforeCall(petId, requiredFile, additionalMetadata, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java index d9a068df9e..ab5718fb99 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/StoreApi.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class StoreApi { private ApiClient localVarApiClient; @@ -249,8 +250,14 @@ public class StoreApi { */ public ApiResponse> getInventoryWithHttpInfo() throws ApiException { okhttp3.Call localVarCall = getInventoryValidateBeforeCall(null); - Type localVarReturnType = new TypeToken>(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken>(){}.getType())); + e.setErrorObjectType(new GenericType>(){}); + throw e; + } } /** @@ -368,8 +375,14 @@ public class StoreApi { */ public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { okhttp3.Call localVarCall = getOrderByIdValidateBeforeCall(orderId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -486,8 +499,14 @@ public class StoreApi { */ public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { okhttp3.Call localVarCall = placeOrderValidateBeforeCall(order, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java index 0f4f2d294a..4bf2dc2b82 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java @@ -34,6 +34,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.ws.rs.core.GenericType; public class UserApi { private ApiClient localVarApiClient; @@ -591,8 +592,14 @@ public class UserApi { */ public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { okhttp3.Call localVarCall = getUserByNameValidateBeforeCall(username, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** @@ -725,8 +732,14 @@ public class UserApi { */ public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { okhttp3.Call localVarCall = loginUserValidateBeforeCall(username, password, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); + try { + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } catch (ApiException e) { + e.setErrorObject(localVarApiClient.getJSON().getGson().fromJson(e.getResponseBody(), new TypeToken(){}.getType())); + e.setErrorObjectType(new GenericType(){}); + throw e; + } } /** From c94d2b2331fe851c79d86e2cfae6a036de5f1ce5 Mon Sep 17 00:00:00 2001 From: Deniz Dogan Date: Fri, 10 Dec 2021 07:08:32 +0100 Subject: [PATCH 09/54] [swift5] Fix missing case for FormDataEncoding#encode (#11064) Fixes #11062 --- .../alamofire/AlamofireImplementations.mustache | 2 ++ .../urlsession/URLSessionImplementations.mustache | 9 +++++++++ .../Classes/OpenAPIs/AlamofireImplementations.swift | 2 ++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ .../PetstoreClient/URLSessionImplementations.swift | 9 +++++++++ .../Classes/OpenAPIs/URLSessionImplementations.swift | 9 +++++++++ 17 files changed, 139 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache index 5ec281b054..b716d254fa 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/alamofire/AlamofireImplementations.mustache @@ -114,6 +114,8 @@ private var managerStore = SynchronizedDictionary() mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) case let number as NSNumber: mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + case let data as Data: + mpForm.append(data, withName: k) default: fatalError("Unprocessable value \(v) with key \(k)") } diff --git a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache index eeae3c98ae..e235cd3720 100644 --- a/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/libraries/urlsession/URLSessionImplementations.mustache @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift index 577abc9a6a..69945cad3f 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift @@ -114,6 +114,8 @@ open class AlamofireRequestBuilder: RequestBuilder { mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) case let number as NSNumber: mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + case let data as Data: + mpForm.append(data, withName: k) default: fatalError("Unprocessable value \(v) with key \(k)") } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 929cbc5f04..86beadcc71 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift index 23df908ca3..ca22cb7e6e 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/URLSessionImplementations.swift @@ -477,6 +477,15 @@ private class FormDataEncoding: ParameterEncoding { ) } + case let data as Data: + + urlRequest = configureDataUploadRequest( + urlRequest: urlRequest, + boundary: boundary, + name: key, + data: data + ) + default: fatalError("Unprocessable value \(value) with key \(key)") } From cee5f7591241956b946263855caf8c4eb18e6470 Mon Sep 17 00:00:00 2001 From: Justin Black Date: Fri, 10 Dec 2021 13:49:29 -0800 Subject: [PATCH 10/54] Feat adds content and header properties to CodegenResponse (#11046) * Adds responseHeaders to codegenResponse * Sets response headers in codegenResponse * Samples updated * Adds test of response headers * Adds content to CodegenResponse * Sets codegenResponse content * Tests added, test content-data.yaml spec update * Adds mediaTypeSchemaSuffix input to getContent * Tests updated * Updates how response content schema names are set * Adds missing Locale to String.format invocations --- .../openapitools/codegen/CodegenResponse.java | 24 ++- .../openapitools/codegen/DefaultCodegen.java | 66 ++++-- .../codegen/DefaultCodegenTest.java | 188 ++++++++++++------ .../src/test/resources/3_0/content-data.yaml | 34 +++- .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../openapitools/client/api/UserApiImpl.java | 1 + .../client/api/rxjava/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../openapitools/client/api/UserApiImpl.java | 1 + .../client/api/rxjava/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.scala | 1 + .../openapitools/example/api/UserApi.scala | 1 + .../org/openapitools/client/api/UserApi.scala | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/client/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../puppies/store/apis/UserApiController.java | 1 + .../store/apis/UserApiControllerImp.java | 1 + .../apis/UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../app/controllers/UserApiController.java | 1 + .../app/controllers/UserApiControllerImp.java | 1 + .../UserApiControllerImpInterface.java | 1 + .../vertxweb/server/api/UserApi.java | 1 + .../vertxweb/server/api/UserApiHandler.java | 1 + .../vertxweb/server/api/UserApiImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiService.java | 1 + .../api/impl/UserApiServiceImpl.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/api/UserApiController.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/api/UserApiController.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../org/openapitools/api/UserApiDelegate.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/api/UserApiController.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + .../openapitools/virtualan/api/UserApi.java | 1 + .../java/org/openapitools/api/UserApi.java | 1 + 143 files changed, 365 insertions(+), 86 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java index b81bda5f58..7a23b3ab72 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenResponse.java @@ -21,6 +21,7 @@ import java.util.*; public class CodegenResponse implements IJsonSchemaValidationProperties { public final List headers = new ArrayList(); + private List responseHeaders = new ArrayList(); public String code; public boolean is1xx; public boolean is2xx; @@ -87,6 +88,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { private boolean hasDiscriminatorWithNonEmptyMapping; private CodegenComposedSchemas composedSchemas; private boolean hasMultipleTypes = false; + private LinkedHashMap content; @Override public int hashCode() { @@ -98,7 +100,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(), getMinLength(), exclusiveMinimum, exclusiveMaximum, getMinimum(), getMaximum(), getPattern(), is1xx, is2xx, is3xx, is4xx, is5xx, additionalPropertiesIsAnyType, hasVars, hasRequired, - hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes); + hasDiscriminatorWithNonEmptyMapping, composedSchemas, hasMultipleTypes, responseHeaders, content); } @Override @@ -147,6 +149,8 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { getAdditionalPropertiesIsAnyType() == that.getAdditionalPropertiesIsAnyType() && getHasVars() == that.getHasVars() && getHasRequired() == that.getHasRequired() && + Objects.equals(content, that.getContent()) && + Objects.equals(responseHeaders, that.getResponseHeaders()) && Objects.equals(composedSchemas, that.getComposedSchemas()) && Objects.equals(vars, that.vars) && Objects.equals(requiredVars, that.requiredVars) && @@ -176,6 +180,22 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { } + public LinkedHashMap getContent() { + return content; + } + + public void setContent(LinkedHashMap content) { + this.content = content; + } + + public List getResponseHeaders() { + return responseHeaders; + } + + public void setResponseHeaders(List responseHeaders) { + this.responseHeaders = responseHeaders; + } + @Override public String getPattern() { return pattern; @@ -488,6 +508,8 @@ public class CodegenResponse implements IJsonSchemaValidationProperties { sb.append(", getHasDiscriminatorWithNonEmptyMapping=").append(hasDiscriminatorWithNonEmptyMapping); sb.append(", composedSchemas=").append(composedSchemas); sb.append(", hasMultipleTypes=").append(hasMultipleTypes); + sb.append(", responseHeaders=").append(responseHeaders); + sb.append(", content=").append(content); sb.append('}'); return sb.toString(); } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index e76b78d6e5..32947d7870 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -3959,6 +3959,20 @@ public class DefaultCodegen implements CodegenConfig { ApiResponse response = operationGetResponsesEntry.getValue(); addProducesInfo(response, op); CodegenResponse r = fromResponse(key, response); + Map headers = response.getHeaders(); + if (headers != null) { + List responseHeaders = new ArrayList<>(); + for (Entry entry: headers.entrySet()) { + String headerName = entry.getKey(); + Header header = entry.getValue(); + CodegenParameter responseHeader = heeaderToCodegenParameter(header, headerName, imports, String.format(Locale.ROOT, "%sResponseParameter", r.code)); + responseHeaders.add(responseHeader); + } + r.setResponseHeaders(responseHeaders); + } + String mediaTypeSchemaSuffix = String.format(Locale.ROOT, "%sResponseBody", r.code); + r.setContent(getContent(response.getContent(), imports, mediaTypeSchemaSuffix)); + if (r.baseType != null && !defaultIncludes.contains(r.baseType) && !languageSpecificPrimitives.contains(r.baseType)) { @@ -4065,6 +4079,7 @@ public class DefaultCodegen implements CodegenConfig { param = ModelUtils.getReferencedParameter(this.openAPI, param); CodegenParameter p = fromParameter(param, imports); + p.setContent(getContent(param.getContent(), imports, "RequestParameter" + toModelName(param.getName()))); // ensure unique params if (ensureUniqueParams) { @@ -4502,7 +4517,6 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.isDeprecated = parameter.getDeprecated(); } codegenParameter.jsonSchema = Json.pretty(parameter); - codegenParameter.setContent(getContent(parameter.getContent(), imports)); if (GlobalSettings.getProperty("debugParser") != null) { LOGGER.info("working on Parameter {}", parameter.getName()); @@ -6586,11 +6600,36 @@ public class DefaultCodegen implements CodegenConfig { codegenParameter.pattern = toRegularExpression(schema.getPattern()); } - protected String toMediaTypeSchemaName(String contentType) { - return toModelName(contentType + "Schema"); + protected String toMediaTypeSchemaName(String contentType, String mediaTypeSchemaSuffix) { + return "SchemaFor" + mediaTypeSchemaSuffix + toModelName(contentType); } - protected LinkedHashMap getContent(Content content, Set imports) { + private CodegenParameter heeaderToCodegenParameter(Header header, String headerName, Set imports, String mediaTypeSchemaSuffix) { + if (header == null) { + return null; + } + Parameter headerParam = new Parameter(); + headerParam.setName(headerName); + headerParam.setIn("header"); + headerParam.setDescription(header.getDescription()); + headerParam.setRequired(header.getRequired()); + headerParam.setDeprecated(header.getDeprecated()); + Header.StyleEnum style = header.getStyle(); + if (style != null) { + headerParam.setStyle(Parameter.StyleEnum.valueOf(style.name())); + } + headerParam.setExplode(header.getExplode()); + headerParam.setSchema(header.getSchema()); + headerParam.setExamples(header.getExamples()); + headerParam.setExample(header.getExample()); + headerParam.setContent(header.getContent()); + headerParam.setExtensions(header.getExtensions()); + CodegenParameter param = fromParameter(headerParam, imports); + param.setContent(getContent(headerParam.getContent(), imports, mediaTypeSchemaSuffix)); + return param; + } + + protected LinkedHashMap getContent(Content content, Set imports, String mediaTypeSchemaSuffix) { if (content == null) { return null; } @@ -6609,20 +6648,7 @@ public class DefaultCodegen implements CodegenConfig { for (Entry headerEntry: encHeaders.entrySet()) { String headerName = headerEntry.getKey(); Header header = ModelUtils.getReferencedHeader(this.openAPI, headerEntry.getValue()); - Parameter headerParam = new Parameter(); - headerParam.setName(headerName); - headerParam.setIn("header"); - headerParam.setDescription(header.getDescription()); - headerParam.setRequired(header.getRequired()); - headerParam.setDeprecated(header.getDeprecated()); - headerParam.setStyle(Parameter.StyleEnum.valueOf(header.getStyle().name())); - headerParam.setExplode(header.getExplode()); - headerParam.setSchema(header.getSchema()); - headerParam.setExamples(header.getExamples()); - headerParam.setExample(header.getExample()); - headerParam.setContent(header.getContent()); - headerParam.setExtensions(header.getExtensions()); - CodegenParameter param = fromParameter(headerParam, imports); + CodegenParameter param = heeaderToCodegenParameter(header, headerName, imports, mediaTypeSchemaSuffix); headers.add(param); } } @@ -6638,7 +6664,7 @@ public class DefaultCodegen implements CodegenConfig { } } String contentType = contentEntry.getKey(); - CodegenProperty schemaProp = fromProperty(toMediaTypeSchemaName(contentType), mt.getSchema()); + CodegenProperty schemaProp = fromProperty(toMediaTypeSchemaName(contentType, mediaTypeSchemaSuffix), mt.getSchema()); CodegenMediaType codegenMt = new CodegenMediaType(schemaProp, ceMap); cmtContent.put(contentType, codegenMt); } @@ -6666,7 +6692,7 @@ public class DefaultCodegen implements CodegenConfig { if (schema == null) { throw new RuntimeException("Request body cannot be null. Possible cause: missing schema in body parameter (OAS v2): " + body); } - codegenParameter.setContent(getContent(body.getContent(), imports)); + codegenParameter.setContent(getContent(body.getContent(), imports, "RequestBody")); if (StringUtils.isNotBlank(schema.get$ref())) { name = ModelUtils.getSimpleRef(schema.get$ref()); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java index 949bc1a924..54a2b0d205 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java @@ -1673,12 +1673,12 @@ public class DefaultCodegenTest { public void testDefaultResponseShouldBeLast() { OpenAPI openAPI = TestUtils.createOpenAPI(); Operation myOperation = new Operation().operationId("myOperation").responses( - new ApiResponses() - .addApiResponse( - "default", new ApiResponse().description("Default")) - .addApiResponse( - "422", new ApiResponse().description("Error")) - ); + new ApiResponses() + .addApiResponse( + "default", new ApiResponse().description("Default")) + .addApiResponse( + "422", new ApiResponse().description("Error")) + ); openAPI.path("/here", new PathItem().get(myOperation)); final DefaultCodegen codegen = new DefaultCodegen(); codegen.setOpenAPI(openAPI); @@ -2353,49 +2353,49 @@ public class DefaultCodegenTest { @Test public void testFormComposedSchema() { OpenAPI openAPI = TestUtils.parseContent("openapi: 3.0.1\n" + - "info:\n" + - " version: '1.0.0'\n" + - " title: the title\n" + - "\n" + - "paths:\n" + - " '/users/me':\n" + - " post:\n" + - " description: Change user password.\n" + - " operationId: changeCurrentUserPassword\n" + - " requestBody:\n" + - " required: true\n" + - " content:\n" + - " multipart/form-data:\n" + - " schema:\n" + - " $ref: '#/components/schemas/ChangePasswordRequest'\n" + - " responses:\n" + - " '200':\n" + - " description: Successful operation\n" + - " content: {}\n" + - "\n" + - "components:\n" + - " schemas:\n" + - " CommonPasswordRequest:\n" + - " type: object\n" + - " required: [ password, passwordConfirmation ]\n" + - " properties:\n" + - " password:\n" + - " type: string\n" + - " format: password\n" + - " passwordConfirmation:\n" + - " type: string\n" + - " format: password\n" + - "\n" + - " ChangePasswordRequest:\n" + - " type: object\n" + - " allOf:\n" + - " - $ref: '#/components/schemas/CommonPasswordRequest'\n" + - " - type: object\n" + - " required: [ oldPassword ]\n" + - " properties:\n" + - " oldPassword:\n" + - " type: string\n" + - " format: password\n"); + "info:\n" + + " version: '1.0.0'\n" + + " title: the title\n" + + "\n" + + "paths:\n" + + " '/users/me':\n" + + " post:\n" + + " description: Change user password.\n" + + " operationId: changeCurrentUserPassword\n" + + " requestBody:\n" + + " required: true\n" + + " content:\n" + + " multipart/form-data:\n" + + " schema:\n" + + " $ref: '#/components/schemas/ChangePasswordRequest'\n" + + " responses:\n" + + " '200':\n" + + " description: Successful operation\n" + + " content: {}\n" + + "\n" + + "components:\n" + + " schemas:\n" + + " CommonPasswordRequest:\n" + + " type: object\n" + + " required: [ password, passwordConfirmation ]\n" + + " properties:\n" + + " password:\n" + + " type: string\n" + + " format: password\n" + + " passwordConfirmation:\n" + + " type: string\n" + + " format: password\n" + + "\n" + + " ChangePasswordRequest:\n" + + " type: object\n" + + " allOf:\n" + + " - $ref: '#/components/schemas/CommonPasswordRequest'\n" + + " - type: object\n" + + " required: [ oldPassword ]\n" + + " properties:\n" + + " oldPassword:\n" + + " type: string\n" + + " format: password\n"); final DefaultCodegen cg = new DefaultCodegen(); cg.setOpenAPI(openAPI); @@ -2404,16 +2404,16 @@ public class DefaultCodegenTest { final PathItem path = openAPI.getPaths().get("/users/me"); final CodegenOperation operation = cg.fromOperation( - "/users/me", - "post", - path.getPost(), - path.getServers()); + "/users/me", + "post", + path.getPost(), + path.getServers()); assertEquals(operation.formParams.size(), 3, - "The list of parameters should include inherited type"); + "The list of parameters should include inherited type"); final List names = operation.formParams.stream() - .map(param -> param.paramName) - .collect(Collectors.toList()); + .map(param -> param.paramName) + .collect(Collectors.toList()); assertTrue(names.contains("password")); assertTrue(names.contains("passwordConfirmation")); assertTrue(names.contains("oldPassword")); @@ -3347,7 +3347,7 @@ public class DefaultCodegenTest { assertTrue(hasRequired); } else { // All variables must be in the above sets - fail(); + fail(); } } } @@ -3930,7 +3930,8 @@ public class DefaultCodegenTest { assertFalse(cr.primitiveType); } - public void testParameterContent() { + @Test + public void testRequestParameterContent() { DefaultCodegen codegen = new DefaultCodegen(); final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); codegen.setOpenAPI(openAPI); @@ -3948,6 +3949,7 @@ public class DefaultCodegenTest { CodegenProperty cp = mt.getSchema(); assertTrue(cp.isMap); assertEquals(cp.complexType, "object"); + assertEquals(cp.baseName, "SchemaForRequestParameterCoordinatesInlineSchemaApplicationJson"); CodegenParameter coordinatesReferencedSchema = co.queryParams.get(1); content = coordinatesReferencedSchema.getContent(); @@ -3956,6 +3958,7 @@ public class DefaultCodegenTest { cp = mt.getSchema(); assertFalse(cp.isMap); // because it is a referenced schema assertEquals(cp.complexType, "coordinates"); + assertEquals(cp.baseName, "SchemaForRequestParameterCoordinatesReferencedSchemaApplicationJson"); } @Test @@ -3975,13 +3978,13 @@ public class DefaultCodegenTest { CodegenMediaType mt = content.get("application/json"); assertNull(mt.getEncoding()); CodegenProperty cp = mt.getSchema(); - assertEquals(cp.baseName, "ApplicationJsonSchema"); + assertEquals(cp.baseName, "SchemaForRequestBodyApplicationJson"); assertNotNull(cp); mt = content.get("text/plain"); assertNull(mt.getEncoding()); cp = mt.getSchema(); - assertEquals(cp.baseName, "TextPlainSchema"); + assertEquals(cp.baseName, "SchemaForRequestBodyTextPlain"); assertNotNull(cp); // Note: the inline model resolver has a bug for this use case; it extracts an inline request body into a component // but the schema it references is not string type @@ -3995,13 +3998,72 @@ public class DefaultCodegenTest { mt = content.get("application/json"); assertNull(mt.getEncoding()); cp = mt.getSchema(); - assertEquals(cp.baseName, "ApplicationJsonSchema"); + assertEquals(cp.baseName, "SchemaForRequestBodyApplicationJson"); assertEquals(cp.complexType, "coordinates"); mt = content.get("text/plain"); assertNull(mt.getEncoding()); cp = mt.getSchema(); - assertEquals(cp.baseName, "TextPlainSchema"); + assertEquals(cp.baseName, "SchemaForRequestBodyTextPlain"); assertTrue(cp.isString); } -} + + @Test + public void testResponseContentAndHeader() { + DefaultCodegen codegen = new DefaultCodegen(); + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/content-data.yaml"); + codegen.setOpenAPI(openAPI); + String path; + CodegenOperation co; + + path = "/jsonQueryParams"; + co = codegen.fromOperation(path, "GET", openAPI.getPaths().get(path).getGet(), null); + CodegenParameter coordinatesInlineSchema = co.queryParams.get(0); + LinkedHashMap content = coordinatesInlineSchema.getContent(); + assertNotNull(content); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json"))); + + CodegenParameter schemaParam = co.queryParams.get(2); + assertEquals(schemaParam.getSchema().baseName, "stringWithMinLength"); + + + CodegenResponse cr = co.responses.get(0); + List responseHeaders = cr.getResponseHeaders(); + assertEquals(1, responseHeaders.size()); + CodegenParameter header = responseHeaders.get(0); + assertEquals("X-Rate-Limit", header.baseName); + assertTrue(header.isUnboundedInteger); + assertEquals(header.getSchema().baseName, "X-Rate-Limit"); + + content = cr.getContent(); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); + CodegenMediaType mt = content.get("application/json"); + assertNull(mt.getEncoding()); + CodegenProperty cp = mt.getSchema(); + assertFalse(cp.isMap); // because it is a referenced schema + assertEquals(cp.complexType, "coordinates"); + assertEquals(cp.baseName, "SchemaFor200ResponseBodyApplicationJson"); + + mt = content.get("text/plain"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertEquals(cp.baseName, "SchemaFor200ResponseBodyTextPlain"); + assertTrue(cp.isString); + + cr = co.responses.get(1); + content = cr.getContent(); + assertEquals(content.keySet(), new HashSet<>(Arrays.asList("application/json", "text/plain"))); + mt = content.get("application/json"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertFalse(cp.isMap); // because it is a referenced schema + assertEquals(cp.complexType, "coordinates"); + assertEquals(cp.baseName, "SchemaFor201ResponseBodyApplicationJson"); + + mt = content.get("text/plain"); + assertNull(mt.getEncoding()); + cp = mt.getSchema(); + assertEquals(cp.baseName, "SchemaFor201ResponseBodyTextPlain"); + assertTrue(cp.isString); + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/resources/3_0/content-data.yaml b/modules/openapi-generator/src/test/resources/3_0/content-data.yaml index 56228cd305..6296747be8 100644 --- a/modules/openapi-generator/src/test/resources/3_0/content-data.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/content-data.yaml @@ -26,9 +26,39 @@ paths: application/json: schema: $ref: '#/components/schemas/coordinates' + - name: stringWithMinLength + in: query + schema: + $ref: '#/components/schemas/stringWithMinLength' responses: - '201': + '200': description: 'OK' + headers: + X-Rate-Limit: + description: "The number of allowed requests in the current period" + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/coordinates' + text/plain: + schema: + $ref: '#/components/schemas/stringWithMinLength' + '201': + description: 'Created OK' + headers: + X-Rate-Limit-Limit: + description: "The number of allowed requests in the current period" + schema: + type: integer + content: + application/json: + schema: + $ref: '#/components/schemas/coordinates' + text/plain: + schema: + $ref: '#/components/schemas/stringWithMinLength' /inlineRequestBodySchemasDifferingByContentType: post: requestBody: @@ -80,4 +110,4 @@ components: lat: type: number long: - type: number + type: number \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java index e29a340990..6e608808a7 100644 --- a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/api/UserApi.java @@ -18,6 +18,7 @@ import io.micronaut.http.client.annotation.Client; import org.openapitools.query.QueryParam; import io.micronaut.core.convert.format.Format; import reactor.core.publisher.Mono; +import java.time.LocalDateTime; import org.openapitools.model.User; import javax.annotation.Generated; import java.util.ArrayList; diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java index f2bc445ff2..948722b28d 100644 --- a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -20,6 +20,7 @@ import org.openapitools.client.Configuration; import org.openapitools.client.model.*; import org.openapitools.client.Pair; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java index d97f8235c4..b71073a1ac 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.EncodingUtils; import org.openapitools.client.model.ApiResponse; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java index c6a74a80c0..55adb67061 100644 --- a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/api/UserApi.java @@ -4,6 +4,7 @@ import org.openapitools.client.ApiClient; import org.openapitools.client.EncodingUtils; import org.openapitools.client.model.ApiResponse; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java index eaf587737d..b3ef67b61c 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java index 1c6ce952c3..c0862cb966 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/api/UserApi.java @@ -20,6 +20,7 @@ import org.openapitools.client.Configuration; import org.openapitools.client.model.*; import org.openapitools.client.Pair; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java index c016f258f8..a2b14e7642 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/api/UserApi.java @@ -8,6 +8,7 @@ import org.openapitools.client.Pair; import javax.ws.rs.core.GenericType; +import java.time.LocalDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index c016f258f8..2a59daac57 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -8,6 +8,7 @@ import org.openapitools.client.Pair; import javax.ws.rs.core.GenericType; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java index b9fd9ed12a..400bcc6a8e 100644 --- a/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/microprofile-rest-client/src/main/java/org/openapitools/client/api/UserApi.java @@ -12,6 +12,7 @@ package org.openapitools.client.api; +import java.util.Date; import org.openapitools.client.model.User; import java.io.InputStream; diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java index 87d2be2c3f..209d289e08 100644 --- a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/api/UserApi.java @@ -17,6 +17,7 @@ import org.openapitools.client.ApiException; import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java index d4f06af3fd..2ce486c649 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java @@ -17,6 +17,7 @@ import org.openapitools.client.ApiException; import org.openapitools.client.ApiResponse; import org.openapitools.client.Pair; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java index b6ab5b1bd5..706ac5239f 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/api/UserApi.java @@ -30,6 +30,7 @@ import io.swagger.v3.oas.models.parameters.Parameter; import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java index 4bf2dc2b82..df1e507d1e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,6 +27,7 @@ import com.google.gson.reflect.TypeToken; import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java index 7e6577a7b1..f47c499de1 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,6 +27,7 @@ import com.google.gson.reflect.TypeToken; import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java index 7e6577a7b1..f47c499de1 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/api/UserApi.java @@ -27,6 +27,7 @@ import com.google.gson.reflect.TypeToken; import java.io.IOException; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.lang.reflect.Type; diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java index 4caf52a8d5..cfabc57213 100644 --- a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/api/UserApi.java @@ -13,6 +13,7 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java index 4b2ee75cb9..c50c5ecb2a 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/api/UserApi.java @@ -14,6 +14,7 @@ package org.openapitools.client.api; import com.google.gson.reflect.TypeToken; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java index 96c7210bf2..6c9ab56a94 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/api/UserApi.java @@ -7,6 +7,7 @@ import org.openapitools.client.Pair; import javax.ws.rs.core.GenericType; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java index 3561cd6e6d..217e995d4a 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.Collections; diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java index 3561cd6e6d..217e995d4a 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.Collections; diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java index 3208b159ad..c568e477b9 100644 --- a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/api/UserApi.java @@ -11,6 +11,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java index be6071fd7d..55b998e696 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/api/UserApi.java @@ -9,6 +9,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java index 134d9ea66f..f0f9bfc01f 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/api/UserApi.java @@ -10,6 +10,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java index 7be5be28df..00839a720e 100644 --- a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/api/UserApi.java @@ -10,6 +10,7 @@ import okhttp3.RequestBody; import okhttp3.ResponseBody; import okhttp3.MultipartBody; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java index e5c33d583a..5d55c6aa26 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,6 +1,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java index 7c2885ba3b..3e39564dd2 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java index 51280eef38..466c016abc 100644 --- a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/api/rxjava/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api.rxjava; +import org.threeten.bp.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java index e5c33d583a..b7922264c5 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApi.java @@ -1,6 +1,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java index 7c2885ba3b..592748032b 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/UserApiImpl.java @@ -1,5 +1,6 @@ package org.openapitools.client.api; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import io.vertx.core.AsyncResult; diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java index 51280eef38..6ed5725ec8 100644 --- a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/api/rxjava/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.client.api.rxjava; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import org.openapitools.client.ApiClient; diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java index 6920c4cd20..70fd7a644c 100644 --- a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,6 +2,7 @@ package org.openapitools.client.api; import org.openapitools.client.ApiClient; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.HashMap; diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala index 880c084c64..112105938a 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -11,6 +11,7 @@ */ package org.openapitools.client.api +import java.time.OffsetDateTime import org.openapitools.client.model.User import org.openapitools.client.core._ import org.openapitools.client.core.CollectionFormats._ diff --git a/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala b/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala index d39a90e574..e194afed5a 100644 --- a/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala +++ b/samples/client/petstore/scala-httpclient-deprecated/src/main/scala/org/openapitools/example/api/UserApi.scala @@ -14,6 +14,7 @@ package org.openapitools.example.api import java.text.SimpleDateFormat +import java.util.Date import org.openapitools.client.model.User import org.openapitools.example.invoker.{ApiInvoker, ApiException} diff --git a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala index 68e147b3d0..5cc17ea09c 100644 --- a/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala +++ b/samples/client/petstore/scala-sttp/src/main/scala/org/openapitools/client/api/UserApi.scala @@ -11,6 +11,7 @@ */ package org.openapitools.client.api +import java.time.OffsetDateTime import org.openapitools.client.model.User import org.openapitools.client.core.JsonSupport._ import sttp.client._ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index 0f9c95ed04..f02a6902a5 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 483b0873d5..ec264eb0d0 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 4fabd81f3b..5fa9e20f90 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 27ab4c67aa..006c4fd5ef 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java index ab1c5d462d..769693bc7e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/api/UserApi.java @@ -8,6 +8,7 @@ import org.openapitools.client.Pair; import javax.ws.rs.core.GenericType; +import java.time.OffsetDateTime; import org.openapitools.client.model.User; import java.util.ArrayList; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java index 836abbd19f..a54f5e2a3e 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import org.openapitools.api.factories.UserApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java index 14f88b4c31..905aab2c1b 100644 --- a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/api/UserApiService.java @@ -6,6 +6,7 @@ import org.openapitools.model.*; import org.wso2.msf4j.formparam.FormDataParam; import org.wso2.msf4j.formparam.FileInfo; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 9110ccdf44..092f5f3a58 100644 --- a/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/java-msf4j/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ package org.openapitools.api.impl; import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java index 40e025ed44..e6e8c6097d 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiController.java @@ -1,6 +1,7 @@ package com.puppies.store.apis; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java index a5c27c44ca..3ff0eb26e4 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImp.java @@ -1,6 +1,7 @@ package com.puppies.store.apis; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java index 0837531ed7..adae1c2723 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-api-package-override/app/com/puppies/store/apis/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package com.puppies.store.apis; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java index 3a89de0cd1..2d6685b18a 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java index 417765d035..b4c38db7da 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java index 39a8a9f896..2a1a3322b1 100644 --- a/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-async/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java index 1a1e62be27..d3c05dfa20 100644 --- a/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-controller-only/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java index 7c2ee85e2e..6169c16201 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java index f866d4e985..341f501718 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java index bd254922d0..39d422cc1e 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java index 879700e98c..e0572c7f33 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java index 3be679120b..02a82befbe 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java index 8aea513ad7..722d76055f 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-bean-validation/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java index 29a5aaf908..f4218359b6 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java index 1fc6f076ca..75b2af2979 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java index 9f00bfc1fc..4a83cce619 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-exception-handling/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java index f9a5ff9af6..e8c0a2f412 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java index 551cff753e..5d2342bdf2 100644 --- a/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-interface/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java index 7c2ee85e2e..6169c16201 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java index f866d4e985..341f501718 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java index bd254922d0..39d422cc1e 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-nullable/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java index 7c2ee85e2e..6169c16201 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java index f866d4e985..341f501718 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java index bd254922d0..39d422cc1e 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java index 916e3d2603..582c691a51 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java index f866d4e985..341f501718 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java index bd254922d0..39d422cc1e 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java index 7c2ee85e2e..6169c16201 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiController.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.typesafe.config.Config; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java index f866d4e985..341f501718 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImp.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import play.mvc.Http; diff --git a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java index bd254922d0..39d422cc1e 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java +++ b/samples/server/petstore/java-play-framework/app/controllers/UserApiControllerImpInterface.java @@ -1,6 +1,7 @@ package controllers; import java.util.List; +import java.time.OffsetDateTime; import apimodels.User; import com.google.inject.Inject; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java index 51a910d032..a68768f717 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.vertxweb.server.api; +import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import org.openapitools.vertxweb.server.ApiResponse; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java index 85beafc942..f32f94a006 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiHandler.java @@ -1,5 +1,6 @@ package org.openapitools.vertxweb.server.api; +import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import com.fasterxml.jackson.core.type.TypeReference; diff --git a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java index 13b9457de8..b2097db1de 100644 --- a/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java +++ b/samples/server/petstore/java-vertx-web/src/main/java/org/openapitools/vertxweb/server/api/UserApiImpl.java @@ -1,5 +1,6 @@ package org.openapitools.vertxweb.server.api; +import java.time.OffsetDateTime; import org.openapitools.vertxweb.server.model.User; import org.openapitools.vertxweb.server.ApiResponse; diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java index a621c7a622..f615b43fc0 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java index 280ad56966..6a0c280728 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java index 40ad9d9270..1d2df9950e 100644 --- a/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java index 05b3b1e61c..ac1d5d79c9 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApi.java @@ -8,6 +8,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.Map; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java index 15e4486bc6..0398450b90 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/org/openapitools/api/UserApiService.java @@ -6,6 +6,7 @@ import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 1e5df1742f..2777fd418e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java index 6d96f196c9..a21940cf13 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import org.openapitools.api.factories.UserApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java index 1464a5adac..a97a94b963 100644 --- a/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-jersey/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 2d7b2e001a..f52f29ff61 100644 --- a/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-jersey/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ package org.openapitools.api.impl; import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java index d9780d5234..a86e19f4e7 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ import org.openapitools.api.UserApiService; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java index 35d72d4211..9c8711a4c3 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/gen/java/org/openapitools/api/UserApiService.java @@ -4,6 +4,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 40d14d0be5..3922ee89e6 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/default/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java index 22506d0ee4..18245bceec 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/gen/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index a63f0db78f..5b04e2fe7c 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java index 22506d0ee4..4ff199c240 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/gen/java/org/openapitools/api/UserApi.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index a63f0db78f..6f7c52daa9 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java index 22506d0ee4..9085d6360e 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/gen/java/org/openapitools/api/UserApi.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index a63f0db78f..1df5c3e26f 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/eap/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java index d9780d5234..6c9a757e19 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.Map; diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java index 35d72d4211..a5042f3ed8 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 40d14d0be5..c71a0ed4e5 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/java8/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import java.util.List; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java index d9780d5234..571e51a334 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ import org.openapitools.api.UserApiService; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java index 35d72d4211..8560f101ff 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/gen/java/org/openapitools/api/UserApiService.java @@ -4,6 +4,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 40d14d0be5..6c64a9bc5d 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs-resteasy/joda/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -4,6 +4,7 @@ import org.openapitools.api.*; import org.openapitools.model.*; +import org.joda.time.DateTime; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java index a1fb4ed1b0..f07a6ceb7d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java index a72c943130..2657167dce 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java @@ -1,5 +1,6 @@ package org.openapitools.api; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java index 9d44284fa0..2808b3bc09 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import org.openapitools.api.factories.UserApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java index 79b52a8a5e..da302c73c1 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 5df04a4d53..be039a8631 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java index aa5b7ec2d6..d3ac645101 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import org.openapitools.api.factories.UserApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java index 79b52a8a5e..da302c73c1 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 5df04a4d53..be039a8631 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey1/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import com.sun.jersey.multipart.FormDataParam; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java index 2d90f25235..ba9ff14767 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import org.openapitools.api.factories.UserApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java index 15e4486bc6..493a47591e 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 1e5df1742f..f4bd2bfef4 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2-useTags/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ package org.openapitools.api.impl; import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java index 05b3b1e61c..0832808083 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApi.java @@ -7,6 +7,7 @@ import org.openapitools.api.factories.UserApiServiceFactory; import io.swagger.annotations.ApiParam; import io.swagger.jaxrs.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java index 15e4486bc6..493a47591e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/org/openapitools/api/UserApiService.java @@ -5,6 +5,7 @@ import org.openapitools.model.*; import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java index 1e5df1742f..f4bd2bfef4 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java +++ b/samples/server/petstore/jaxrs/jersey2/src/main/java/org/openapitools/api/impl/UserApiServiceImpl.java @@ -3,6 +3,7 @@ package org.openapitools.api.impl; import org.openapitools.api.*; import org.openapitools.model.*; +import java.util.Date; import java.util.List; import org.openapitools.model.User; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index 941fffd383..ce495a26f8 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..0a15519597 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.LocalDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..fabb81f5f1 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..fabb81f5f1 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..fabb81f5f1 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index f96ae91344..517f2743d2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java index a749387b89..a5441a06b6 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..fabb81f5f1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index c6a6fa8669..7fce7995a8 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index 78da7c8510..b63fa7a1c2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index c6a6fa8669..7fce7995a8 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index 78da7c8510..b63fa7a1c2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index cb97dfa0de..2e0fbbbffc 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 505c317d5f..9487e29ee1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 7241a736ea..563d11fa04 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index f96ae91344..517f2743d2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java index da136ce2f8..927da27321 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index 81c3ecc258..00d156773a 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index c6a6fa8669..7fce7995a8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java index 78da7c8510..b63fa7a1c2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index f96ae91344..517f2743d2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.ResponseEntity; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java index a749387b89..a5441a06b6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApiController.java @@ -1,6 +1,7 @@ package org.openapitools.api; import java.util.List; +import org.threeten.bp.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..fabb81f5f1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..fabb81f5f1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index f97eeb8e40..a376601558 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.virtualan.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.virtualan.model.User; import io.swagger.annotations.*; import io.virtualan.annotation.ApiVirtual; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 27f6a346d3..fabb81f5f1 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -6,6 +6,7 @@ package org.openapitools.api; import java.util.List; +import java.time.OffsetDateTime; import org.openapitools.model.User; import io.swagger.annotations.*; import org.springframework.http.HttpStatus; From 0236f84c1156c4aa03027c861221cf6389c35479 Mon Sep 17 00:00:00 2001 From: Guus Bloemsma Date: Sat, 11 Dec 2021 14:48:00 +0100 Subject: [PATCH 11/54] [kotlin-client] Allowing vendor types for json (#10758) * Using the first serializable 'consumes' mediaType Using all deserializable 'produces' mediaTypes Matching json vendor types as json * updating the generated samples --- .../languages/KotlinClientCodegen.java | 63 ++++++++++++++++--- .../libraries/jvm-okhttp/api.mustache | 3 + .../infrastructure/ApiClient.kt.mustache | 14 ++--- .../openapitools/client/apis/DefaultApi.kt | 1 + .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-gson/docs/PetApi.md | 10 +-- .../petstore/kotlin-gson/docs/StoreApi.md | 4 +- .../petstore/kotlin-gson/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-jackson/docs/PetApi.md | 10 +-- .../petstore/kotlin-jackson/docs/StoreApi.md | 4 +- .../petstore/kotlin-jackson/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../kotlin-json-request-string/docs/PetApi.md | 10 +-- .../docs/StoreApi.md | 4 +- .../docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../docs/PetApi.md | 10 +-- .../docs/StoreApi.md | 4 +- .../docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../kotlin-moshi-codegen/docs/PetApi.md | 10 +-- .../kotlin-moshi-codegen/docs/StoreApi.md | 4 +- .../kotlin-moshi-codegen/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-nonpublic/docs/PetApi.md | 10 +-- .../kotlin-nonpublic/docs/StoreApi.md | 4 +- .../petstore/kotlin-nonpublic/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-nullable/docs/PetApi.md | 10 +-- .../petstore/kotlin-nullable/docs/StoreApi.md | 4 +- .../petstore/kotlin-nullable/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-okhttp3/docs/PetApi.md | 10 +-- .../petstore/kotlin-okhttp3/docs/StoreApi.md | 4 +- .../petstore/kotlin-okhttp3/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-string/docs/PetApi.md | 10 +-- .../petstore/kotlin-string/docs/StoreApi.md | 4 +- .../petstore/kotlin-string/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../petstore/kotlin-threetenbp/docs/PetApi.md | 10 +-- .../kotlin-threetenbp/docs/StoreApi.md | 4 +- .../kotlin-threetenbp/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- .../org/openapitools/client/apis/EnumApi.kt | 1 + .../client/infrastructure/ApiClient.kt | 12 ++-- samples/client/petstore/kotlin/docs/PetApi.md | 10 +-- .../client/petstore/kotlin/docs/StoreApi.md | 4 +- .../client/petstore/kotlin/docs/UserApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 14 +++-- .../org/openapitools/client/apis/StoreApi.kt | 5 +- .../org/openapitools/client/apis/UserApi.kt | 14 +++-- .../client/infrastructure/ApiClient.kt | 12 ++-- 84 files changed, 483 insertions(+), 316 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 28a3853332..80b54000dd 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -18,8 +18,21 @@ package org.openapitools.codegen.languages; import org.apache.commons.lang3.StringUtils; -import org.openapitools.codegen.*; -import org.openapitools.codegen.meta.features.*; +import org.openapitools.codegen.CliOption; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; +import org.openapitools.codegen.CodegenProperty; +import org.openapitools.codegen.CodegenType; +import org.openapitools.codegen.SupportingFile; +import org.openapitools.codegen.meta.features.ClientModificationFeature; +import org.openapitools.codegen.meta.features.DocumentationFeature; +import org.openapitools.codegen.meta.features.GlobalFeature; +import org.openapitools.codegen.meta.features.ParameterFeature; +import org.openapitools.codegen.meta.features.SchemaSupportFeature; +import org.openapitools.codegen.meta.features.SecurityFeature; +import org.openapitools.codegen.meta.features.WireFormatFeature; import org.openapitools.codegen.utils.ProcessUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,6 +41,7 @@ import java.io.File; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.function.Predicate; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -617,14 +631,14 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { // escape the variable base name for use as a string literal List vars = Stream.of( - cm.vars, - cm.allVars, - cm.optionalVars, - cm.requiredVars, - cm.readOnlyVars, - cm.readWriteVars, - cm.parentVars - ) + cm.vars, + cm.allVars, + cm.optionalVars, + cm.requiredVars, + cm.readOnlyVars, + cm.readWriteVars, + cm.parentVars + ) .flatMap(List::stream) .collect(Collectors.toList()); @@ -653,6 +667,35 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { operation.path = operation.path.substring(1); } + if (JVM_OKHTTP.equals(getLibrary()) || JVM_OKHTTP3.equals(getLibrary()) || JVM_OKHTTP4.equals(getLibrary())) { + // Ideally we would do content negotiation to choose the best mediatype, but that would be a next step. + // For now we take the first mediatype we can parse and send that. + Predicate> isSerializable = typeMapping -> { + String mediaTypeValue = typeMapping.get("mediaType"); + if (mediaTypeValue == null) + return false; + // match on first part in mediaTypes like 'application/json; charset=utf-8' + int endIndex = mediaTypeValue.indexOf(';'); + String mediaType = (endIndex == -1 + ? mediaTypeValue + : mediaTypeValue.substring(0, endIndex) + ).trim(); + return "multipart/form-data".equals(mediaType) + || "application/x-www-form-urlencoded".equals(mediaType) + || (mediaType.startsWith("application/") && mediaType.endsWith("json")); + }; + operation.consumes = operation.consumes == null ? null : operation.consumes.stream() + .filter(isSerializable) + .limit(1) + .collect(Collectors.toList()); + operation.hasConsumes = operation.consumes != null && !operation.consumes.isEmpty(); + + operation.produces = operation.produces == null ? null : operation.produces.stream() + .filter(isSerializable) + .collect(Collectors.toList()); + operation.hasProduces = operation.produces != null && !operation.produces.isEmpty(); + } + // set multipart against all relevant operations if (operation.hasConsumes == Boolean.TRUE) { if (isMultipartType(operation.consumes)) { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 71d19cb2ec..8059b5ffa7 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -130,6 +130,9 @@ import {{packageName}}.infrastructure.toMultiValue {{#headerParams}} {{{paramName}}}{{^required}}?{{/required}}.apply { localVariableHeaders["{{baseName}}"] = {{#isContainer}}this.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}this.toString(){{/isContainer}} } {{/headerParams}} + {{^hasFormParams}}{{#hasConsumes}}{{#consumes}}localVariableHeaders["Content-Type"] = "{{{mediaType}}}" + {{/consumes}}{{/hasConsumes}}{{/hasFormParams}}{{#hasProduces}}localVariableHeaders["Accept"] = "{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}" +{{/hasProduces}} return RequestConfig( method = RequestMethod.{{httpMethod}}, diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 57bd33d35b..8f30c1808e 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -167,8 +167,8 @@ import com.squareup.moshi.adapter } }.build() } + mediaType.startsWith("application/") && mediaType.endsWith("json") -> {{#jvm-okhttp3}} - mediaType == JsonMediaType -> { if (content == null) { EMPTY_REQUEST } else { @@ -187,10 +187,8 @@ import com.squareup.moshi.adapter {{/kotlinx_serialization}} ) } - } {{/jvm-okhttp3}} {{#jvm-okhttp4}} - mediaType == JsonMediaType -> { if (content == null) { EMPTY_REQUEST } else { @@ -210,7 +208,6 @@ import com.squareup.moshi.adapter mediaType.toMediaTypeOrNull() ) } - } {{/jvm-okhttp4}} mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers @@ -247,8 +244,9 @@ import com.squareup.moshi.adapter out.close() return f as T } - return when(mediaType) { - JsonMediaType -> {{#moshi}}Serializer.moshi.adapter().fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}){{/jackson}}{{#kotlinx_serialization}}Serializer.jvmJson.decodeFromString(bodyContent){{/kotlinx_serialization}} + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + {{#moshi}}Serializer.moshi.adapter().fromJson(bodyContent){{/moshi}}{{#gson}}Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()){{/gson}}{{#jackson}}Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}){{/jackson}}{{#kotlinx_serialization}}Serializer.jvmJson.decodeFromString(bodyContent){{/kotlinx_serialization}} else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -343,11 +341,11 @@ import com.squareup.moshi.adapter } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index 662eff77a0..dfcdc11ef3 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -98,6 +98,7 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 634abe57b9..8a9c47045e 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -167,11 +167,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-gson/docs/PetApi.md b/samples/client/petstore/kotlin-gson/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-gson/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-gson/docs/StoreApi.md b/samples/client/petstore/kotlin-gson/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-gson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-gson/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-gson/docs/UserApi.md b/samples/client/petstore/kotlin-gson/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-gson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-gson/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d..59367631c9 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7a1fafd594..f46f0ed6f5 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -137,8 +136,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -185,11 +185,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jackson/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-jackson/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-jackson/docs/UserApi.md b/samples/client/petstore/kotlin-jackson/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-jackson/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d..59367631c9 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 05f77db303..d01fa6041c 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -137,8 +136,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.jacksonObjectMapper.readValue(bodyContent, object: TypeReference() {}) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -185,11 +185,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md index 90c97d53eb..46b5ffc550 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getAllPets** @@ -202,7 +202,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -252,7 +252,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -297,7 +297,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 6d866a9805..a1a524e3cc 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -246,6 +247,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -319,6 +321,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { } } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -387,6 +390,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -453,7 +457,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -525,7 +530,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -599,6 +604,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c4700a7011..917c3d3f3d 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -106,7 +106,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -115,7 +115,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -144,8 +143,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -192,11 +192,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index a10b5ee285..e6271b33fc 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -102,7 +102,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -172,7 +173,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -243,6 +244,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -319,6 +321,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -387,6 +390,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -453,7 +457,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -525,7 +530,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -599,6 +604,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 33f04bb542..fe498594da 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -101,7 +101,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -166,6 +166,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -234,6 +235,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -302,6 +304,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 7cb6348f01..797a84aa61 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -101,7 +101,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -167,7 +167,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -233,7 +233,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -299,7 +299,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -367,6 +367,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -442,6 +443,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -505,7 +507,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -574,7 +576,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c6bd90a8cb..141689f40f 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -108,7 +108,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -117,7 +117,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -140,8 +139,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.gson.fromJson(bodyContent, (object: TypeToken(){}).getType()) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -188,11 +188,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d..59367631c9 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2..c218caafae 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 86649ad508..f01ad9c676 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index fc03f3fb21..a71c936424 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index d68ed63e17..478f791b87 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index cb6d869701..313f2e1652 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ internal open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ internal open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ internal open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ internal open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-nullable/docs/PetApi.md b/samples/client/petstore/kotlin-nullable/docs/PetApi.md index 42a28f741c..e769fecd53 100644 --- a/samples/client/petstore/kotlin-nullable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md index 63391018af..30a2853112 100644 --- a/samples/client/petstore/kotlin-nullable/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-nullable/docs/UserApi.md b/samples/client/petstore/kotlin-nullable/docs/UserApi.md index d91ca1e97c..94e67903d1 100644 --- a/samples/client/petstore/kotlin-nullable/docs/UserApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 164fa99175..641f25e2ad 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 5493c72bd7..60120ce05d 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index e8c0900948..3b44d8f38f 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2..c218caafae 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md b/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md b/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d..59367631c9 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 217d6fe019..d3ac6493d6 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -103,7 +103,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -111,7 +111,6 @@ open class ApiClient(val baseUrl: String) { MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -135,8 +134,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -183,11 +183,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-string/docs/PetApi.md b/samples/client/petstore/kotlin-string/docs/PetApi.md index a30ce4af55..39f8f0858a 100644 --- a/samples/client/petstore/kotlin-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-string/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-string/docs/StoreApi.md b/samples/client/petstore/kotlin-string/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-string/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-string/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-string/docs/UserApi.md b/samples/client/petstore/kotlin-string/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-string/docs/UserApi.md +++ b/samples/client/petstore/kotlin-string/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8cb9c538af..bc8f157e48 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2..c218caafae 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d..59367631c9 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f82c6d3fa4..42e08a49f3 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index aca1957054..87b7bc007a 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -98,6 +98,7 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 634abe57b9..8a9c47045e 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -167,11 +167,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index 27289c31c2..403e57a4b3 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -57,7 +57,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined @@ -155,7 +155,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **findPetsByTags** @@ -204,7 +204,7 @@ Configure petstore_auth: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **getPetById** @@ -254,7 +254,7 @@ Configure api_key: ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **updatePet** @@ -299,7 +299,7 @@ Configure petstore_auth: ### HTTP request headers - - **Content-Type**: application/json, application/xml + - **Content-Type**: application/json - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin/docs/StoreApi.md b/samples/client/petstore/kotlin/docs/StoreApi.md index f4986041af..de2f4dbdcb 100644 --- a/samples/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/client/petstore/kotlin/docs/StoreApi.md @@ -147,7 +147,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **placeOrder** @@ -192,5 +192,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json diff --git a/samples/client/petstore/kotlin/docs/UserApi.md b/samples/client/petstore/kotlin/docs/UserApi.md index fd98ce696a..e54decd3ba 100644 --- a/samples/client/petstore/kotlin/docs/UserApi.md +++ b/samples/client/petstore/kotlin/docs/UserApi.md @@ -237,7 +237,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **loginUser** @@ -284,7 +284,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: application/json # **logoutUser** diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 7ccfb70d6d..59367631c9 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -100,7 +100,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.POST, path = "/pet", @@ -170,7 +171,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - + return RequestConfig( method = RequestMethod.DELETE, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -241,6 +242,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("status", toMultiValue(status.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -317,6 +319,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("tags", toMultiValue(tags.toList(), "csv")) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -385,6 +388,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -451,7 +455,8 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + localVariableHeaders["Content-Type"] = "application/json" + return RequestConfig( method = RequestMethod.PUT, path = "/pet", @@ -523,7 +528,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("name" to name, "status" to status) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - + return RequestConfig( method = RequestMethod.POST, path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), @@ -597,6 +602,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = mapOf("additionalMetadata" to additionalMetadata, "file" to file) val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a3a2940291..87d76a0b30 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -99,7 +99,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), @@ -164,6 +164,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -232,6 +233,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -300,6 +302,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.POST, diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index a68290f071..444826b782 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -99,7 +99,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user", @@ -165,7 +165,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithArray", @@ -231,7 +231,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.POST, path = "/user/createWithList", @@ -297,7 +297,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.DELETE, path = "/user/{username}".replace("{"+"username"+"}", "$username"), @@ -365,6 +365,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -440,6 +441,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { put("password", listOf(password.toString())) } val localVariableHeaders: MutableMap = mutableMapOf() + localVariableHeaders["Accept"] = "application/json" return RequestConfig( method = RequestMethod.GET, @@ -503,7 +505,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = null val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.GET, path = "/user/logout", @@ -572,7 +574,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { val localVariableBody = body val localVariableQuery: MultiValueMap = mutableMapOf() val localVariableHeaders: MutableMap = mutableMapOf() - + return RequestConfig( method = RequestMethod.PUT, path = "/user/{username}".replace("{"+"username"+"}", "$username"), diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c75d4889d2..c218caafae 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -105,7 +105,7 @@ open class ApiClient(val baseUrl: String) { } }.build() } - mediaType == JsonMediaType -> { + mediaType.startsWith("application/") && mediaType.endsWith("json") -> if (content == null) { EMPTY_REQUEST } else { @@ -114,7 +114,6 @@ open class ApiClient(val baseUrl: String) { mediaType.toMediaTypeOrNull() ) } - } mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") // TODO: this should be extended with other serializers else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") @@ -138,8 +137,9 @@ open class ApiClient(val baseUrl: String) { out.close() return f as T } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter().fromJson(bodyContent) + return when { + mediaType==null || (mediaType.startsWith("application/") && mediaType.endsWith("json")) -> + Serializer.moshi.adapter().fromJson(bodyContent) else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") } } @@ -186,11 +186,11 @@ open class ApiClient(val baseUrl: String) { } val headers = requestConfig.headers - if(headers[ContentType] ?: "" == "") { + if(headers[ContentType].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") } - if(headers[Accept] ?: "" == "") { + if(headers[Accept].isNullOrEmpty()) { throw kotlin.IllegalStateException("Missing Accept header. This is required.") } From 3247903caacb6ad139a8ebebfdc5110e8608e831 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Sat, 11 Dec 2021 13:48:59 +0000 Subject: [PATCH 12/54] [kotlin][client] update request exceptions (#11065) --- .../libraries/jvm-okhttp/api.mustache | 13 +-- .../openapitools/client/apis/DefaultApi.kt | 13 +-- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/EnumApi.kt | 13 +-- .../org/openapitools/client/apis/PetApi.kt | 90 ++++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 46 +++++----- .../org/openapitools/client/apis/UserApi.kt | 90 ++++++++++--------- 36 files changed, 1410 insertions(+), 1115 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 8059b5ffa7..57dd2c62aa 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -1,6 +1,8 @@ {{>licenseInfo}} package {{apiPackage}} +import java.io.IOException + {{#imports}}import {{import}} {{/imports}} @@ -38,12 +40,14 @@ import {{packageName}}.infrastructure.toMultiValue * {{notes}} {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}}* @return {{#returnType}}{{{returnType}}}{{#nullableReturnType}} or null{{/nullableReturnType}}{{/returnType}}{{^returnType}}void{{/returnType}} + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */{{#returnType}} @Suppress("UNCHECKED_CAST"){{/returnType}} - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} @@ -73,12 +77,11 @@ import {{packageName}}.infrastructure.toMultiValue * {{notes}} {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} {{/allParams}}* @return ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */{{#returnType}} @Suppress("UNCHECKED_CAST"){{/returnType}} - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index dfcdc11ef3..e5f3a7b2fa 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault import org.openapitools.client.infrastructure.ApiClient @@ -47,12 +49,14 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath * * * @return ModelWithEnumPropertyHavingDefault + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun operation() : ModelWithEnumPropertyHavingDefault { val localVarResponse = operationWithHttpInfo() @@ -75,12 +79,11 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath * * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun operationWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = operationRequestConfig() diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c9..c3426fbd0a 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c9..c3426fbd0a 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index a1a524e3cc..54cc4bbc49 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -217,12 +223,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -263,12 +268,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param lastUpdated When this endpoint was hit last to help identify if the client already has the latest copy. (optional) * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List { val localVarResponse = getAllPetsWithHttpInfo(lastUpdated = lastUpdated) @@ -292,12 +299,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param lastUpdated When this endpoint was hit last to help identify if the client already has the latest copy. (optional) * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiInfrastructureResponse?> { val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) @@ -337,12 +343,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -366,12 +374,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -406,11 +413,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -434,11 +443,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -475,11 +483,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -505,11 +515,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -547,12 +556,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -578,12 +589,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index e6271b33fc..9c9bdde5a8 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -51,11 +53,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun addPet(body: Pet) : Unit = withContext(Dispatchers.IO) { val localVarResponse = addPetWithHttpInfo(body = body) @@ -79,11 +83,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = addPetRequestConfig(body = body) @@ -119,11 +122,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit = withContext(Dispatchers.IO) { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -148,11 +153,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -188,12 +192,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -217,12 +223,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -260,12 +265,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") suspend fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { @Suppress("DEPRECATION") @@ -291,12 +298,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { @Suppress("DEPRECATION") @@ -337,12 +343,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getPetById(petId: kotlin.Long) : Pet = withContext(Dispatchers.IO) { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -366,12 +374,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -406,11 +413,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updatePet(body: Pet) : Unit = withContext(Dispatchers.IO) { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -434,11 +443,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetRequestConfig(body = body) @@ -475,11 +483,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit = withContext(Dispatchers.IO) { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -505,11 +515,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -547,12 +556,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -578,12 +589,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index fe498594da..94c499c7b7 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import kotlinx.coroutines.Dispatchers @@ -50,11 +52,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deleteOrder(orderId: kotlin.String) : Unit = withContext(Dispatchers.IO) { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -78,11 +82,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -115,12 +118,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getInventory() : kotlin.collections.Map = withContext(Dispatchers.IO) { val localVarResponse = getInventoryWithHttpInfo() @@ -143,12 +148,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = getInventoryRequestConfig() @@ -182,12 +186,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getOrderById(orderId: kotlin.Long) : Order = withContext(Dispatchers.IO) { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -211,12 +217,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -251,12 +256,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun placeOrder(body: Order) : Order = withContext(Dispatchers.IO) { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -280,12 +287,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 797a84aa61..8439a7f2bd 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import kotlinx.coroutines.Dispatchers @@ -50,11 +52,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUser(body: User) : Unit = withContext(Dispatchers.IO) { val localVarResponse = createUserWithHttpInfo(body = body) @@ -78,11 +82,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUserRequestConfig(body = body) @@ -116,11 +119,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit = withContext(Dispatchers.IO) { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -144,11 +149,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -182,11 +186,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun createUsersWithListInput(body: kotlin.collections.List) : Unit = withContext(Dispatchers.IO) { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -210,11 +216,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -248,11 +253,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun deleteUser(username: kotlin.String) : Unit = withContext(Dispatchers.IO) { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -276,11 +283,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -314,12 +320,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun getUserByName(username: kotlin.String) : User = withContext(Dispatchers.IO) { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -343,12 +351,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -384,12 +391,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String = withContext(Dispatchers.IO) { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -414,12 +423,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -458,11 +466,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun logoutUser() : Unit = withContext(Dispatchers.IO) { val localVarResponse = logoutUserWithHttpInfo() @@ -485,11 +495,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun logoutUserWithHttpInfo() : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = logoutUserRequestConfig() @@ -523,11 +532,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) suspend fun updateUser(username: kotlin.String, body: User) : Unit = withContext(Dispatchers.IO) { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -552,11 +563,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c9..c3426fbd0a 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index f01ad9c676..413c98693a 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index a71c936424..eb69e3afbd 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 478f791b87..75996ae341 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 641f25e2ad..ffa00253a3 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List? { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet? { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 60120ce05d..28c31e3db4 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map? { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order? { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order? { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 3b44d8f38f..9997944fa9 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User? { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String or null + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c9..c3426fbd0a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index bc8f157e48..fbadb8eb91 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param apiKey (optional) * @param petId Pet id to delete * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(apiKey: kotlin.String?, petId: kotlin.Long) : Unit { val localVarResponse = deletePetWithHttpInfo(apiKey = apiKey, petId = petId) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param apiKey (optional) * @param petId Pet id to delete * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c9..c3426fbd0a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index 87b7bc007a..4a5e70c002 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.PetEnum import org.openapitools.client.infrastructure.ApiClient @@ -47,12 +49,14 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get enums * * @return PetEnum + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getEnum() : PetEnum { val localVarResponse = getEnumWithHttpInfo() @@ -75,12 +79,11 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get enums * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getEnumWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = getEnumRequestConfig() diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 59367631c9..c3426fbd0a 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.ApiResponse import org.openapitools.client.models.Pet @@ -49,11 +51,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun addPet(body: Pet) : Unit { val localVarResponse = addPetWithHttpInfo(body = body) @@ -77,11 +81,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = addPetRequestConfig(body = body) @@ -117,11 +120,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { val localVarResponse = deletePetWithHttpInfo(petId = petId, apiKey = apiKey) @@ -146,11 +151,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId Pet id to delete * @param apiKey (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) @@ -186,12 +190,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) @@ -215,12 +221,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) @@ -258,12 +263,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return kotlin.collections.List + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { @Suppress("DEPRECATION") @@ -289,12 +296,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { @Suppress("DEPRECATION") @@ -335,12 +341,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return Pet + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getPetById(petId: kotlin.Long) : Pet { val localVarResponse = getPetByIdWithHttpInfo(petId = petId) @@ -364,12 +372,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Returns a single pet * @param petId ID of pet to return * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) @@ -404,11 +411,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePet(body: Pet) : Unit { val localVarResponse = updatePetWithHttpInfo(body = body) @@ -432,11 +441,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body Pet object that needs to be added to the store * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { val localVariableConfig = updatePetRequestConfig(body = body) @@ -473,11 +481,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { val localVarResponse = updatePetWithFormWithHttpInfo(petId = petId, name = name, status = status) @@ -503,11 +513,10 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) @@ -545,12 +554,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiResponse + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) @@ -576,12 +587,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 87d76a0b30..e905c41311 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteOrder(orderId: kotlin.String) : Unit { val localVarResponse = deleteOrderWithHttpInfo(orderId = orderId) @@ -76,11 +80,10 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) @@ -113,12 +116,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return kotlin.collections.Map + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getInventory() : kotlin.collections.Map { val localVarResponse = getInventoryWithHttpInfo() @@ -141,12 +146,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Returns pet inventories by status * Returns a map of status codes to quantities * @return ApiInfrastructureResponse?> - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { val localVariableConfig = getInventoryRequestConfig() @@ -180,12 +184,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getOrderById(orderId: kotlin.Long) : Order { val localVarResponse = getOrderByIdWithHttpInfo(orderId = orderId) @@ -209,12 +215,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) @@ -249,12 +254,14 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return Order + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun placeOrder(body: Order) : Order { val localVarResponse = placeOrderWithHttpInfo(body = body) @@ -278,12 +285,11 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * * @param body order placed for purchasing the pet * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { val localVariableConfig = placeOrderRequestConfig(body = body) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 444826b782..9381925680 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -20,6 +20,8 @@ package org.openapitools.client.apis +import java.io.IOException + import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient @@ -48,11 +50,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUser(body: User) : Unit { val localVarResponse = createUserWithHttpInfo(body = body) @@ -76,11 +80,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param body Created user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { val localVariableConfig = createUserRequestConfig(body = body) @@ -114,11 +117,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithArrayInputWithHttpInfo(body = body) @@ -142,11 +147,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) @@ -180,11 +184,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun createUsersWithListInput(body: kotlin.collections.List) : Unit { val localVarResponse = createUsersWithListInputWithHttpInfo(body = body) @@ -208,11 +214,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param body List of user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) @@ -246,11 +251,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun deleteUser(username: kotlin.String) : Unit { val localVarResponse = deleteUserWithHttpInfo(username = username) @@ -274,11 +281,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username The name that needs to be deleted * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = deleteUserRequestConfig(username = username) @@ -312,12 +318,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return User + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun getUserByName(username: kotlin.String) : User { val localVarResponse = getUserByNameWithHttpInfo(username = username) @@ -341,12 +349,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The name that needs to be fetched. Use user1 for testing. * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) @@ -382,12 +389,14 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return kotlin.String + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { val localVarResponse = loginUserWithHttpInfo(username = username, password = password) @@ -412,12 +421,11 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username The user name for login * @param password The password for login in clear text * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) @@ -456,11 +464,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun logoutUser() : Unit { val localVarResponse = logoutUserWithHttpInfo() @@ -483,11 +493,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Logs out current logged in user session * * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { val localVariableConfig = logoutUserRequestConfig() @@ -521,11 +530,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return void + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response * @throws ClientException If the API returns a client error response * @throws ServerException If the API returns a server error response */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) fun updateUser(username: kotlin.String, body: User) : Unit { val localVarResponse = updateUserWithHttpInfo(username = username, body = body) @@ -550,11 +561,10 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param username name that need to be deleted * @param body Updated user object * @return ApiInfrastructureResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response + * @throws IllegalStateException If the request is not correctly configured + * @throws IOException Rethrows the OkHttp execute method exception */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) + @Throws(IllegalStateException::class, IOException::class) fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) From fbb61658dfbcc2c1f5087511b0f74756553791ad Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sun, 12 Dec 2021 16:32:08 +0800 Subject: [PATCH 13/54] [kotlin][client] rename ApiInfrastructureResponse to ApiResponse (#11094) * rename ApiInfrastructureResponse to ApiResponse * mark ApiResponse as reserved word * update samples, docs * fix typo --- docs/generators/kotlin-server-deprecated.md | 1 + docs/generators/kotlin-server.md | 1 + docs/generators/kotlin-vertx.md | 1 + docs/generators/kotlin.md | 1 + .../languages/AbstractKotlinCodegen.java | 1 + .../languages/KotlinClientCodegen.java | 2 +- .../libraries/jvm-okhttp/api.mustache | 6 +-- .../infrastructure/ApiClient.kt.mustache | 2 +- ...se.kt.mustache => ApiResponse.kt.mustache} | 12 ++--- .../.openapi-generator/FILES | 2 +- .../openapitools/client/apis/DefaultApi.kt | 6 +-- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../kotlin-gson/.openapi-generator/FILES | 4 +- samples/client/petstore/kotlin-gson/README.md | 2 +- .../petstore/kotlin-gson/docs/ApiResponse.md | 2 +- .../petstore/kotlin-gson/docs/PetApi.md | 6 +-- samples/client/petstore/kotlin-gson/gradlew | 0 .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-jackson/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-jackson/README.md | 2 +- .../kotlin-jackson/docs/ApiResponse.md | 2 +- .../petstore/kotlin-jackson/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../kotlin-json-request-string/README.md | 2 +- .../docs/ApiResponse.md | 2 +- .../kotlin-json-request-string/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../client/infrastructure/ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../kotlin-jvm-okhttp4-coroutines/README.md | 2 +- .../docs/ApiResponse.md | 2 +- .../docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../petstore/kotlin-moshi-codegen/README.md | 2 +- .../kotlin-moshi-codegen/docs/ApiResponse.md | 2 +- .../kotlin-moshi-codegen/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../petstore/kotlin-multiplatform/README.md | 2 +- .../kotlin-multiplatform/docs/ApiResponse.md | 2 +- .../kotlin-multiplatform/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-nonpublic/.openapi-generator/FILES | 4 +- .../petstore/kotlin-nonpublic/README.md | 2 +- .../kotlin-nonpublic/docs/ApiResponse.md | 2 +- .../petstore/kotlin-nonpublic/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- ...frastructureResponse.kt => ApiResponse.kt} | 12 ++--- .../client/models/ModelApiResponse.kt | 46 +++++++++++++++++++ .../kotlin-nullable/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-nullable/README.md | 2 +- .../kotlin-nullable/docs/ApiResponse.md | 2 +- .../petstore/kotlin-nullable/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- ...frastructureResponse.kt => ApiResponse.kt} | 12 ++--- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-okhttp3/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-okhttp3/README.md | 2 +- .../kotlin-okhttp3/docs/ApiResponse.md | 2 +- .../petstore/kotlin-okhttp3/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../client/models/ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../README.md | 2 +- .../docs/ApiResponse.md | 2 +- .../docs/PetApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../petstore/kotlin-retrofit2-rx3/README.md | 2 +- .../kotlin-retrofit2-rx3/docs/ApiResponse.md | 2 +- .../kotlin-retrofit2-rx3/docs/PetApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../kotlin-retrofit2/.openapi-generator/FILES | 2 +- .../petstore/kotlin-retrofit2/README.md | 2 +- .../kotlin-retrofit2/docs/ApiResponse.md | 2 +- .../petstore/kotlin-retrofit2/docs/PetApi.md | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +-- .../client/models/ModelApiResponse.kt} | 2 +- .../kotlin-string/.openapi-generator/FILES | 4 +- .../client/petstore/kotlin-string/README.md | 2 +- .../kotlin-string/docs/ApiResponse.md | 2 +- .../petstore/kotlin-string/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 4 +- .../petstore/kotlin-threetenbp/README.md | 2 +- .../kotlin-threetenbp/docs/ApiResponse.md | 2 +- .../petstore/kotlin-threetenbp/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../client/models/ModelApiResponse.kt} | 2 +- .../.openapi-generator/FILES | 2 +- .../org/openapitools/client/apis/EnumApi.kt | 6 +-- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../petstore/kotlin/.openapi-generator/FILES | 4 +- samples/client/petstore/kotlin/README.md | 2 +- .../petstore/kotlin/docs/ApiResponse.md | 2 +- samples/client/petstore/kotlin/docs/PetApi.md | 6 +-- .../org/openapitools/client/apis/PetApi.kt | 44 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 18 ++++---- .../org/openapitools/client/apis/UserApi.kt | 34 +++++++------- .../client/infrastructure/ApiClient.kt | 2 +- .../ApiInfrastructureResponse.kt | 43 ----------------- .../client/infrastructure/ApiResponse.kt | 43 +++++++++++++++++ .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- .../ktor/.openapi-generator/FILES | 2 +- .../petstore/kotlin-server/ktor/README.md | 2 +- .../org/openapitools/server/apis/PetApi.kt | 2 +- .../{ApiResponse.kt => ModelApiResponse.kt} | 2 +- 163 files changed, 1076 insertions(+), 1025 deletions(-) rename modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/{ApiInfrastructureResponse.kt.mustache => ApiResponse.kt.mustache} (76%) rename samples/client/petstore/{kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) mode change 100644 => 100755 samples/client/petstore/kotlin-gson/gradlew rename samples/client/petstore/{kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/{kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/{kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt => kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) rename samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/{ApiInfrastructureResponse.kt => ApiResponse.kt} (73%) create mode 100644 samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt rename samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/{ApiInfrastructureResponse.kt => ApiResponse.kt} (73%) rename samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) delete mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/{kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt => kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt} (96%) rename samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) rename samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) rename samples/client/petstore/{kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt => kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt} (96%) delete mode 100644 samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) delete mode 100644 samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/{kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt => kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt} (96%) delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt create mode 100644 samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt rename samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/{ApiResponse.kt => ModelApiResponse.kt} (97%) rename samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/{ApiResponse.kt => ModelApiResponse.kt} (96%) diff --git a/docs/generators/kotlin-server-deprecated.md b/docs/generators/kotlin-server-deprecated.md index 2287e954ab..7e53620aa6 100644 --- a/docs/generators/kotlin-server-deprecated.md +++ b/docs/generators/kotlin-server-deprecated.md @@ -74,6 +74,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
    +
  • ApiResponse
  • abstract
  • actual
  • annotation
  • diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 81f75ca578..0c0228d8a8 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -76,6 +76,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
      +
    • ApiResponse
    • abstract
    • actual
    • annotation
    • diff --git a/docs/generators/kotlin-vertx.md b/docs/generators/kotlin-vertx.md index 90afde4de8..02d608e527 100644 --- a/docs/generators/kotlin-vertx.md +++ b/docs/generators/kotlin-vertx.md @@ -68,6 +68,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
        +
      • ApiResponse
      • abstract
      • actual
      • annotation
      • diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 49e02994b7..cbf43a3a1e 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -79,6 +79,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl ## RESERVED WORDS
          +
        • ApiResponse
        • abstract
        • actual
        • annotation
        • diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java index e0fb899e2f..0cd24435d4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractKotlinCodegen.java @@ -98,6 +98,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co // this includes hard reserved words defined by https://github.com/JetBrains/kotlin/blob/master/core/descriptors/src/org/jetbrains/kotlin/renderer/KeywordStringsGenerated.java // as well as keywords from https://kotlinlang.org/docs/reference/keyword-reference.html reservedWords = new HashSet<>(Arrays.asList( + "ApiResponse", // Used in the auto-generated api client "abstract", "actual", "annotation", diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 80b54000dd..3d2135e03c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -541,7 +541,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { // jvm specific supporting files supportingFiles.add(new SupportingFile("infrastructure/Errors.kt.mustache", infrastructureFolder, "Errors.kt")); supportingFiles.add(new SupportingFile("infrastructure/ResponseExtensions.kt.mustache", infrastructureFolder, "ResponseExtensions.kt")); - supportingFiles.add(new SupportingFile("infrastructure/ApiInfrastructureResponse.kt.mustache", infrastructureFolder, "ApiInfrastructureResponse.kt")); + supportingFiles.add(new SupportingFile("infrastructure/ApiResponse.kt.mustache", infrastructureFolder, "ApiResponse.kt")); } private void processMultiplatformLibrary(final String infrastructureFolder) { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index 57dd2c62aa..f7a01d9dfb 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -13,7 +13,7 @@ import kotlinx.coroutines.withContext {{/useCoroutines}} {{/doNotUseRxAndCoroutines}} import {{packageName}}.infrastructure.ApiClient -import {{packageName}}.infrastructure.ApiInfrastructureResponse +import {{packageName}}.infrastructure.ApiResponse import {{packageName}}.infrastructure.ClientException import {{packageName}}.infrastructure.ClientError import {{packageName}}.infrastructure.ServerException @@ -76,7 +76,7 @@ import {{packageName}}.infrastructure.toMultiValue * {{summary}} * {{notes}} {{#allParams}}* @param {{{paramName}}} {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} - {{/allParams}}* @return ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> + {{/allParams}}* @return ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */{{#returnType}} @@ -85,7 +85,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiInfrastructureResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 8f30c1808e..78c16621cf 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -309,7 +309,7 @@ import com.squareup.moshi.adapter } {{/hasAuthMethods}} - protected {{#useCoroutines}}suspend {{/useCoroutines}}inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected {{#useCoroutines}}suspend {{/useCoroutines}}inline fun request(requestConfig: RequestConfig): ApiResponse { {{#jvm-okhttp3}} val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") {{/jvm-okhttp3}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiInfrastructureResponse.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache similarity index 76% rename from modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiInfrastructureResponse.kt.mustache rename to modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache index 98be9afd5f..d529ad5599 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiInfrastructureResponse.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiResponse.kt.mustache @@ -6,7 +6,7 @@ package {{packageName}}.infrastructure {{#nonPublicApi}}internal {{/nonPublicApi}}interface Response -{{#nonPublicApi}}internal {{/nonPublicApi}}abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +{{#nonPublicApi}}internal {{/nonPublicApi}}abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ package {{packageName}}.infrastructure val data: T{{#nullableReturnType}}?{{/nullableReturnType}}, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) {{#nonPublicApi}}internal {{/nonPublicApi}}class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) {{#nonPublicApi}}internal {{/nonPublicApi}}class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) {{#nonPublicApi}}internal {{/nonPublicApi}}class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) {{#nonPublicApi}}internal {{/nonPublicApi}}class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES index bb98f9a003..66329670bf 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES @@ -10,7 +10,7 @@ settings.gradle src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index e5f3a7b2fa..ef0c183338 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -78,13 +78,13 @@ class DefaultApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath /** * * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun operationWithHttpInfo() : ApiInfrastructureResponse { + fun operationWithHttpInfo() : ApiResponse { val localVariableConfig = operationRequestConfig() return request( diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8a9c47045e..09194ef927 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -145,7 +145,7 @@ open class ApiClient(val baseUrl: String) { } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbf..cf2cfaa95d 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES index 1f38d3fbe2..d1f6eddcef 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -30,8 +30,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-gson/README.md b/samples/client/petstore/kotlin-gson/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-gson/README.md +++ b/samples/client/petstore/kotlin-gson/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-gson/docs/ApiResponse.md b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-gson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-gson/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-gson/docs/PetApi.md b/samples/client/petstore/kotlin-gson/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin-gson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-gson/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-gson/gradlew b/samples/client/petstore/kotlin-gson/gradlew old mode 100644 new mode 100755 diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a..b774e10e7b 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index f46f0ed6f5..5ac6cfd25b 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -160,7 +160,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbf..cf2cfaa95d 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index b50d6f2bde..773c82f431 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.google.gson.annotations.SerializedName * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @SerializedName("code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES index 816d952128..26ee35abac 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/FILES @@ -19,15 +19,15 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-jackson/README.md b/samples/client/petstore/kotlin-jackson/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-jackson/README.md +++ b/samples/client/petstore/kotlin-jackson/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md b/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jackson/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-jackson/docs/PetApi.md b/samples/client/petstore/kotlin-jackson/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin-jackson/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jackson/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a..b774e10e7b 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d01fa6041c..4d9d2e534d 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -160,7 +160,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbf..cf2cfaa95d 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 94a0b0b47d..be6fc87dff 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.fasterxml.jackson.annotation.JsonProperty * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @field:JsonProperty("code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-json-request-string/README.md b/samples/client/petstore/kotlin-json-request-string/README.md index f865de3689..56bfbfeeb9 100644 --- a/samples/client/petstore/kotlin-json-request-string/README.md +++ b/samples/client/petstore/kotlin-json-request-string/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md b/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md index 46b5ffc550..417acfb195 100644 --- a/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-json-request-string/docs/PetApi.md @@ -352,7 +352,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -367,7 +367,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -388,7 +388,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 54cc4bbc49..dcb8d97586 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -222,14 +222,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -298,13 +298,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get all pets * * @param lastUpdated When this endpoint was hit last to help identify if the client already has the latest copy. (optional) - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiInfrastructureResponse?> { + fun getAllPetsWithHttpInfo(lastUpdated: java.time.OffsetDateTime?) : ApiResponse?> { val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) return request>( @@ -373,13 +373,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -442,12 +442,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -514,12 +514,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -555,7 +555,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -564,11 +564,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -588,16 +588,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 917c3d3f3d..c344dff4af 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -167,7 +167,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 9dc8d8dbbf..cf2cfaa95d 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index c53f3e313e..61b35faee8 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -34,7 +34,7 @@ import kotlinx.parcelize.Parcelize */ @Parcelize -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES index 1f38d3fbe2..d1f6eddcef 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt @@ -30,8 +30,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 9c9bdde5a8..1cd9901c0f 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,13 +22,13 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -82,12 +82,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun addPetWithHttpInfo(body: Pet) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = addPetRequestConfig(body = body) return@withContext request( @@ -152,12 +152,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return@withContext request( @@ -222,13 +222,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return@withContext request>( @@ -297,14 +297,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + suspend fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -373,13 +373,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return@withContext request( @@ -442,12 +442,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun updatePetWithHttpInfo(body: Pet) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetRequestConfig(body = body) return@withContext request( @@ -514,12 +514,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return@withContext request, Unit>( @@ -555,7 +555,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -564,11 +564,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) { + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse = withContext(Dispatchers.IO) { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return@withContext when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -588,16 +588,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return@withContext request, ApiResponse>( + return@withContext request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 94c499c7b7..430d9449c4 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -27,7 +27,7 @@ import org.openapitools.client.models.Order import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -81,12 +81,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return@withContext request( @@ -147,13 +147,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> = withContext(Dispatchers.IO) { + suspend fun getInventoryWithHttpInfo() : ApiResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = getInventoryRequestConfig() return@withContext request>( @@ -216,13 +216,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return@withContext request( @@ -286,13 +286,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun placeOrderWithHttpInfo(body: Order) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = placeOrderRequestConfig(body = body) return@withContext request( diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 8439a7f2bd..d318fa7477 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -27,7 +27,7 @@ import org.openapitools.client.models.User import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -81,12 +81,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun createUserWithHttpInfo(body: User) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUserRequestConfig(body = body) return@withContext request( @@ -148,12 +148,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return@withContext request, Unit>( @@ -215,12 +215,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return@withContext request, Unit>( @@ -282,12 +282,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = deleteUserRequestConfig(username = username) return@withContext request( @@ -350,13 +350,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = getUserByNameRequestConfig(username = username) return@withContext request( @@ -422,13 +422,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return@withContext request( @@ -494,12 +494,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun logoutUserWithHttpInfo() : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun logoutUserWithHttpInfo() : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = logoutUserRequestConfig() return@withContext request( @@ -562,12 +562,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse = withContext(Dispatchers.IO) { + suspend fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse = withContext(Dispatchers.IO) { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return@withContext request( diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 141689f40f..43f89e88cb 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -163,7 +163,7 @@ open class ApiClient(val baseUrl: String) { } } - protected suspend inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected suspend inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index dfb777a87f..16e2038ba9 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @SerializedName("code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-moshi-codegen/README.md b/samples/client/petstore/kotlin-moshi-codegen/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/README.md +++ b/samples/client/petstore/kotlin-moshi-codegen/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md b/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md +++ b/samples/client/petstore/kotlin-moshi-codegen/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a..b774e10e7b 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae..7282e53200 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 9db3de6822..1921982e78 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import com.squareup.moshi.JsonClass * @param message */ @JsonClass(generateAdapter = true) -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES index d95b6af6c4..c917cc8687 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/FILES @@ -26,8 +26,8 @@ src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt -src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt src/commonMain/kotlin/org/openapitools/client/models/Category.kt +src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/commonMain/kotlin/org/openapitools/client/models/Order.kt src/commonMain/kotlin/org/openapitools/client/models/Pet.kt src/commonMain/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-multiplatform/README.md b/samples/client/petstore/kotlin-multiplatform/README.md index 28a4e3f120..0e965d57d6 100644 --- a/samples/client/petstore/kotlin-multiplatform/README.md +++ b/samples/client/petstore/kotlin-multiplatform/README.md @@ -51,8 +51,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md b/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md index 7b3efc23d8..efde11091c 100644 --- a/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md +++ b/samples/client/petstore/kotlin-multiplatform/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : io.ktor.client.request.forms.InputProvider = BINARY_DATA_HERE // io.ktor.client.request.forms.InputProvider | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt index fe81cdf5bc..1cdbc9d105 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt @@ -20,7 +20,7 @@ package org.openapitools.client.apis -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.* @@ -303,10 +303,10 @@ class PetApi( * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse */ @Suppress("UNCHECKED_CAST") - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 0358a25b54..614529156e 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -33,7 +33,7 @@ import kotlinx.serialization.encoding.* * @param message */ @Serializable -data class ApiResponse ( +data class ModelApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-nonpublic/README.md b/samples/client/petstore/kotlin-nonpublic/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-nonpublic/README.md +++ b/samples/client/petstore/kotlin-nonpublic/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md b/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nonpublic/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 413c98693a..33d1e110f1 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index eb69e3afbd..02201f04d4 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(b * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 75996ae341..3475e9c469 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 313f2e1652..6ef92322fb 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ internal open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index c618544573..64824828dd 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ internal enum class ResponseType { internal interface Response -internal abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +internal abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ internal class Success( val data: T, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) internal class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) internal class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) internal class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) internal class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 0000000000..43947587cf --- /dev/null +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,46 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.squareup.moshi.Json + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + +internal data class ModelApiResponse ( + + @Json(name = "code") + val code: kotlin.Int? = null, + + @Json(name = "type") + val type: kotlin.String? = null, + + @Json(name = "message") + val message: kotlin.String? = null + +) + diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-nullable/README.md b/samples/client/petstore/kotlin-nullable/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-nullable/README.md +++ b/samples/client/petstore/kotlin-nullable/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-nullable/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-nullable/docs/PetApi.md b/samples/client/petstore/kotlin-nullable/docs/PetApi.md index e769fecd53..be940c52ee 100644 --- a/samples/client/petstore/kotlin-nullable/docs/PetApi.md +++ b/samples/client/petstore/kotlin-nullable/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse? = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse? = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index ffa00253a3..8f8335f8b7 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse or null + * @return ModelApiResponse or null * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse? { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse? + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse? ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 28c31e3db4..b35fda4472 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9997944fa9..87ad7db896 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae..7282e53200 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt similarity index 73% rename from samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt rename to samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt index 77066de4e5..20ac25b125 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -6,7 +6,7 @@ enum class ResponseType { interface Response -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { +abstract class ApiResponse(val responseType: ResponseType): Response { abstract val statusCode: Int abstract val headers: Map> } @@ -15,29 +15,29 @@ class Success( val data: T?, override val statusCode: Int = -1, override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) +): ApiResponse(ResponseType.Success) class Informational( val statusText: String, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) +) : ApiResponse(ResponseType.Informational) class Redirection( override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) +) : ApiResponse(ResponseType.Redirection) class ClientError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) +) : ApiResponse(ResponseType.ClientError) class ServerError( val message: String? = null, val body: Any? = null, override val statusCode: Int = -1, override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 617982fdfe..5f584a05ac 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-okhttp3/README.md b/samples/client/petstore/kotlin-okhttp3/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-okhttp3/README.md +++ b/samples/client/petstore/kotlin-okhttp3/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md b/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-okhttp3/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a..b774e10e7b 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index d3ac6493d6..17646c1df1 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -158,7 +158,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d430296dc4..15c64ef38a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES index cc7132b287..247ff9a723 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES @@ -40,8 +40,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/StringBuilderAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/URLAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md index 341e51a324..8fb632221c 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md index cd0240ec98..3997c8cf39 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/docs/PetApi.md @@ -294,7 +294,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -val result : ApiResponse = webService.uploadFile(petId, additionalMetadata, file) +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) ``` ### Parameters @@ -307,7 +307,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 1af051c6c7..d3268ae63d 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -5,7 +5,7 @@ import retrofit2.http.* import retrofit2.Call import okhttp3.RequestBody -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import okhttp3.MultipartBody @@ -115,10 +115,10 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ModelApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call } diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 0773d7f17d..c898dbd152 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -34,7 +34,7 @@ import java.io.Serializable * @param message */ @KSerializable -data class ApiResponse ( +data class ModelApiResponse ( @SerialName(value = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES index 04b505d1f1..d84bff350d 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/FILES @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/README.md b/samples/client/petstore/kotlin-retrofit2-rx3/README.md index 341e51a324..8fb632221c 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/README.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md index cd0240ec98..3997c8cf39 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2-rx3/docs/PetApi.md @@ -294,7 +294,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -val result : ApiResponse = webService.uploadFile(petId, additionalMetadata, file) +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) ``` ### Parameters @@ -307,7 +307,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8f04b3fd8f..c174546cae 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -6,7 +6,7 @@ import okhttp3.RequestBody import io.reactivex.rxjava3.core.Single; import io.reactivex.rxjava3.core.Completable; -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import okhttp3.MultipartBody @@ -116,10 +116,10 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ModelApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Single + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Single } diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d430296dc4..15c64ef38a 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2-rx3/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES index 04b505d1f1..d84bff350d 100644 --- a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/FILES @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExt.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-retrofit2/README.md b/samples/client/petstore/kotlin-retrofit2/README.md index 341e51a324..8fb632221c 100644 --- a/samples/client/petstore/kotlin-retrofit2/README.md +++ b/samples/client/petstore/kotlin-retrofit2/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md b/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md index cd0240ec98..3997c8cf39 100644 --- a/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md +++ b/samples/client/petstore/kotlin-retrofit2/docs/PetApi.md @@ -294,7 +294,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -val result : ApiResponse = webService.uploadFile(petId, additionalMetadata, file) +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) ``` ### Parameters @@ -307,7 +307,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 1af051c6c7..d3268ae63d 100644 --- a/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -5,7 +5,7 @@ import retrofit2.http.* import retrofit2.Call import okhttp3.RequestBody -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import okhttp3.MultipartBody @@ -115,10 +115,10 @@ interface PetApi { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> + * @return [Call]<[ModelApiResponse]> */ @Multipart @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call + fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String? = null, @Part file: MultipartBody.Part? = null): Call } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index d430296dc4..15c64ef38a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-retrofit2/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/FILES b/samples/client/petstore/kotlin-string/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-string/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-string/README.md b/samples/client/petstore/kotlin-string/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-string/README.md +++ b/samples/client/petstore/kotlin-string/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-string/docs/ApiResponse.md b/samples/client/petstore/kotlin-string/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-string/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-string/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-string/docs/PetApi.md b/samples/client/petstore/kotlin-string/docs/PetApi.md index 39f8f0858a..3173ade5c8 100644 --- a/samples/client/petstore/kotlin-string/docs/PetApi.md +++ b/samples/client/petstore/kotlin-string/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index fbadb8eb91..40c875dcdc 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param apiKey (optional) * @param petId Pet id to delete - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(apiKey: kotlin.String?, petId: kotlin.Long) : ApiResponse { val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae..7282e53200 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 617982fdfe..5f584a05ac 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin-threetenbp/README.md b/samples/client/petstore/kotlin-threetenbp/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin-threetenbp/README.md +++ b/samples/client/petstore/kotlin-threetenbp/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md b/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md +++ b/samples/client/petstore/kotlin-threetenbp/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a..b774e10e7b 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 42e08a49f3..8ae5de40f5 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 96% rename from samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index a38d613adb..15c64ef38a 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -31,7 +31,7 @@ import com.squareup.moshi.Json * @param message */ -internal data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES index c817d80248..113f981ccd 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/FILES @@ -10,7 +10,7 @@ settings.gradle src/main/kotlin/org/openapitools/client/apis/EnumApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index 4a5e70c002..9e39ffb9d0 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.PetEnum import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -78,13 +78,13 @@ class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Get enums * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getEnumWithHttpInfo() : ApiInfrastructureResponse { + fun getEnumWithHttpInfo() : ApiResponse { val localVariableConfig = getEnumRequestConfig() return request( diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8a9c47045e..09194ef927 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -145,7 +145,7 @@ open class ApiClient(val baseUrl: String) { } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") val url = httpUrl.newBuilder() diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin/.openapi-generator/FILES b/samples/client/petstore/kotlin/.openapi-generator/FILES index 16c712325f..c7a409ac16 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin/.openapi-generator/FILES @@ -19,7 +19,7 @@ src/main/kotlin/org/openapitools/client/apis/StoreApi.kt src/main/kotlin/org/openapitools/client/apis/UserApi.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -33,8 +33,8 @@ src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt -src/main/kotlin/org/openapitools/client/models/ApiResponse.kt src/main/kotlin/org/openapitools/client/models/Category.kt +src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/client/models/Order.kt src/main/kotlin/org/openapitools/client/models/Pet.kt src/main/kotlin/org/openapitools/client/models/Tag.kt diff --git a/samples/client/petstore/kotlin/README.md b/samples/client/petstore/kotlin/README.md index 97f9b81664..5ecae07a7a 100644 --- a/samples/client/petstore/kotlin/README.md +++ b/samples/client/petstore/kotlin/README.md @@ -60,8 +60,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Tag](docs/Tag.md) diff --git a/samples/client/petstore/kotlin/docs/ApiResponse.md b/samples/client/petstore/kotlin/docs/ApiResponse.md index 6b4c6bf277..12f08d5cde 100644 --- a/samples/client/petstore/kotlin/docs/ApiResponse.md +++ b/samples/client/petstore/kotlin/docs/ApiResponse.md @@ -1,5 +1,5 @@ -# ApiResponse +# ModelApiResponse ## Properties Name | Type | Description | Notes diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index 403e57a4b3..038c57e68e 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -354,7 +354,7 @@ Configure petstore_auth: # **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) +> ModelApiResponse uploadFile(petId, additionalMetadata, file) uploads an image @@ -369,7 +369,7 @@ val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) + val result : ModelApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) } catch (e: ClientException) { println("4xx response calling PetApi#uploadFile") @@ -390,7 +390,7 @@ Name | Type | Description | Notes ### Return type -[**ApiResponse**](ApiResponse.md) +[**ModelApiResponse**](ModelApiResponse.md) ### Authorization diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index c3426fbd0a..b774e10e7b 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -22,11 +22,11 @@ package org.openapitools.client.apis import java.io.IOException -import org.openapitools.client.models.ApiResponse +import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -80,12 +80,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Add a new pet to the store * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun addPetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun addPetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = addPetRequestConfig(body = body) return request( @@ -150,12 +150,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param petId Pet id to delete * @param apiKey (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiInfrastructureResponse { + fun deletePetWithHttpInfo(petId: kotlin.Long, apiKey: kotlin.String?) : ApiResponse { val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) return request( @@ -220,13 +220,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by status * Multiple status values can be provided with comma separated strings * @param status Status values that need to be considered for filter - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -295,14 +295,14 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Finds Pets by tags * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param tags Tags to filter by - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiInfrastructureResponse?> { + fun findPetsByTagsWithHttpInfo(tags: kotlin.collections.List) : ApiResponse?> { @Suppress("DEPRECATION") val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) @@ -371,13 +371,13 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Find pet by ID * Returns a single pet * @param petId ID of pet to return - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiInfrastructureResponse { + fun getPetByIdWithHttpInfo(petId: kotlin.Long) : ApiResponse { val localVariableConfig = getPetByIdRequestConfig(petId = petId) return request( @@ -440,12 +440,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Update an existing pet * * @param body Pet object that needs to be added to the store - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithHttpInfo(body: Pet) : ApiInfrastructureResponse { + fun updatePetWithHttpInfo(body: Pet) : ApiResponse { val localVariableConfig = updatePetRequestConfig(body = body) return request( @@ -512,12 +512,12 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet that needs to be updated * @param name Updated name of the pet (optional) * @param status Updated status of the pet (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiInfrastructureResponse { + fun updatePetWithFormWithHttpInfo(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : ApiResponse { val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) return request, Unit>( @@ -553,7 +553,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiResponse + * @return ModelApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception * @throws UnsupportedOperationException If the API returns an informational or redirection response @@ -562,11 +562,11 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ModelApiResponse { val localVarResponse = uploadFileWithHttpInfo(petId = petId, additionalMetadata = additionalMetadata, file = file) return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse + ResponseType.Success -> (localVarResponse as Success<*>).data as ModelApiResponse ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") ResponseType.ClientError -> { @@ -586,16 +586,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server (optional) * @param file file to upload (optional) - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiInfrastructureResponse { + fun uploadFileWithHttpInfo(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - return request, ApiResponse>( + return request, ModelApiResponse>( localVariableConfig ) } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index e905c41311..d9cc68f004 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.Order import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Delete purchase order by ID * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @param orderId ID of the order that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiInfrastructureResponse { + fun deleteOrderWithHttpInfo(orderId: kotlin.String) : ApiResponse { val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) return request( @@ -145,13 +145,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) /** * Returns pet inventories by status * Returns a map of status codes to quantities - * @return ApiInfrastructureResponse?> + * @return ApiResponse?> * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getInventoryWithHttpInfo() : ApiInfrastructureResponse?> { + fun getInventoryWithHttpInfo() : ApiResponse?> { val localVariableConfig = getInventoryRequestConfig() return request>( @@ -214,13 +214,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Find purchase order by ID * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param orderId ID of pet that needs to be fetched - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiInfrastructureResponse { + fun getOrderByIdWithHttpInfo(orderId: kotlin.Long) : ApiResponse { val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) return request( @@ -284,13 +284,13 @@ class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) * Place an order for a pet * * @param body order placed for purchasing the pet - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun placeOrderWithHttpInfo(body: Order) : ApiInfrastructureResponse { + fun placeOrderWithHttpInfo(body: Order) : ApiResponse { val localVariableConfig = placeOrderRequestConfig(body = body) return request( diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 9381925680..efbff79281 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -25,7 +25,7 @@ import java.io.IOException import org.openapitools.client.models.User import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ApiInfrastructureResponse +import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException import org.openapitools.client.infrastructure.ClientError import org.openapitools.client.infrastructure.ServerException @@ -79,12 +79,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Create user * This can only be done by the logged in user. * @param body Created user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUserWithHttpInfo(body: User) : ApiInfrastructureResponse { + fun createUserWithHttpInfo(body: User) : ApiResponse { val localVariableConfig = createUserRequestConfig(body = body) return request( @@ -146,12 +146,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithArrayInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) return request, Unit>( @@ -213,12 +213,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Creates list of users with given input array * * @param body List of user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiInfrastructureResponse { + fun createUsersWithListInputWithHttpInfo(body: kotlin.collections.List) : ApiResponse { val localVariableConfig = createUsersWithListInputRequestConfig(body = body) return request, Unit>( @@ -280,12 +280,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Delete user * This can only be done by the logged in user. * @param username The name that needs to be deleted - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun deleteUserWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun deleteUserWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = deleteUserRequestConfig(username = username) return request( @@ -348,13 +348,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * Get user by user name * * @param username The name that needs to be fetched. Use user1 for testing. - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiInfrastructureResponse { + fun getUserByNameWithHttpInfo(username: kotlin.String) : ApiResponse { val localVariableConfig = getUserByNameRequestConfig(username = username) return request( @@ -420,13 +420,13 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * * @param username The user name for login * @param password The password for login in clear text - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiInfrastructureResponse { + fun loginUserWithHttpInfo(username: kotlin.String, password: kotlin.String) : ApiResponse { val localVariableConfig = loginUserRequestConfig(username = username, password = password) return request( @@ -492,12 +492,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { /** * Logs out current logged in user session * - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun logoutUserWithHttpInfo() : ApiInfrastructureResponse { + fun logoutUserWithHttpInfo() : ApiResponse { val localVariableConfig = logoutUserRequestConfig() return request( @@ -560,12 +560,12 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * This can only be done by the logged in user. * @param username name that need to be deleted * @param body Updated user object - * @return ApiInfrastructureResponse + * @return ApiResponse * @throws IllegalStateException If the request is not correctly configured * @throws IOException Rethrows the OkHttp execute method exception */ @Throws(IllegalStateException::class, IOException::class) - fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiInfrastructureResponse { + fun updateUserWithHttpInfo(username: kotlin.String, body: User) : ApiResponse { val localVariableConfig = updateUserRequestConfig(username = username, body = body) return request( diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c218caafae..7282e53200 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -161,7 +161,7 @@ open class ApiClient(val baseUrl: String) { } } - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { + protected inline fun request(requestConfig: RequestConfig): ApiResponse { val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") // take authMethod from operation diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt new file mode 100644 index 0000000000..cf2cfaa95d --- /dev/null +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt @@ -0,0 +1,43 @@ +package org.openapitools.client.infrastructure + +enum class ResponseType { + Success, Informational, Redirection, ClientError, ServerError +} + +interface Response + +abstract class ApiResponse(val responseType: ResponseType): Response { + abstract val statusCode: Int + abstract val headers: Map> +} + +class Success( + val data: T, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +): ApiResponse(ResponseType.Success) + +class Informational( + val statusText: String, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Informational) + +class Redirection( + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.Redirection) + +class ClientError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> = mapOf() +) : ApiResponse(ResponseType.ClientError) + +class ServerError( + val message: String? = null, + val body: Any? = null, + override val statusCode: Int = -1, + override val headers: Map> +): ApiResponse(ResponseType.ServerError) diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt similarity index 97% rename from samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt rename to samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt index 617982fdfe..5f584a05ac 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt @@ -32,7 +32,7 @@ import java.io.Serializable * @param message */ -data class ApiResponse ( +data class ModelApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES index 10c026f11f..79943171ff 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/FILES @@ -10,8 +10,8 @@ src/main/kotlin/org/openapitools/server/apis/PetApi.kt src/main/kotlin/org/openapitools/server/apis/StoreApi.kt src/main/kotlin/org/openapitools/server/apis/UserApi.kt src/main/kotlin/org/openapitools/server/infrastructure/ApiKeyAuth.kt -src/main/kotlin/org/openapitools/server/models/ApiResponse.kt src/main/kotlin/org/openapitools/server/models/Category.kt +src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt src/main/kotlin/org/openapitools/server/models/Order.kt src/main/kotlin/org/openapitools/server/models/Pet.kt src/main/kotlin/org/openapitools/server/models/Tag.kt diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index d78e27dd2e..6ec361da3c 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -74,8 +74,8 @@ Class | Method | HTTP request | Description ## Documentation for Models - - [org.openapitools.server.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.server.models.Category](docs/Category.md) + - [org.openapitools.server.models.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.server.models.Order](docs/Order.md) - [org.openapitools.server.models.Pet](docs/Pet.md) - [org.openapitools.server.models.Tag](docs/Tag.md) diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt index 95f5d7fb88..0a4b29e2ca 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt @@ -20,7 +20,7 @@ import org.openapitools.server.Paths import io.ktor.locations.* import io.ktor.routing.* import org.openapitools.server.infrastructure.ApiPrincipal -import org.openapitools.server.models.ApiResponse +import org.openapitools.server.models.ModelApiResponse import org.openapitools.server.models.Pet @KtorExperimentalLocationsAPI diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt similarity index 96% rename from samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt rename to samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt index 14f50dbb9a..5548175d90 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ApiResponse.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/ModelApiResponse.kt @@ -19,7 +19,7 @@ import java.io.Serializable * @param type * @param message */ -data class ApiResponse( +data class ModelApiResponse( val code: kotlin.Int? = null, val type: kotlin.String? = null, val message: kotlin.String? = null From d5979d3180c480965ccdc1ea5faaa9e88ebfd856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= Date: Tue, 14 Dec 2021 08:44:22 +0100 Subject: [PATCH 14/54] [Protobuf-Schema] Added nullable (#11073) --- .../codegen/languages/ProtobufSchemaCodegen.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index 5f55e9d47f..d842a935a0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -254,6 +254,9 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf if (Boolean.TRUE.equals(var.isArray)) { var.vendorExtensions.put("x-protobuf-type", "repeated"); } + else if (Boolean.TRUE.equals(var.isNullable && var.isPrimitiveType)) { + var.vendorExtensions.put("x-protobuf-type", "optional"); + } // add x-protobuf-data-type // ref: https://developers.google.com/protocol-buffers/docs/proto3 @@ -500,9 +503,14 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf int index = 1; for (CodegenParameter p : op.allParams) { // add x-protobuf-type: repeated if it's an array + if (Boolean.TRUE.equals(p.isArray)) { p.vendorExtensions.put("x-protobuf-type", "repeated"); - } else if (Boolean.TRUE.equals(p.isMap)) { + } + else if (Boolean.TRUE.equals(p.isNullable && p.isPrimitiveType)) { + p.vendorExtensions.put("x-protobuf-type", "optional"); + } + else if (Boolean.TRUE.equals(p.isMap)) { LOGGER.warn("Map parameter (name: {}, operation ID: {}) not yet supported", p.paramName, op.operationId); } From 5416e92d19236d05e23a17e3a974ebe19072e2d3 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 14 Dec 2021 07:58:19 +0000 Subject: [PATCH 15/54] [swift5][client] add support for async/await in iOS 13 and above (#11109) --- .../src/main/resources/swift5/api.mustache | 2 +- .../OpenAPIs/APIs/AnotherFakeAPI.swift | 2 +- .../Classes/OpenAPIs/APIs/FakeAPI.swift | 24 +++++++++---------- .../APIs/FakeClassnameTags123API.swift | 2 +- .../Classes/OpenAPIs/APIs/PetAPI.swift | 18 +++++++------- .../Classes/OpenAPIs/APIs/StoreAPI.swift | 8 +++---- .../Classes/OpenAPIs/APIs/UserAPI.swift | 16 ++++++------- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 5ae1f5513d..2351c74fd9 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -197,7 +197,7 @@ extension {{projectName}}API { {{#isDeprecated}} @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue) async throws{{#returnType}} -> {{{returnType}}}{{/returnType}} { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift index bd8044516f..bbf14432b1 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -19,7 +19,7 @@ open class AnotherFakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Client */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func call123testSpecialTags(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift index 1b105b037f..acc67addbb 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -18,7 +18,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Bool */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterBooleanSerialize(body: Bool? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Bool { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -73,7 +73,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: OuterComposite */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterCompositeSerialize(body: OuterComposite? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> OuterComposite { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -128,7 +128,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Double */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterNumberSerialize(body: Double? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Double { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -183,7 +183,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: String */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func fakeOuterStringSerialize(body: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -238,7 +238,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithFileSchema(body: FileSchemaTestClass, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -294,7 +294,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testBodyWithQueryParams(query: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -353,7 +353,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Client */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClientModel(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -423,7 +423,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -588,7 +588,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testEnumParameters(enumHeaderStringArray: [EnumHeaderStringArray_testEnumParameters]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [EnumQueryStringArray_testEnumParameters]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [EnumFormStringArray_testEnumParameters]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -671,7 +671,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testGroupParameters(requiredStringGroup: Int, requiredBooleanGroup: Bool, requiredInt64Group: Int64, stringGroup: Int? = nil, booleanGroup: Bool? = nil, int64Group: Int64? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -740,7 +740,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testInlineAdditionalProperties(param: [String: String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -797,7 +797,7 @@ open class FakeAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testJsonFormData(param: String, param2: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift index 6313692d6d..f950419aea 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -19,7 +19,7 @@ open class FakeClassnameTags123API { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Client */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func testClassname(body: Client, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Client { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift index d541b28938..044d96d758 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -19,7 +19,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func addPet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -79,7 +79,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deletePet(petId: Int64, apiKey: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -151,7 +151,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: [Pet] */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByStatus(status: [Status_findPetsByStatus], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -215,7 +215,7 @@ open class PetAPI { - returns: [Pet] */ @available(*, deprecated, message: "This operation is deprecated.") - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func findPetsByTags(tags: [String], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [Pet] { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -279,7 +279,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Pet */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getPetById(petId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Pet { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -342,7 +342,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePet(body: Pet, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -403,7 +403,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -475,7 +475,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: ApiResponse */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -547,7 +547,7 @@ open class PetAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: ApiResponse */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func uploadFileWithRequiredFile(petId: Int64, requiredFile: URL, additionalMetadata: String? = nil, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> ApiResponse { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift index 510311783b..1548fa8814 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -19,7 +19,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteOrder(orderId: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -78,7 +78,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: [String: Int] */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getInventory(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> [String: Int] { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -137,7 +137,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Order */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getOrderById(orderId: Int64, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -197,7 +197,7 @@ open class StoreAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Order */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func placeOrder(body: Order, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> Order { var requestTask: RequestTask? return try await withTaskCancellationHandler { diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift index 7cc9a77f01..b44a7cdc72 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -19,7 +19,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUser(body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -76,7 +76,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithArrayInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -132,7 +132,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func createUsersWithListInput(body: [User], apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -188,7 +188,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func deleteUser(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -248,7 +248,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: User */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func getUserByName(username: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> User { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -308,7 +308,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: String */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func loginUser(username: String, password: String, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws -> String { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -369,7 +369,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func logoutUser(apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { @@ -425,7 +425,7 @@ open class UserAPI { - parameter apiResponseQueue: The queue on which api response is dispatched. - returns: Void */ - @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *) + @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) open class func updateUser(username: String, body: User, apiResponseQueue: DispatchQueue = PetstoreClientAPI.apiResponseQueue) async throws { var requestTask: RequestTask? return try await withTaskCancellationHandler { From eb224db540443792caba44c51c72b747d3a2d7a0 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 14 Dec 2021 08:03:12 +0000 Subject: [PATCH 16/54] [kotlin][client] remove old Date usage (#11082) * [kotlin][client] remove old Date usage * [kotlin][client] remove old Date usage --- .../kotlin-spring-boot-modelMutable.yaml | 0 .../{other => }/kotlin-vertx-vertx.yaml | 0 .../kotlin-jvm-retrofit2-coroutines.yaml | 0 .../kotlin-jvm-retrofit2-rx.yaml | 0 ...m-retrofit2-rx2-kotlinx_serialization.yaml | 0 .../kotlin-jvm-retrofit2-rx2.yaml | 0 .../{openapi3 => }/kotlin-multiplatform.yaml | 0 .../kotlin-spring-boot-reactive.yaml | 0 .../{openapi3 => }/kotlin-spring-boot.yaml | 0 bin/configs/other/{openapi3 => }/kotlin.yaml | 0 .../languages/KotlinClientCodegen.java | 3 - .../infrastructure/DateAdapter.kt.mustache | 67 --- .../infrastructure/Serializer.kt.mustache | 2 - .../infrastructure/ApiClient.kt.mustache | 3 +- .../client/infrastructure/ApiClient.kt | 3 +- .../kotlin-gson/.openapi-generator/FILES | 1 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 33 -- .../client/infrastructure/DateAdapter.kt | 37 -- .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 35 -- .../infrastructure/LocalDateTimeAdapter.kt | 35 -- .../infrastructure/OffsetDateTimeAdapter.kt | 35 -- .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 23 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/DateAdapter.kt | 37 -- .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 3 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 18 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../kotlin-petstore-jackson.kotlin_module | Bin 134 -> 0 bytes .../main/org/openapitools/ApplicationKt.class | Bin 3936 -> 0 bytes .../client/apis/PetApi$WhenMappings.class | Bin 1458 -> 0 bytes .../org/openapitools/client/apis/PetApi.class | Bin 82237 -> 0 bytes .../client/apis/StoreApi$WhenMappings.class | Bin 1040 -> 0 bytes .../openapitools/client/apis/StoreApi.class | Bin 42521 -> 0 bytes .../client/apis/UserApi$WhenMappings.class | Bin 1459 -> 0 bytes .../openapitools/client/apis/UserApi.class | Bin 79974 -> 0 bytes ...tionsKt$defaultMultiValueConverter$1.class | Bin 1439 -> 0 bytes .../infrastructure/ApiAbstractionsKt.class | Bin 5327 -> 0 bytes .../ApiClient$Companion$client$2.class | Bin 1445 -> 0 bytes .../infrastructure/ApiClient$Companion.class | Bin 4330 -> 0 bytes .../ApiClient$WhenMappings.class | Bin 768 -> 0 bytes .../client/infrastructure/ApiClient.class | Bin 31155 -> 0 bytes .../ApiInfrastructureResponse.class | Bin 1608 -> 0 bytes .../ApplicationDelegates$SetOnce.class | Bin 3186 -> 0 bytes .../infrastructure/ApplicationDelegates.class | Bin 1711 -> 0 bytes .../client/infrastructure/ClientError.class | Bin 2831 -> 0 bytes .../ClientException$Companion.class | Bin 945 -> 0 bytes .../infrastructure/ClientException.class | Bin 1622 -> 0 bytes .../client/infrastructure/Informational.class | Bin 2740 -> 0 bytes .../client/infrastructure/Redirection.class | Bin 2479 -> 0 bytes .../client/infrastructure/RequestConfig.class | Bin 5445 -> 0 bytes .../client/infrastructure/RequestMethod.class | Bin 1652 -> 0 bytes .../infrastructure/ResponseExtensionsKt.class | Bin 1499 -> 0 bytes .../client/infrastructure/ResponseType.class | Bin 1580 -> 0 bytes .../client/infrastructure/Serializer.class | Bin 2066 -> 0 bytes .../client/infrastructure/ServerError.class | Bin 2858 -> 0 bytes .../ServerException$Companion.class | Bin 945 -> 0 bytes .../infrastructure/ServerException.class | Bin 1622 -> 0 bytes .../client/infrastructure/Success.class | Bin 2686 -> 0 bytes .../client/models/ApiResponse.class | Bin 3611 -> 0 bytes .../openapitools/client/models/Category.class | Bin 3046 -> 0 bytes .../client/models/Order$Status.class | Bin 2115 -> 0 bytes .../openapitools/client/models/Order.class | Bin 5914 -> 0 bytes .../client/models/Pet$Status.class | Bin 2093 -> 0 bytes .../org/openapitools/client/models/Pet.class | Bin 6141 -> 0 bytes .../org/openapitools/client/models/Tag.class | Bin 3011 -> 0 bytes .../org/openapitools/client/models/User.class | Bin 6313 -> 0 bytes .../kotlin/compileKotlin/build-history.bin | Bin 31 -> 0 bytes .../caches-jvm/inputs/source-to-output.tab | Bin 4096 -> 0 bytes .../inputs/source-to-output.tab.keystream | Bin 4096 -> 0 bytes .../inputs/source-to-output.tab.keystream.len | Bin 8 -> 0 bytes .../inputs/source-to-output.tab.len | Bin 8 -> 0 bytes .../inputs/source-to-output.tab.values.at | Bin 11858 -> 0 bytes .../caches-jvm/inputs/source-to-output.tab_i | Bin 32768 -> 0 bytes .../inputs/source-to-output.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/class-fq-name-to-source.tab | Bin 4096 -> 0 bytes .../class-fq-name-to-source.tab.keystream | Bin 4096 -> 0 bytes .../class-fq-name-to-source.tab.keystream.len | Bin 8 -> 0 bytes .../kotlin/class-fq-name-to-source.tab.len | Bin 8 -> 0 bytes .../class-fq-name-to-source.tab.values.at | Bin 5659 -> 0 bytes .../jvm/kotlin/class-fq-name-to-source.tab_i | Bin 32768 -> 0 bytes .../kotlin/class-fq-name-to-source.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/constants.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/constants.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/constants.tab.values.at | Bin 529 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/jvm/kotlin/constants.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/inline-functions.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/inline-functions.tab.keystream | Bin 4096 -> 0 bytes .../kotlin/inline-functions.tab.keystream.len | Bin 8 -> 0 bytes .../jvm/kotlin/inline-functions.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/inline-functions.tab.values.at | Bin 670 -> 0 bytes .../jvm/kotlin/inline-functions.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/inline-functions.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/internal-name-to-source.tab | Bin 4096 -> 0 bytes .../internal-name-to-source.tab.keystream | Bin 4096 -> 0 bytes .../internal-name-to-source.tab.keystream.len | Bin 8 -> 0 bytes .../kotlin/internal-name-to-source.tab.len | Bin 8 -> 0 bytes .../internal-name-to-source.tab.values.at | Bin 7371 -> 0 bytes .../jvm/kotlin/internal-name-to-source.tab_i | Bin 32768 -> 0 bytes .../kotlin/internal-name-to-source.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/package-parts.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/package-parts.tab.keystream | Bin 4096 -> 0 bytes .../kotlin/package-parts.tab.keystream.len | Bin 8 -> 0 bytes .../jvm/kotlin/package-parts.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/package-parts.tab.values.at | Bin 58 -> 0 bytes .../caches-jvm/jvm/kotlin/package-parts.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/package-parts.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab | Bin 4096 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/proto.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab.values.at | Bin 18862 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/jvm/kotlin/proto.tab_i.len | Bin 8 -> 0 bytes .../jvm/kotlin/source-to-classes.tab | Bin 4096 -> 0 bytes .../kotlin/source-to-classes.tab.keystream | Bin 4096 -> 0 bytes .../source-to-classes.tab.keystream.len | Bin 8 -> 0 bytes .../jvm/kotlin/source-to-classes.tab.len | Bin 8 -> 0 bytes .../kotlin/source-to-classes.tab.values.at | Bin 2331 -> 0 bytes .../jvm/kotlin/source-to-classes.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/source-to-classes.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/subtypes.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/subtypes.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/subtypes.tab.values.at | Bin 793 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/jvm/kotlin/subtypes.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/supertypes.tab | Bin 4096 -> 0 bytes .../jvm/kotlin/supertypes.tab.keystream | Bin 4096 -> 0 bytes .../jvm/kotlin/supertypes.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/jvm/kotlin/supertypes.tab.len | Bin 8 -> 0 bytes .../jvm/kotlin/supertypes.tab.values.at | Bin 689 -> 0 bytes .../caches-jvm/jvm/kotlin/supertypes.tab_i | Bin 32768 -> 0 bytes .../jvm/kotlin/supertypes.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/counters.tab | 2 - .../caches-jvm/lookups/file-to-id.tab | Bin 4096 -> 0 bytes .../lookups/file-to-id.tab.keystream | Bin 4096 -> 0 bytes .../lookups/file-to-id.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/file-to-id.tab.len | Bin 8 -> 0 bytes .../lookups/file-to-id.tab.values.at | Bin 163 -> 0 bytes .../caches-jvm/lookups/file-to-id.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/lookups/file-to-id.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab | Bin 4096 -> 0 bytes .../lookups/id-to-file.tab.keystream | Bin 4096 -> 0 bytes .../lookups/id-to-file.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab.len | Bin 8 -> 0 bytes .../lookups/id-to-file.tab.values.at | Bin 3654 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/lookups/id-to-file.tab_i.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/lookups.tab | Bin 16384 -> 0 bytes .../caches-jvm/lookups/lookups.tab.keystream | Bin 12288 -> 0 bytes .../lookups/lookups.tab.keystream.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/lookups.tab.len | Bin 8 -> 0 bytes .../caches-jvm/lookups/lookups.tab.values.at | Bin 12507 -> 0 bytes .../caches-jvm/lookups/lookups.tab_i | Bin 32768 -> 0 bytes .../caches-jvm/lookups/lookups.tab_i.len | Bin 8 -> 0 bytes .../build/kotlin/compileKotlin/last-build.bin | Bin 81 -> 0 bytes .../org/openapitools/client/Application.kt | 20 - .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 494 ------------------ .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 245 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../.openapi-generator/FILES | 1 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 33 -- .../client/infrastructure/DateAdapter.kt | 37 -- .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 35 -- .../infrastructure/LocalDateTimeAdapter.kt | 35 -- .../infrastructure/OffsetDateTimeAdapter.kt | 35 -- .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 23 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/DateAdapter.kt | 37 -- .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 19 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 33 -- .../openapitools/client/models/Category.kt | 30 -- .../org/openapitools/client/models/Order.kt | 55 -- .../org/openapitools/client/models/Pet.kt | 57 -- .../org/openapitools/client/models/Tag.kt | 30 -- .../org/openapitools/client/models/User.kt | 49 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 249 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../.openapi-generator/FILES | 1 - .../client/infrastructure/DateAdapter.kt | 28 - .../client/infrastructure/Serializer.kt | 2 - .../org/openapitools/client/apis/PetApi.kt | 125 ----- .../org/openapitools/client/apis/StoreApi.kt | 63 --- .../org/openapitools/client/apis/UserApi.kt | 114 ---- .../openapitools/client/auth/ApiKeyAuth.kt | 50 -- .../org/openapitools/client/auth/OAuth.kt | 151 ------ .../org/openapitools/client/auth/OAuthFlow.kt | 5 - .../client/auth/OAuthOkHttpClient.kt | 61 --- .../client/infrastructure/ApiClient.kt | 203 ------- .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../infrastructure/CollectionFormats.kt | 56 -- .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/ResponseExt.kt | 16 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../org/openapitools/client/apis/PetApi.kt | 124 ----- .../org/openapitools/client/apis/StoreApi.kt | 62 --- .../org/openapitools/client/apis/UserApi.kt | 113 ---- .../openapitools/client/auth/ApiKeyAuth.kt | 50 -- .../org/openapitools/client/auth/OAuth.kt | 151 ------ .../org/openapitools/client/auth/OAuthFlow.kt | 5 - .../client/auth/OAuthOkHttpClient.kt | 61 --- .../client/infrastructure/ApiClient.kt | 200 ------- .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../infrastructure/CollectionFormats.kt | 56 -- .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/ResponseExt.kt | 16 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 32 -- .../openapitools/client/models/Category.kt | 29 - .../org/openapitools/client/models/Order.kt | 54 -- .../org/openapitools/client/models/Pet.kt | 56 -- .../org/openapitools/client/models/Tag.kt | 29 - .../org/openapitools/client/models/User.kt | 48 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/EnumApi.kt | 89 ---- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 232 -------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../org/openapitools/client/models/PetEnum.kt | 43 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../org/openapitools/client/apis/PetApi.kt | 492 ----------------- .../org/openapitools/client/apis/StoreApi.kt | 253 --------- .../org/openapitools/client/apis/UserApi.kt | 476 ----------------- .../client/infrastructure/ApiAbstractions.kt | 23 - .../client/infrastructure/ApiClient.kt | 251 --------- .../ApiInfrastructureResponse.kt | 43 -- .../infrastructure/ApplicationDelegates.kt | 29 - .../client/infrastructure/ByteArrayAdapter.kt | 12 - .../client/infrastructure/Errors.kt | 18 - .../client/infrastructure/LocalDateAdapter.kt | 19 - .../infrastructure/LocalDateTimeAdapter.kt | 19 - .../infrastructure/OffsetDateTimeAdapter.kt | 19 - .../client/infrastructure/RequestConfig.kt | 17 - .../client/infrastructure/RequestMethod.kt | 8 - .../infrastructure/ResponseExtensions.kt | 24 - .../client/infrastructure/Serializer.kt | 21 - .../client/infrastructure/UUIDAdapter.kt | 13 - .../openapitools/client/models/ApiResponse.kt | 38 -- .../openapitools/client/models/Category.kt | 35 -- .../org/openapitools/client/models/Order.kt | 58 -- .../org/openapitools/client/models/Pet.kt | 60 --- .../org/openapitools/client/models/Tag.kt | 35 -- .../org/openapitools/client/models/User.kt | 54 -- .../client/infrastructure/ApiClient.kt | 3 +- .../infrastructure/ApplicationDelegates.kt | 29 - .../ktor/.openapi-generator-ignore | 22 +- .../org/openapitools/model/InlineObject.kt | 30 -- .../org/openapitools/model/InlineObject1.kt | 31 -- .../.openapi-generator/FILES | 6 +- .../.openapi-generator/VERSION | 2 +- .../build.gradle.kts | 8 +- .../kotlin-springboot-modelMutable/pom.xml | 66 +-- .../settings.gradle | 26 +- .../api/{PetApi.kt => PetApiController.kt} | 24 +- .../org/openapitools/api/PetApiService.kt | 88 +++- .../{StoreApi.kt => StoreApiController.kt} | 12 +- .../org/openapitools/api/StoreApiService.kt | 43 +- .../api/{UserApi.kt => UserApiController.kt} | 24 +- .../org/openapitools/api/UserApiService.kt | 82 ++- .../kotlin/org/openapitools/api/PetApiTest.kt | 156 +++--- .../org/openapitools/api/StoreApiTest.kt | 70 ++- .../org/openapitools/api/UserApiTest.kt | 146 +++--- .../kotlin/org/openapitools/api/PetApiTest.kt | 156 +++--- .../org/openapitools/api/StoreApiTest.kt | 70 ++- .../org/openapitools/api/UserApiTest.kt | 146 +++--- .../kotlin/org/openapitools/api/PetApiTest.kt | 156 +++--- .../org/openapitools/api/StoreApiTest.kt | 70 ++- .../org/openapitools/api/UserApiTest.kt | 146 +++--- .../kotlin/vertx/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin/vertx/pom.xml | 6 +- .../openapitools/server/api/model/Order.kt | 2 +- 515 files changed, 816 insertions(+), 26447 deletions(-) rename bin/configs/{other => }/kotlin-spring-boot-modelMutable.yaml (100%) rename bin/configs/{other => }/kotlin-vertx-vertx.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-coroutines.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-rx.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-jvm-retrofit2-rx2.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-multiplatform.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-spring-boot-reactive.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin-spring-boot.yaml (100%) rename bin/configs/other/{openapi3 => }/kotlin.yaml (100%) delete mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt$defaultMultiValueConverter$1.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion$client$2.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException$Companion.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientException.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerError.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException$Companion.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ServerException.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order$Status.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/User.class delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/build-history.bin delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab_i.len delete mode 100644 samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/last-build.bin delete mode 100644 samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/Application.kt delete mode 100644 samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt delete mode 100644 samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt delete mode 100644 samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt delete mode 100644 samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt delete mode 100644 samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt delete mode 100644 samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt rename samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/{PetApi.kt => PetApiController.kt} (95%) rename samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/{StoreApi.kt => StoreApiController.kt} (94%) rename samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/{UserApi.kt => UserApiController.kt} (92%) diff --git a/bin/configs/other/kotlin-spring-boot-modelMutable.yaml b/bin/configs/kotlin-spring-boot-modelMutable.yaml similarity index 100% rename from bin/configs/other/kotlin-spring-boot-modelMutable.yaml rename to bin/configs/kotlin-spring-boot-modelMutable.yaml diff --git a/bin/configs/other/kotlin-vertx-vertx.yaml b/bin/configs/kotlin-vertx-vertx.yaml similarity index 100% rename from bin/configs/other/kotlin-vertx-vertx.yaml rename to bin/configs/kotlin-vertx-vertx.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-coroutines.yaml b/bin/configs/other/kotlin-jvm-retrofit2-coroutines.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-coroutines.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-coroutines.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx.yaml b/bin/configs/other/kotlin-jvm-retrofit2-rx.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-rx.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml b/bin/configs/other/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-rx2-kotlinx_serialization.yaml diff --git a/bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2.yaml b/bin/configs/other/kotlin-jvm-retrofit2-rx2.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-jvm-retrofit2-rx2.yaml rename to bin/configs/other/kotlin-jvm-retrofit2-rx2.yaml diff --git a/bin/configs/other/openapi3/kotlin-multiplatform.yaml b/bin/configs/other/kotlin-multiplatform.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-multiplatform.yaml rename to bin/configs/other/kotlin-multiplatform.yaml diff --git a/bin/configs/other/openapi3/kotlin-spring-boot-reactive.yaml b/bin/configs/other/kotlin-spring-boot-reactive.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-spring-boot-reactive.yaml rename to bin/configs/other/kotlin-spring-boot-reactive.yaml diff --git a/bin/configs/other/openapi3/kotlin-spring-boot.yaml b/bin/configs/other/kotlin-spring-boot.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin-spring-boot.yaml rename to bin/configs/other/kotlin-spring-boot.yaml diff --git a/bin/configs/other/openapi3/kotlin.yaml b/bin/configs/other/kotlin.yaml similarity index 100% rename from bin/configs/other/openapi3/kotlin.yaml rename to bin/configs/other/kotlin.yaml diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index 3d2135e03c..c8d7a87716 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -493,14 +493,12 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { break; case gson: - supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt")); break; case jackson: - //supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); break; case kotlinx_serialization: @@ -511,7 +509,6 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { supportingFiles.add(new SupportingFile("jvm-common/infrastructure/URLAdapter.kt.mustache", infrastructureFolder, "URLAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/BigIntegerAdapter.kt.mustache", infrastructureFolder, "BigIntegerAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/BigDecimalAdapter.kt.mustache", infrastructureFolder, "BigDecimalAdapter.kt")); - supportingFiles.add(new SupportingFile("jvm-common/infrastructure/DateAdapter.kt.mustache", infrastructureFolder, "DateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/OffsetDateTimeAdapter.kt.mustache", infrastructureFolder, "OffsetDateTimeAdapter.kt")); diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache deleted file mode 100644 index 8756321c4e..0000000000 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/DateAdapter.kt.mustache +++ /dev/null @@ -1,67 +0,0 @@ -package {{packageName}}.infrastructure - -{{#kotlinx_serialization}} -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder -import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor -import kotlinx.serialization.descriptors.PrimitiveKind -import kotlinx.serialization.descriptors.SerialDescriptor -{{/kotlinx_serialization}} -{{#gson}} -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -{{/gson}} -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale -{{#gson}} - -{{#nonPublicApi}}internal {{/nonPublicApi}}class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} -{{/gson}} -{{#kotlinx_serialization}} - -@Serializer(forClass = Date::class) -object DateAdapter : KSerializer { - private val df: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault()) - - override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Date", PrimitiveKind.STRING) - - override fun serialize(encoder: Encoder, value: Date) { - encoder.encodeString(df.format(value)) - } - - override fun deserialize(decoder: Decoder): Date { - return df.parse(decoder.decodeString())!! - } -} -{{/kotlinx_serialization}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache index ca5d3288a2..e3e570e7a0 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache @@ -28,7 +28,6 @@ import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper {{/jackson}} {{#kotlinx_serialization}} -import java.util.Date import java.math.BigDecimal import java.math.BigInteger {{^threetenbp}} @@ -97,7 +96,6 @@ import java.util.concurrent.atomic.AtomicLong val kotlinSerializationAdapters = SerializersModule { contextual(BigDecimal::class, BigDecimalAdapter) contextual(BigInteger::class, BigIntegerAdapter) - contextual(Date::class, DateAdapter) contextual(LocalDate::class, LocalDateAdapter) contextual(LocalDateTime::class, LocalDateTimeAdapter) contextual(OffsetDateTime::class, OffsetDateTimeAdapter) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache index 78c16621cf..39495761e5 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/infrastructure/ApiClient.kt.mustache @@ -47,7 +47,6 @@ import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime {{/threetenbp}} -import java.util.Date import java.util.Locale {{#useCoroutines}} import kotlin.coroutines.resume @@ -419,7 +418,7 @@ import com.squareup.moshi.adapter null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 09194ef927..dc423d8a17 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -229,7 +228,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES index d1f6eddcef..4bfcf9fb54 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/FILES @@ -21,7 +21,6 @@ src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index bcbb1cf862..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.gson.toJson(content, T::class.java).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.gson.toJson(value, T::class.java).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b08192..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac07..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef669718..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66c..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9c..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: OffsetDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): OffsetDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return OffsetDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index b80e0390de..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.OffsetDateTime -import java.util.UUID -import java.util.Date - -object Serializer { - @JvmStatic - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - - @JvmStatic - val gson: Gson by lazy { - gsonBuilder.create() - } -} diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 54df813fce..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @SerializedName("code") - val code: kotlin.Int? = null, - @SerializedName("type") - val type: kotlin.String? = null, - @SerializedName("message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index fdefa74fda..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index 049c89df31..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("petId") - val petId: kotlin.Long? = null, - @SerializedName("quantity") - val quantity: kotlin.Int? = null, - @SerializedName("shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @SerializedName("status") - val status: Order.Status? = null, - @SerializedName("complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "placed") placed("placed"), - @SerializedName(value = "approved") approved("approved"), - @SerializedName(value = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index af29ef2b61..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.google.gson.annotations.SerializedName - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @SerializedName("name") - val name: kotlin.String, - @SerializedName("photoUrls") - val photoUrls: kotlin.collections.List, - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("category") - val category: Category? = null, - @SerializedName("tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @SerializedName("status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "available") available("available"), - @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 28e82b1df6..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 62baf33e92..0000000000 --- a/samples/client/petstore/kotlin-gson/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("username") - val username: kotlin.String? = null, - @SerializedName("firstName") - val firstName: kotlin.String? = null, - @SerializedName("lastName") - val lastName: kotlin.String? = null, - @SerializedName("email") - val email: kotlin.String? = null, - @SerializedName("password") - val password: kotlin.String? = null, - @SerializedName("phone") - val phone: kotlin.String? = null, - /* User Status */ - @SerializedName("userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 5ac6cfd25b..f25dd2bb9f 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.google.gson.reflect.TypeToken @@ -247,7 +246,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac07..0000000000 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 637ca64c24..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.jacksonObjectMapper.writeValueAsString(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.jacksonObjectMapper.readValue(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.jacksonObjectMapper.writeValueAsString(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index fff39c7ac2..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,3 +0,0 @@ -package org.openapitools.client.infrastructure - - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 8b34e629c4..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,18 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.SerializationFeature -import com.fasterxml.jackson.datatype.jdk8.Jdk8Module -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule -import com.fasterxml.jackson.annotation.JsonInclude -import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import java.util.Date - -object Serializer { - @JvmStatic - val jacksonObjectMapper: ObjectMapper = jacksonObjectMapper() - .registerModule(Jdk8Module()) - .registerModule(JavaTimeModule()) - .setSerializationInclusion(JsonInclude.Include.NON_ABSENT) - .configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false) -} diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index c341f8ca32..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @field:JsonProperty("code") - val code: kotlin.Int? = null, - @field:JsonProperty("type") - val type: kotlin.String? = null, - @field:JsonProperty("message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 2ed5390c1f..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index c7df5b5561..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("petId") - val petId: kotlin.Long? = null, - @field:JsonProperty("quantity") - val quantity: kotlin.Int? = null, - @field:JsonProperty("shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @field:JsonProperty("status") - val status: Order.Status? = null, - @field:JsonProperty("complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: PLACED,APPROVED,DELIVERED - */ - - enum class Status(val value: kotlin.String){ - @JsonProperty(value = "placed") PLACED("placed"), - @JsonProperty(value = "approved") APPROVED("approved"), - @JsonProperty(value = "delivered") DELIVERED("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index be5b168e2d..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @field:JsonProperty("name") - val name: kotlin.String, - @field:JsonProperty("photoUrls") - val photoUrls: kotlin.collections.List, - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("category") - val category: Category? = null, - @field:JsonProperty("tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @field:JsonProperty("status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: AVAILABLE,PENDING,SOLD - */ - - enum class Status(val value: kotlin.String){ - @JsonProperty(value = "available") AVAILABLE("available"), - @JsonProperty(value = "pending") PENDING("pending"), - @JsonProperty(value = "sold") SOLD("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 7243f42ed7..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index e8f639e509..0000000000 --- a/samples/client/petstore/kotlin-jackson/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.fasterxml.jackson.annotation.JsonProperty - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @field:JsonProperty("id") - val id: kotlin.Long? = null, - @field:JsonProperty("username") - val username: kotlin.String? = null, - @field:JsonProperty("firstName") - val firstName: kotlin.String? = null, - @field:JsonProperty("lastName") - val lastName: kotlin.String? = null, - @field:JsonProperty("email") - val email: kotlin.String? = null, - @field:JsonProperty("password") - val password: kotlin.String? = null, - @field:JsonProperty("phone") - val phone: kotlin.String? = null, - /* User Status */ - @field:JsonProperty("userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/META-INF/kotlin-petstore-jackson.kotlin_module deleted file mode 100644 index 38c4425da8d5a75423570d04d4b47c016fb8370b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 134 zcmZQzU|?ooU|@t|0WL)@f&8L$z5IgIyu^aclKlLfVj*6~f`XjPC3=~8X+?>}B}JvlC8b5FLV}J3nT|<7equ66Z?SiYkVsH!aRHE->RM5f JnpX@F1pvVZD~A98 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/ApplicationKt.class deleted file mode 100644 index d44eb27f99ac8a125e94cd99b920c3a280cbdb98..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3936 zcmbVP`BNL$9sfKDvtlhSfsN%HRbx_PKrE6mPGn5Wz-)rCe z_iKL!5Xb8b4|6A{@q%IN1ygWtx!OpfV3`?RnB1Nc3K&Dnvc9TomTu>?OAE_JhTi%a z>hij2Gx)ns%`+VBx|*y~rG#VJxpSxHgE)kG6+Q$Q)FHtO!+nw~0Cktt)S4@dyn-N! z<3+)6q$JGb+AK*DB+t8dfQWVmNiJC3Mm z!%>Du?*gB(Ov4r$Im6Xbf;+}Y!BlXJp?=7;O)<bTYZZg=N~>@@ifq?S^CP zmNsrI>P1V8aoZJ6F+v_Xn;(XO`Tv5!L-0jQoymq}1&2YK|y2oO{;(FHA;{CBRTK@pK zbJ=i(nTd|`Ty%Dc3!ZcI!qQr_q%=CiSEFa5L_N^AT*w7*mLXNqX51(^hU-Snyq+`M zzC}m3SFE+Xku`Ns?ciW+P;*UTxZ2~7#YknmU+bsec&z`-+4vc)q(YPgKh6*-$4rJ> z7UdMBo2!jg*E09ckvlBY6_*w%R(ECCZufhkk|aX%|?lUWNg?XjzerZrfZ$ z77SXsA|iOi=62LO62w*p-{+YzG&dZ;|^t)BlD z3X3una%9-mKQfsd8BJ1L^c|a?<~RQTD&%a8)>78A z;j;{(vWjaXu4_16HB|6<%H4?>8C>HGjOf3JFE!u`_%gMI9lFS(Zdyh*fUi`geWX)TcM2|RW7ex~9z$!V*}1suH36cMS8sUTj#B!5u82xaLB>RbS)CV} zYfO>T0%54ueR`qbr+eyV+5ZZDPT(q&%d{c%tS)ro_vKgpR8N_F(4^&C@V1a!8vEFa zT=?jHmb&%v?VAC0`=;t^@zKxm`WAZl`q^Jzs`n`3jO3uBbhlBm-IX&{bXm`=xSU3` zrkY{1Z-tQ6jZvW`2vlJ*D`fqgycve(q-h&7#r%Tdl;4DsJfmClx?@U;@=GIy~hcx`Wp4b#!bYoMv@w0}rj^ol{#lk>0?gp_A+Aq0_!~#FPH>MA}27 zp@BoMV=(OxJ(fz>g%YVvyk{Gu(}@QEaBre6T<53LS8>6I^xx39g(uRXiyN4JBcX;H z!s<3IwPSV@@7qE;-Hs<|75cyiKD31e+GgZ-U<1Y`mOPok#NmWmD|ul*$&FHS_;5HF zZrsN59TXBxiRMI0qBRjpv~9sjhugxTaBH|F+#GJ&Kry+6>m{@|2+&8XJ2Gt@H>WG` zKSA(&OYmp>gLQ;IO89$vH}Sb)+WQ9&-N9F0zylAxhz|c?edue6`Yk+{4%ctso7?#I z8=>cG*lyEB__0CHXW)MuHdF;aQ!uDtl+nMuC)$D5zj&LvY2$vU3N9%~DRf*Sdmil` z85IPF(Wi|kVuy$%DXq*9Hn(`eu`1>)9(2)@`Ce`ciuH zHG2B+M{H3zA4yG*%&NOHP@VEVWYq3dq_Vo8_C#WlJ!E(FlbZ7>K^*ajSNzhlM8=Iu6*e#{F8Xu`+Ehys_bq};@9}iB;C~Su7bI^jXQMY;*g8q IyZFO@0D2Hju>b%7 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi$WhenMappings.class deleted file mode 100644 index 9251a566438420e501ebd3b79975c4d828e8061e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1458 zcmbV~+fLg+5QhIvfCMmYXz3w6AJPInnKQJ|1EpL<0#QLlFSs(v0*1u4Y$sJ8tFBa4 zRmB7Jp{oA&G8d8D8>G?Bx8r=9S$qEc{dEdp1|Jlr{P58B1MNA18~c7MvKuW|d$G-Z zWPjB0YT(vBA8BvX2?EzUj7m@nm1C#t*e%C9w72$;bt5jJs4!Mr_d4yJFK*m8I{SHT zN};e<&wno zc<}r=PrZ)nAWyx)v;45>dQL05Y~8{w+)n@Rj>1UYJMhD{6T3d2TexSO`wGL`y6J}e z*nDE)p{dtcU&|(DJq-QO!edh(XMIP9T^*j)Cr$l{g_60^GYe%yFDwiinzArtXvV^@ zp*ahdp#=*ghL#jYH%|PRU(DXrvD0*7XPJ}M?iM-NDqZ*?3j5g>>6YWEP89mq{H9i@ zZg;%cZR=e(a`#($)${x~yKz*R=F9G*P_9(dch7^WX~$V+zgcFtS!S@Ph2_uJ@g&dk~D7qz}>#B3?C5t4L%|c7@Q!M3_c~6x5R&* zfFV9ne4_Y7@rk{@oq!=eQGBBKMDdBe{&WI{_(buE;uFOu_WH947~&JfCyGxLpV;fq zCt!$A6rU(QQG8;rznFj_K2dz4_(buEz5dGt4DpHL6U8TrPc;5Fjs}MVYh1^fUvV&& U_fV{3C5zX1BfGbCyu&J&e|BPM-v9sr diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/PetApi.class deleted file mode 100644 index c6d591f86366919c06af52f045a62cfb816c5d88..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 82237 zcmeFa31AdO7B^m1-Cfl)B;?{6&H&*E0=Xy2;HrR#D3^jDied->A|Z)6Koq=}74KV7 z#B+`7Evw;j6+F?^)%99k54?5N-Ss|K^Z!+KbM4Hb)K)K=7$HB{DAPdc%@qE-e35tIbu5p7i~r%DldeTnCt zRZ+L1qAntDH?U2$=J<++g>_|>)%7`L)zvi(s($r3(`y>0H&#`Rqr_ZTvuKq~x>GW6 zSxrM#Wp&Q+E0*U}RyS1CRhL!eOsQ_DL*~lzdO=bt>0Q3GqI}uRvbwV66-Y6qUK3Kx z3o~WL!s9E-8^%oy$IOysmVkLlB%NgVNgC+^YU=mKhRUj(sg>2sDi$4FR=;#wS*;+w z&@KB`R#!IcM~N{~=ITQNe$t!tr6f6=OQr2kNnwI4KD^?D#)|rei8a-WE0+i|u+urG zRWvNEStLj%7&mjqtl8+HxH8kKdv)0kg>gw_2pQ@lgGm-B<&k}hKwO&ePlGrp~SzWqG3W=eFbPx(qm+H+iE3|Jd*DxCMlpK5SOSRMU+^zWp(ux zlnfi$mP~f*3ZWXsq{L5xq?D3DVX>Q1RaLR1tZEkIz9M3DK<+aZIu*^Vtk0~hUQt$6 zxoE6SenUymSmh}J+}}_3B?lmDnEvdgbu}x?7FJaVG6C{jR$g9FU!T=jy9nitZ){kq zMoK*;%M$KbZ*CgbNx^c2T8*#+$t20+gU}<@6)Pt+R#q*ls6#iRM_Th-{|NpaOs4qJ zjfYSo(2X<88kQ!Jsj{;Mk!j$Ho*Wt~PHf0=26O$P4T8*oq+n<-2Z!r0g^rBDyrU<^ z6okXb;eIlc%mUluR7#K|Ae?e`MrCGIELn~@AG{nBqm1?%HkTafCv(U=N^CUju*QnI zRg|Q;(&>$fByu#FFI#&I5~8HKRkP%x5S=%-r7vsYD+vEvugnUaRTvs3fwCRCOcAljWE#s#SFK z@X`}*5~(4zGTjNTl)BB!nj~8!2>2(tFsH1lu_B2y%G3>HgjgO(6Ex@?TCpmLtZ}HE0%oDJ6ob7Lf|C7XbXNi+Ix8%hr;*cT2cAJmH!X!n zU}X^GEVO0H^jWjVPoFpmT`@J{NAP$p`JIpamYj{5WT6}Z;7D8fN4j&!xsv*M&h&L~ zMH$9QeG<9A5rzvXNy5l#fIy6yy{fjtCKsbi&~i$KM>b4%K%}I5eR3(eOp43p5Qs1% zCoV0knT*mTSAv~Y71c``mZ}b)l0?>%tGkh_$Ti@8S#51qWw~0pbB?dCskX_r zNLAa2I+VnyLj-f%tJQVndReO*Q1W<8TeVn$ZlZ+P-rxk89S}Az8=ecW+dk_mnznd&78edPPz4&b!dHMU4@)>Z^z8x=5Z?1 zUg|q3>7)BvcF9ES>>}p&yD7=9#@;5gTy1zV7giut-;mi*lUZF;Jx2Z1fNYr#iLs7E z+vHw9xkt|Kbev7@!=zN-xUgPrS|(I1uBofYT2!&Ptg#9_KPHkRPVN{xod_Q3G*cp? zVswm7l|-7!W;ro#p`<9GcF67-D@U%^lx-L(4K-71R#w!3IT+^;$a#D<`IDTW8zlS7 z>N8ts%N`q%Wn{KZ9-?G`+U`v{v9=D&8nyyz+VD1gNo1$9m3tVA0EUFKwUI)J={U}o zz1?k05_yz7Ca2)XDfvx;6uk8^YwpsDYV37tA$ZuV?!pcPlV0QUSt~0W%H^(7{*aYR z2|F6Y>nZYQA9<2IjhVKlZc!z+x=G|Oa$sJyNMTc+@Yrdfkckmhfgbhx+(dMNM{@~NMEO#TU8 zF2_Kv#Qw1%2Sa!H80^N%Z1QhP21ib%CyrUUa^)D60G)|>81HzCZ1Oo~7q`%ZkXv>{ zxc|STWU3zj*c<1RV-~NkXvmSXIs9=`+(jtrCF($D>cDJRuiimx>ZX;|Evu+go3%dV zYd`sld;^)n>Pg7~2~96yCbX_2IPo3%UXuL5*@U-l3=*6}{v#9oL`hzP!wfH&mDnSn zR8c2L3l=gA_e09cmti$>rZPFc#*5UlhXKlM;JR^mfd-l3Tpc)r#`#{hFdpQSJ$cJ zJEz^!x`2`8&Tb&vrg+ERH&$o43{OC0X);8X;^jLfN-~#M*%WWv{lPyhS`C@yjdgX{ zfmE%^^bQ-w+BDsd)fy|-zIAdRQQsgXH6m$EbvS)}<{`6YOwW|>`k7_bi!$Z3qn<#f zCx#zRH}F1>6O{0T7CE@W(xzkG0fGMOP5WR{qXFzpAMhGZ$%OXUpJ)TJ=_pwv zyz>s#yNc;GaxIxqS5_?-4pg#YQFwzv$N1@3xdiwyT%GM==Qp`+`I1ZXWG(Wex2Zav z9I~`f{*D*peG^?=!%Jh->pCs=5tEis5=wCF$Dku<$XWB9Ln};~5qs+y%j7|V^9uxI zU-}zA9Y=AJ)59GZktqa)2n)QYPAsd!k~+AJ1V${WG6^V7pcDOcJUtNWs7q1)A}HQ? zMa78~<&9F7yFM zYqZ=?=TNzzC0Kok*_5brTDQ{#T};Wi1gW^0CY^|PHo0e&#}pK=RVkJAAddxIy-3Md z8=UmC=~%qT(BtVcKdq!lk?6T%6k$PeWG0ql$6U4q?61Y%8%)I;d90JH*sQDf(;A9b zjik!@S&iyUX>ns!5?$el#LDR5=C)W)|ClJc(^ay(lOl#&WC}r7V*T`EcN{bfOZN)8#&RHO2cj$HG!p1$l`&6mwr*z^b$8Z)MW8QD+3s?}Fmh+lOu4 zBDFwMQXFft4!>JYtSYOo$5;=?=yH*{LilIZ1*6kU<{_>IUe=v98YUXo38@M{D>mMthw z4Laa*PdCtw7&6%9xw0c)CL~qNsfoVYIa998h`Hr@dV`-Xp*OaJ(v*eaoamQ1 zdb5xIUcRdp>_ORrHu>qT@~tk{VQ}W6nu>b0tyRym9}&}}Hik%LTK$^$a`K0is4S(33!tXri6q}^U*~Kxv+%Bzm8brfH0Tu2#pY3-&4Oqfx?0Y#N@U4{hb&Fk zP1+-(3huch4(F3liN$VO%uTA|igr&YgS*r?$C}77D$#1oN~c5%Wax79uwqnXt$>X$JcG(!rN=Dn(B zY82~LRIeC}RzIXgw^7CQ^_tn{HIkC-cH60|;xEawZhrCJ7SN%E5wDI(M#7Pw8#QfP~+zi%g#ukwU%lNzv6Wq;j5BWc+%UryjT* zuF+YwKug+79l%c|u-zVXho3GO_d3?^PfYOcVHS&;%samfVQWe6f zNE|H#9K%cIqP{M2GqbF+PB0ToB-*n8^PtT*9@Hc_V{sC*aVSGpGaSmKxJUerwN({z z6VGto!WwF@3y54D^#T)7IUSSj9>vKb$0f03*4@vNSPFn=O}V@V=y18z)2PqE`IRao z4bs275hqnu6^NRF7mqhU8O{xa_W;d>o+A&5-12J1f)8w<U*Z1_|DVdICr>BvJZfRa?!ajsnG7RnRq#f{Zk{twcj zJRD(%$;5BfIJU2!h1hSzdPC$aq;hj7vpY`2nKv;kMM-S2QxmN4Xe!6a7elzjp=Tv*F$$`;AfcS>f&FVsc9 zI^;ft&)pWG7t(PeT`AYIvMOM)WeWCUji~ct6lgPfZlt71FF-j?ZKf>8IhD;Yv5xAX zuOmtm?Bv+(Ely%*O>`bZmgh}YY$jMOm zUZ=4+AeVB39LkYQtA|EU#n}3lWlNS+)Qv^qEAnmjJ3nFM04OK2wFt3u1RLu zZuxd&1|_b#H0*$)r#qj%NJJE=@`7b zIqyj7Z9+%-J=6$Ode-5M)i^t^m{Pr>vc3{zJRPa=VZ~f*Kw2k@`qe+Hrm?QP!kIvN zI1dL_ENooj9d~1Ut0~NJiiyY%Zv?v;!K8pclxzgM%M{0kQjB0~ASIM$1k(d)TggI7wi2A`hcW^gTM6dg^<;?* z;q`O}X$bWQ^a%Adg1rJgw-QWyJIJa~ZzI?z(0ePv!FVVT2*fah&E)*h09mt((l6Ocu3$)eRk+@d zljMMZE7?HF)kK(0#5C5Ebe%eV<5qH`LFPJ-H+L%Y%~6>{{(#>reYL}DJ~#cA^jo%& z+t!m*#q~Qh*OAmMD_+vO!bzPr&3l3*ZzuQ6OW(Aa{P7`hBmI8B?pw&#P?8Z$4kUTM zZ!-l0B5Fc3(Uvz=b;5OSunW?CSpuw8lzOKzsYP|_w^+D!KkBsJ4XTj`-# zG?N3#>6geQfgXnCC)Zsb5YEyIcAO=miCA-Ks5=RO@a*+uz;-%ko(!vhj%lU~H`9t8 zbV(B(A4uLpm#-&7w$mE*V_mCcjVf7R8GGV-(u|1>9BHN}J4{J^0v1?Jq%n}%Oiv4? z2h!y-onZuf$h|_;@+^~04|GR;#oQ(ml>3TidZx2>kwF_C(H#XDXVfw%f z9!Sri>ze8L*yT7=^M&rzJTx#gs;Z%^;IPo}?eyY#f#E%e1+q5N%VgEb0@=bV*ORf^ z>3Y?|lfgb8s;hVuMPf6(T4fo%oo<*%RWsX3dmYk-cz`$4n>Nu~7Btg8sHON?y$)OO z2g8kkD}tK{w*s4+CUUydlG~$}oICYXfbXE|Lt;De&%-W{-ZO6}S$(zaO>7TP8Ep5& z+zh%&{&xRnx<#&8GRp>;B}rx39!~Zrne4&M6nhISZCbGB-iw+T>>5H+8c10Sbn|_J zFhPHoe`J9A8>IeaczY6L^fb5@GM)5@n+ypAnM09y4%`6kjwhsr6q3H3%_azp4;nyZ z6sp|V-9a5CJ6B8E5qx#3sOl(xZGm)kL`BS2EutO_;tsGh~(obLkbZFsdC1(2^ zN?D0hLM!6YBEwtAz)n$8)n604W?13(kQi2cwNt`oO#Y|3@c_!Fs1E46XBBjJBat*) za05ZYJ%GZ!)~=RPi&jSyOWq@5be-ys2vTxPw2&=$aOs z`*ntE9Z@8!F=1rv6_TdyYr>zk7i;N}l!HIL)3uD*yGvR~PE1M^w^&5(P1MlW1GX(C zVkIZH;3kb&odHVFJq_=2+NWgL{%rgyx%2HsdXi_xUZxj&6WmG8wUAzMtF@ssY@2WU z=c{Qcelz!s-d<_uWI=w*HsHN-EqNQ5&?p#~?L&IP^}>2K6mA%<`^Y9^5z4{8x%fAa zlp=0FQb5MzWqLf$62>EZAnYFIz%8crWI1hwTciC`w12Ad>*%TEcQ8Y^jGj(5(lf}D zaL>^*VYPY|&Xs-(>$0`9AN?Ke4{L(Km_vuaT46Xng=WJaO&jT07zfO!=K@4MAL4rf zy%oy)chgJg!*I_)fBx_E3i?mD@934xqSvrVaFgk^a8263Rr#mUKd{T`ZR`qqJFXnM zgWUmt6TOQ)PVa`hU-`RfGuur!vybQ&BLnULy45&@ZZoFS?ZymxzcGv6ZOnncfIeWH zME_)*0sn0JkZ}XuY1~a8Htwf?Ft*c2jHl?M#_RMk<8%7B@dbUtBy^W)!|zU?GKbJV z!~IqH6r+WsRY4TjS_E)N^nJKbl)r+0YOSFEv`(e}vTlR> z8~wNSHvPGymI{edr~ zKk^myKl~KKty$X z7qepD6|BU!5zkF5g~ z5%*}w9I51DBFD^MaQtu?xsX1Kxb8-8+|=_Na`aW9zoG`2D)c-;gN?o{frD! zLSIC>0DGStPhSG%9_%CB9U>|BWUu46>}C2llFoMHYLZtFm%%Q94d|=%?<5)Ht}lH} zmS)zwrKylAO@&lx<_fnov&JpW9PgH99_W^4mbj&v0ZEw=`?DTbgyMTbfnxmS(MROS7`w(lGXPY5X5Z1%G`18^GZ<1884R_`2MvgRlH(5sCLQkjLPm@zrZ>6Zv+w>ihYCnrxVBS^f zYG4QW9@2HUb7AQ7KK+0s+XLw)`XT*@B(ce29sLJ>?MCmm2h)!s8?d0YZ=|2lPjLas zV&CzYp+6-)GTwI~{TC!ckOO_^(SL(7wiskI{fvH21V%+BLSGPp@pB*jl75BtX+QtL z^lSPJj$eoQ%jmbDY?5C7TFmxOV;f=nPodvqd@!lmK!2b=%69|*T3E>ahfuZ=54KE2 zU>?J+ldlaF8`We4(immTQH=9E#`M0ptSzB1I z5K=%pf(0^IzYI2D&=!_y2)c!31*`xM+0cEk13sxNAx4FKM$j*nC7=coUs*RcQDKuzd_=i6p5kF-X=uQdz>Qw^Wu$ zYK6w6>(rjUgUakGFkGed4^*Su$sAUekeNeCfuzKhC6W?XmT;*8If|n!(Osf+5?OM7 zZ>21eESnmoEMWv7gRZK?D1={u`w;GXL^nZQ;s`7XhKmjklByEEP)aBh8Zrcknx_wu zto0$XBlIDp{tOf$0%;CR2wk3g=4G(qQhx(E9p!|fj&ef4jMh#_mO2*>44j;pc0v}E zA+n@)0-G9H+a~s#$VaK2!1jrZ`E@sEa1&kgzf;?xP2}1Co!Umi-cqn*z}`|3EUeLk zX|H2_p2ArAJn4bH-n@lSOxQa`!rt9A?A_giy;A}yaba&qK`qW;cVO>S5&&Tj_C|P~ zjEIK4QzBq*{8%SbL?m-zZ^SCt+ZTe4lZ3t1=uUTG?{o=!Lm5uO-mX4e4A?sr^>tux ztPt^F@1BvccaM0m_prdQsH%pB2S}>~Z3462by#{;R6882f*c;${T-Y1Gd9XLKY>-(1dm}mu_QrF3*t^@a6KdkhX-#Bm%T0K*+(f zVviPgAWNJrVNw__alk+Pf)i*MeRe$X5<}S%C4_S0!5$9C)(JwWJMfIQbAsfR!r1nN z7G|sVAhtauspioLBn#E+oiOv&^rxE|4`ADadbPz(Tzst)#Nu|QgxB^09m5t!;!opN zdy$|9*Y*NM(-vpq&&AgECPfEY>mWdSUo1K4 zEKKK+b6~Z-Ry#>9=5*Uhu1QcWPNh17f!QUtU7{v#WABpN8*OwEHTDkKf;Ds&P8?_B ztbI11;UmaMG6!?=T%c%2lKsg%>>7_Ehazq!nU9pmz#R)WpUi=M^-{PK*#vSbI}mQF z_NQroy7JFr)5&@^joiX!l6%-;)ON?pkQey$T%xGYj8;$G=V+C7poWrh$yI%P>u^Wt=*p0?LtjTzq z-D@IT%yW1Sf?lH62AI%bWAKW(OAI7$uhp`9DW7$sg zB=)d*2K=+xqvj3lar18Wgn2*mZfCp9=h&0xU)fXU^XwV(1NIlV7nR?_UNT$Q%T^M5 z%^JyGw{qbJ*_+l3_Lg-Fd)q2!yR1s~jBK%MGf%Px8!ukTg zeGUIRR%QLbKIBR4BR&Q0Q1%I*%0A^svVZbp*uQuM!qx0EeiHkfpUS@AXR$B&d3e5@ zea)|B-|*YnxBMRV9lwwLz_+s>`QO-o_-pKEYy?_FAA^Wd1{FC56UFRnG1D-`e8UpU z4KC^oAx^^cnTAjN&hU$~jc#JSkt8-6$>J8o-9hGyyGWUMoh%gZkaD03i^R`lv2Bqh z_F%X?a=cwame~ix9Y@L}TEz|`A=*QuRRd^mjaCh$$r`QdPyVIRssQ<%IA~R0;8qS= z)tkJd(W*YU(%3<(dXYOdT9t+?x*fDCo!q3+suXgIMypcUUtwP>ai$*ZMUt#=rk?CZ za*=~vu-}vO70#4uT<@kcZgSHZC%Ea11~;8K-A!j6=B6_Tx#`RyUb_Ey>7cyplxsfY zrF+gzXFaV^nZDMu8kOm1?b4`Bz`9zaGCizoH7e87x>Tbw>DCn*mB|3Y;Gi-+_^le1 zNmC(-%B1t#H7b+A57nqlDwo%I-Pt^AmO^Ec=}zktg~}w+19+7}Wd@NG zMWI4vx{+C8op(7bsK)cBlYVG%8~+WTV(V^3WTh(ZGs~82F42Kn{Q#X*Zq5#;~!(l*X%pTTl>; z80?Go$zZv#UZv62s}i=cfZV`VRa&P81XAs@g#}>~n!!r2wcEn>b1X8IWv3a_+LevZ zU=zE{U84~k&rG+=+_g1=lO`nz4HntK9&&RZ=1n=5x(18;Av_iCD7f>bZQ;eu?9h2nknYY@ zI8EJEz$P{Q-?n4C2lZ2CjNNV{b6UvRju|66tbI5~*%8J_q!5jGXpS;rOgvLeFlP@6 z*5-@x3hoq?qjZwvQTk=3i}9)A&>;SKxpNjg-ckFFOG6z(wnIhXIP#D~bU*@0+8)_L zgjC1F$}nrB2jjHQs}5`Apg6y-I!O$tt48h0ql4ch()S(1H;GV51ik5)PNLvVqLeU3 zI>2rcrG!-;t2$%aBULxi^u@7sl{KUsnK4c7ikXliwFX+xdwkOV3T-% z#$%jE(7|guM=)lOh7F;jTG~n6L0)VSX$sYvR_6elLfbBkG=$m<)EvB~Ex$UA{;0Y+ za7|2VoiQHsOrY8{uv1{o65C#a3Cgqc+Dp{5`BQ6ZooV1?!6r%LC-yUW2-~jJK;YKE zoud3c@Q0C8$pPdvTxM|!IS9W^CZ_|)IURt_8F(8x6M)TGq9ZV*!Gx}-2zxD?x|7K$V*=qDBj~j!?b4Dil(a6NH=U|#< z457uwP&&oP!Xf7{I^7sfXBi{tY@;7N(&$f*hJP$fla4b+(hH1idabb!{j)Ke{@oZ$ z-!^jTS8y!`%xjE7HVAH%QN)UkQnnIql`#%(lJ*Z${yoNI_Ly-nd)%19o-n4e*8s}A zX3SFlSH^7im2reYjH8Tx#?i)5_}RuW#sp)5G1EBCm}5*f<{M?kGGn2!#wa%~F%}t@ z8WqN6#!}-}qY|!0`8$nTW2bR~@r<#;_{dmkddlWA101 zV(xF8Y93&mVa_(rgj=Wl<;FSYa^qZcm2r`InQ^hX0sf7~rRH|ya`Q>!3iDayeaX1e z{Mfk4{KQyqerjyM8T7SqHz_}0+-wDm-&@0s+pGhO+pUA)PdDzgmKb+ijmACJ$;Oq| z>Bha*4aPy%UB(}+`;Ggox8OcB{>Uxke$I_a+;1Gjli{Zt<9NE!%(INmybP|~*v1zb z+j*_=0Bt1 zxZe1?xYu}1G#jsr2NCxuIa@qV&KF;i3+yyab}Wn_(b_YHXWuE0+Qd4&5#Bew9qp|Ds~N#=ok&{^rhWhLnNA}p`AWhJ+&bc zjF?CEMBI+zP-dggv^I;)qP&I)+xKJ?Ok?4^58Lpyz}4_$*B z>n+#d#@gf>+*tR!1~=C2uE7nAjLpH~bOT;D(pG1~)v*HMrsF zp25v3>ricQ^S1S_Hn=$sWVkIuJGaYrK|B95 zcTxUNKs)ogpdDq%gY#|}_2}zcx}Y6>8mqOz)e765kxtw5j0kQ@)0}od8TqTU(P^Is z617XE3)%@^&KDm>`xSEO*9SI*Z@`N>z>1V;M;c>b7U7W+z5}lVDqYY{M|f-(w4=oe z!&l#V*RD*t{PG~Icm_EgPr0p0#RLMnpdEMPpzfq~dDbBk6LA|~LjBnxLAj9XTkaAj z7_&#apq)K{ow}eMwTE6UA_qWQ@gl9Dom&Cv`~mJZ<@bR(Y3EY0l-wD8GCjgsg%t^*a=0V11@V_w+ zHdD+)%mL=1=1?==%r>W*` zpKh+UmYAnljpnJ=$>w6~bn`Up2D7JimwASDzj>zh7TkyC8Qe0@;@s@P{bo;|3_sQM z^K|pKJj-0m%izk*b$pR|4zD%O<&EZfd=0{D%?tP?=7s!9^CG^%yqMpN=R3_y`Tgc) z{1NkVzRSFVKW$#cUohA6f16kHFU<|2k9n=gH8+Y0=5=DSdA*onUMiNFH;M-HCh=SI zW^s=BdvOV#uQ8j%b>^+&dh-wBUh_85Y~C&&MBJm~J{-?)1+=pb(9U*1I}ZTbc@W3= z4*}YF2++>MILLnl(9R=(cDBZWc8=j;{rA=?^DAk z+z!RZQQF+6Cciu;#mDH8GW}-#Fuq&vyOM48bbO$HQb@&eO*l7r=~u% zgOBUT`_%BIIqyC-gyel{xMEG-r-l!V4G46X-{{fzsr8R}pBiq0J3ll~);;n*HLu>% z8mC*E`_!D&-hFE7F?^p|BALVYsmaXv$XmC>?^ElR_C3}r>?t8_I_^# z*(6EEMBk^@DadA^yid&zbq@`Ktpd!;lDzxWlJtFQktm0}ib{TxFjZZ)Hzv{=Cn@?g zeoXXjYPb~7y-h7CvD?&!1_lL&s@v2&YaChE2x}bq7;TO7Yi~>>WbwDB-_@X}_);-WY?mcSijyHKPS*%MFoqN<$NC1Srd(;q~CnKWoQR^OY zj~afglPMySxz;#{RrjdbA#g=H8>0Cht+hC&A=BYR-LgttMFK^I<8duXB$Y zR)%=@sP%}vM=c|R{v6X9Co7N@Rn^e2;PB80b&uMJp2Gvf!uP15h2A}Cvg%Rys71Fn z>K?TY(yDvZ1TLqP_oyvM5V8@it#QhfH4go`BWoOFTpzO4^=i1eE$;Pd_|3as4OuqG zEVy0`(NWi{;kotoYGG@fBc(OYampIU?AR8kZ4zaW(H>lraF)1sI0;jb_xU(hIB~Lc z+6E^MonK^u6PISY@Jb{|6OTf|5Ka389273*eQr1^Z)1DYKCyP7kg(-V`y~EP)yD-w zx@rSqiv}LU);8@kCow>#eHw|vG3`-N2Vikf&#+aCqb1!j9S};u%BEvF@s5w3vF+H{ zbVvn*JRY6!2Z$1(;(-&bM!K@qaX&uPDMB6GiYCF1&eDr(ThmEG@hxjQL#XXps(Tq) zqHT-Yb*@!SBGrjU1U5AX<1fOdW^Yi7u&DVZk<+LQ9oUiQc9a?QC&rWj7wV-KTole=$>~GuqV@8bEv^}Hs zi<>qXALmuJGarzxK#pI;M;Bhg$35GdG;pUZn!sa9Crsf4zAX`o2)eNg~L0g^0#S!yYg4#>iUb#ZDgbQCvvO#AbA1q z@8(0~ALb64V(z4a&4=kQ^AS4Se3b5EK1N5ITWPMjjTXQUn)lKY^KrV^e1bNbPtu#r zr|2g0X}ZCy1$5ojAs-7YnThaXg;utrcRWwNjjD zoha5>tHcG?N#Y8`Z6I%mjpQBiG!s}JoY@{v6fu7rGI?@vCpXTUAN zrF!zJvwcY^P15!-{b`D}hZ#UEZ4c9re4y=N`jCHUdzb)Z-m!=2g;C(x!}KOEXnUBR zaf@2SpM7L^tm~OO0+rtbbwb~xWPY%`gFgBU4?O}ZAf5#pM zvo3M$VQk2WV-F+9!P*{%lT7 zSyS7?;C8cx2pjTtv&=6L!tG}Mwfm%}zyfBU=*!JoVQUHQbZeuqwGPrMY>h)vL1Jr5J!}o{6lxuIZ@R<251-Q|cuyu| z1=g#MKr}8vG@(E=z;Q1|q22$1n?MRKNcwRW;~8d+%YwRF0MPHIBfl=p1Zi7z;Nzp{`NiDbbq$(&yGOSW7KR9=!GHYy+==9+Sst$Ij%LFjZJkEPT9?!L))jP_broH2 zt*5tI*U-DIYw5#q&sZDj->ntuNxG;BU9yHD9*gGv9>& zp7j9`^pC7=)<3K?>p818aPZOAC)OD2Q)`^{PirFlDb~NOW312MzES=P>st$-2eVGK zzPE0J`*nqn)Ndez#qg3FX4O% zd@1LA1sD7j_-An+zl!_efTzO0m#4v{^KCqXzt1y7I`1L+^PVD;_Y#A7su;%oVkG=L z-djxNeZ*||NAbR*p7$50^8w;_+!W{Yf#Oc`w8vl=QPRRgC_fj z&=h|*P4!QLJA!8T=hGhkD!8+#Uupmtvw_<)??z0^y%7`V4g=_;xCyZ@dELDc6Z$RA z$IkkYXWSbxap$FbBj%IdjhNSXH)3w|Zp6G;YXBsZ%iJ3=jozeyK1ZJ-eO2hMbSKGF zq301AZ1g3$^aYr8_QO51CG--YrdqRB0-tN;6lurI|HuY36vhH1j~WG_%Al4R>wo(u{w(rNIPR zmxdcLb=y=(m8L?fH0xfsH0w6EG;6h6nsusMnpN+XX032bv$EaNtkG_1{2y*G$;8Iw={f2ZvcHA{n1B!>E0A7K6P&j z6%V>Mg^Hc-O`&45dsC>`=H3))?{;qrwV!rx3RNL>Q>gu{dsC=gqctPC+qv#dq4q$n z8Ii;$i*@>@(7Wxy`lisa_Ko_c(8a#v^-ZDUeHZGRLJ#zv=iC(P&vtJL_0QLu5yJPp z{sYGAs|0(WGq5ie*O`-m^q&xjjo0~$flSgnAFIc!L z6si%G?082tV(1w#Asq$Ph;OVvF>9WY!K%h=Vg4;Fb=Eu+A9)Ly`e_TR3E>NHIOXm= zZ!>|V<$w@3RhINi(r=OJx3FIF5PZzd;z~SG_^;Cq%wgtG=&Li zVKWH<6yQxHZSHom@4WQ=Hk0uZu?!^zU}`E2O=0PGsI*C)Za#oorsf>6h0JayM}?#r zW5nl>km6WvVd|L}c{W(Rq)})!CF{u&8PYabu*?d%mZjRzw678DC+$n6p=p1Kh^tJa zWk?#D4hRg8hNc50T%IbSbZxi=8?iGbF8&-?+|+WpM#qz-p=qY9d!(VMS8r)(n%oMj zN!O`8LsOMGY-pND=CGlu%p5`?i5r?GCvIr!QuS=i+8CND`#5RS70U)K)Lk|;%Fq;Q z5*LDj^3YenNmYuKaBJbNf-1$kgqUNI#{2$QrZhG6hf+g>VMR&;meQpNK>r|MX=RG; zt}=x*mHTW9x$SE3yt}qT{X>K@MY<7G*jc(`zh|M+`g=&jr3F@~w-M|EX;Bt?u+sAc z3zo-PMh=l7Em)A8&;TPiFfc$`!43%was?$cG$KlCR%8Ww0#D0orCE{gYF5lfeI3n; zp^jz+G*GA?Xnqp(QKZ6%YNMlC(LFKMieZ7lfnid$!W`;i*pih^W{=26saj#O$e1o( z?=i2TYO%SCm3u{Op?Xo(#mc?H%1BiVIRnHnbB;F94zG0mKz$q)>sXfx*&&&)YBkQ&#_S zXN2d;h-fqC)Ce>aN(+AK(FGo5U#I~su;bDU~jqC z*g(nEM3_y)ga)x==A4H5I;t4hm&8-W=oP7o(KDVZ#_+)KsH%oW1V@Ill`2Md&yj%< zVO0#Y&@*$ERgY4|h;D6^DnIK4Hzq_(#Jf1zIib&c#!lhZ02AmjX}YsA;0E2FTuPa<OEGR&OEsIlMGT5DpW;ue+U#wr zTHR)Eku`09Z~VC`H+!9|qjs|=WMlTaQoV^sZO_zi+M(7tm6`Rnf4x@0*}F6yHJrUq zvs+w|?<6OsI!=4l>y!%3)3*O+Pf=fdT|<&Xw`2w4kv1)oN)&r|-5d>+}% zk0g)sqsd?ReDXb?PYFMUrto8F5nn(j^W*5Dyo^re3+Z9_P~_o!E}g@Vr1Rj<=QHTB z0Hx3474#ZF(ogcG^c8+Q-Oa1$7jQrE<;>4(*#Nka`~+6S8(AaVO1={AbnTy^{CoJB z>@j{8dz}B4z0B9LH{rj>&t~88b#NC--$>&Z!Ch>Oz$Z@+hdY&DYOLdz8RzrMjSKjN z#wAE|IsA?M3VbT{N_-CW3S$>vZ@kT~G5(FuqkhfLG=AjQ;_mH@W`BO2na8g;^Z5hA2V|x+*J>2ceU&HS(*Qh(U?=m0ccbT8?yUnlpJ?8iPUh@Z}`I-OTqPRA~ z&o^1a`5&#Z@C*6<)-=8uS5IuQ%J_A-R${BQns2k#@a@+5`~mB7_}B0Ut-JX{aE~c} z7k}K^#h`y!0qPW*l+P~?N9l4_UHV2`+NSa zkMSRU-T8lf8T=<-AO5p16VKU#`0@nx?Jt<`Kw@;J#%-_-cgDcbV|}?hxI4 z4~it;BO=-NXQY2mr1(A)seUTb{9L5_yNeWmZ_&fwPxSQn7rp#rL~nn-=;IF|?f{zO zpFj(tI#A?aL4#1eDfVANOa1F<$bUcFWAr!vr|EwF*WtdRg-R`FDVa<2wOYXFl2*&F>4T3%pRUw$ zdg6PNrzo|YUhH8yMychbvd8EsrIwRsKJ1pJLaHP znt762nz_a;%^d5NX6Cu2@np9&6;h?CkSdL*x}|ZSTblKnTblKzTblKlTbi}YEzMfx zmS(MXOA|-BrKylAO@&lx;%K)tG21Oo40lTt*=}hf)h$hAxTWz&-O~6IZfUqF-%-oy zXP0ZWoc{KFt(Mc*9;?-IdfItfEvJ_~LaXIu*rT*sP7mJ`)^0zq(X* z{vS|}>QdR+YnoA;%G&lS7YFw67Yzj$P+86 zf=D}75#56Q2?Y zwM(m&B2Pzz0PvvnnAMV+D6O&M#K9SdEJ7}xj29vEtx z>grgvBZ$ScuE|)B{=GUGw^HQkXvktEXuCql<)M`#Pe*i+p%aQc?NjT#B2OapWSiQq zVc}g4jR0&Dp%+gZ17$!hC{mFp0cyw-k6vpPV5Nb2W^q(xL9k=`1hfc6GEOPh!=JM=YKq&)%WhMv>>2 zk&Ua!vzN%WR^&;XY|LJ7rN|Rat&{2}b1(txyL95ok-QjYJ?0hn{yKL|%C2u)Kg0Il zgFpPz0`O|@(rm5F)28KnP)|uSQnRHE&8RI``)$WdW~4Gt8&aLSU*}!h|E`+NBb9mf z7R|lZC7N?rui_^>>kmhI6U{P_BZ@|0>RT>{$P+Y|i5bODY z;%Yt#DmGKZ1$-*}Bg8fQ1hIjyf`6*m$ghIh%`M^veup@lZxT21C&W#Bm$;d~B7V=` zg8zYN;y;L6;qH>Y$PjnK-6OKay<#@p>0*;OSNu_2DDD#%iMzyQNOL9p>&5-z0nscT zh5wY;BHk6-#OGqW_*UE~ei9GZ1H@tWDDj}3Cmyor!<8d^y4Yc#A!gcZ@!LB1=ZS;t z3&c+QdhxLR2HbA(nEjS`-2PNNVSg@m+24!DeM~&%>n{H6%Mefd`iN(InRw0?&qA5! zIVkh|70Nu%Lz(AADD%7oWuBLz%<~GAd0vGw&)=cU^BRsj01~E~~9sY|M(5>* zii%LBA~0ig9#RGKJw_K57lC<_(M5`l4x@`ob2X!jBo{TKi%Nr<(M6?Txy$HaE(%qQ z4$9&cqk{$cUc-Y01#ZKGg=nqA=wKll<1ji1=DLgy7L|lE2ElZvhl0fgUdCeZTxSG( z9YzOBz$M+W!IEMx8|tacE6xSaoovNmufyo#yl^#(^So*nLrmOk`Cc`PRqGr^7eit^ zMi&G9-~Wg zrGQ9@E|JA6Mwb+XC9I^-ldux>w{Ag6ktbm#V6MyPl3-ZIN-)|qqe~#AZbpnY&9M@& z*I{%?DY&E=T>{zA*-BAQovk$28wjOfufyolyl^#3^Sx@8LQLFj1zt5vRqGr^mqKDZ zMwb@ldW|*G8)r{k-q^^?L$%$!d3oOGK)f6taze?=larm7H$PnKJjjoiw=i7mJk?^S z5AyQl?BQe&f>u$n*9&=h7?@r+M1H;$Bh?Z4vL;SPTxJ$PmfXArsJ5H8Am1B3c?ICU?uY_88G3mOya5E# z;aV3IhHG7*TC6*wK+Y~+M-&7L!yQq8fgA3K0*H{;5rt|PsE#O9Jk}jii1kEwM4@D{ z+YxHLbULCCq7v?i!h9)Esv`3`WRhVR+8YD-2KC2#4iTu8Q7>D2$l7^9nI` zU1k zyhY(!7pWHOjwq6|kJk}J#d+b5D8fh%cSI3H$m@up8V0H(f^yY%r=}p*8{H8>$zr!7 z)OzZ4L=d79?ua0kcHI#{Srextg24#642I|QykK}zM>s5(a@F)YA{a5V=LIo#U4|4x z!d-?GW9+&eQ4H?ujwr@<#A9YLWXa2mYI}JL!lS7e+}9mZEay=?rY_^$6`>5jjfj#+}9mZD(6tQBTBJr@bW^g zyu8KX(NwBhtUIDq&Ocs9l$I2E9g&|aw>EA^hY^ow#13UP*UkoUMYr*lLun#RtW2^TT3jdlKryk2!>v;}era$*bQe5hk(>vXJqO>m1Yzz$0%DU{_oNeUtUZmiddSbMzKBDoYgY2}NR zPFo}=T^%cD0H^38**YC7H_mR+Mc7m5Btco8lO%}!s~hX}CuUnOwpdR7PFne@q0<)2 zX-3ClE9S<^*6CQeeRPX1#wx0ll*sa&Bqi9lxv}A1EeZE(shsYdv~u&U)0WBsrem@B zaARfbbgbMkxkZ=CckiOoyrFnGFOjV-&6mMa$$J%Bgg03oTO{9Po!An*cIns>`P${g zLQ-WZiUdSeC6Sc#^09q&H+%A9BCle}+0|a?8;Sf?M6Ef(WOsH7rV8Y9Xxy4N^_rN-z+yd)-=ujC{=MpMT zmL@j`I;mSl#L9CCoeRCGa>-)}Hl0zly`mj(J4K;XPZW%MHoX2o)(ePdb3(4*4q@ zD`iB55yTsg7c6mt#UXhXp<)XV)Uh%j=1?~=Ry{B1Q~+HP#GY2hhUA_~{Va1~xp$Ld zqSHZn5}|^{SW9$E8VG?K_QRK==e2o)<2A26VFEQXwuHW$$t-A=TAQP0DHgjWXgsm+}% z5MllL;)F2)C@RH>*F?~_@+iWI2hZeLg!6!~+*7CwGOQ~DW;@3bvJuY4Nwp10(#-8e84&^IjiF3qAWKQZaf;V;^j$$TrhOJTriyUx$*~8O8+2V)7_v~ zmdq^oH7bXEkgqP@gIrtG0}fo(;e>k7hZD{(;D|b%2xpQnH68_w#V`fAsgl27J0SNv zDv`{OYKF7OBML9SJfraPt3wK%Ury}d{Bn1to+L3TU*3aU@6-cYpbje316rUCD%1nI zMIBUVdf=Kmsc?RiDIreSs5m{Njw;lXT!C`+4@f1CD!lk29gphBqY5`33#vn?0ENh- z3ik&{z8CZglbJD1J2~V7ChCZXQvHC2$>R#=7g-TZFV2Hxtvs&?XM)s6Jm`vHl;CAV zS4{@pc$r_GS$J9Gp+&@lTT_`I{h@wA5c8&!Nae>yG@J!{hlmHao-)770eSKzk1jL? zbd5Z^&`;o+JiE|OG9|<-Kj?OiJiJg(A?!lY2=xO}$-@gbUNT+9qiu3U_2RwsC`2A! z{C`cIxo(v)5QT4yXn6x(0I@0xC~2r^p-e}IC@n+}CHqc~cqv{53cha^`${R!8UN$m z44dfbJ=01iQGWoRI~5rJS+s=VhmF-pFld2i5m9qMXqM^ku=-n9ke_=^t9H8$axC!q#qjUYf?7HQXCU1Phf0a!w|x&2v>_9qA* z`SX<7{_MLW(*3mko&lFed82AzX_PmLF>C4@#rRTv0}Zj3Mu8(31dSS0|w(iX2I-L6u`UDRUf= z>X@fSp(9F!Z4ZCW_I6nVux8$?S)#w|kt0y-NPGD6)Z6~Z9h;zcB+x;8Uwda9{LIH8f;B z7hG1gjk5ZBX}H7s1M;`FGP(t;2Afvfh%-Z^u)T^j16-RY|K{MU8`5!ej#~ll%yD~;$8$WH<8qFt Xb3B{l`5beOA9K8zdDnhENUPNjYDM95TSDTHSx=rkr*9qdW z2ogdF^#OP&#O!W;Q7PP18rk2B{g20E|M~mt3_ufG3{9m+o(j42Lt&H}M_w=%TpEx3 z$mizvoWZ8Cb1y@Tb!*#HXToFsS#*pt#gMderc=M83*KngqS#MGlxSQ@n>oLxr2Oqqnd+4N-rD~Q+ma)x__z+y@YqbjX(5_zfG?^nPuo(v3PLF z9V9Mdm%au&WytQTA!n#`r_zWCKNOJ|jQNg~$|N_5+y*rxfH8}`4ra)3mvPk z&p~GOgjP>z^@LVWcv1gy4l=7Jw0c6TC$xIPi~84dkXb#U)e~Ahq16+n`ft=4>IdG_ axK8sMYK+%Mrj3on8faRt)y7+F((n(lApm&* diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/StoreApi.class deleted file mode 100644 index 3240ab8d74c1ebbf3bb557f2407ad758d1922756..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42521 zcmeHw349#Iv3GU%?#ybnx_zw=EMxh$b!#Q94cOSm$oK*q8w0_SrNtJOC83qDfk3#A z1PG9X%bej5Aq0XUGGHJMNw~umAS6H%2v&(}0;Qi3uYW6iOS*z)$qSi7L%Q7%iCh@^&L&EEep3c#M(GwlPxHc zCL<0PNo6zAFS|0A){bSJ&CRm~ z*{$5vy2b!y3)*K>Ye#caOUZF3Y%XbP>4>$r)Hj#ZwQ$4ZO$~9Ias`cS*cfZrw4%Pf zelrBsUKcmCAeCfkEnk0Jtf6CeU-Ao4J{1HhkA{JomSkr~Q*+6Zrj|{y#)IqQ8<*C% z*)&3sHK(bisbhaZYU;GrAsR*DAdRHag0d2&bl$OoD$|tmVX@;oWATpptu4nkZLn#d zA(vbl>)6=ZXj38hTd;7+!c_~=O17XPGqpQ3W`}5BnwUWos7TO=k~nK`iSCY) zlTELj5}?U~GLmkm3d&7rpQDpDO-DzbP~Y4cTYjvd$$j+0wB8*NqM0-+NHeGyif%f- zBeu1}D0=*m4x35^<+R7zn(G^4MUAmz>pPn}1Rax1-;9dh*F!d5HxIRpN&0$<_5_}^8|(aC2G@r zLH@S-_IM07un+N1>&XzwL|fz_96MB=J(mFN7GkWg^z)3`l;EbuR_!68ymUC zm9Y(*;l?1aS$)(o5clh;AxQPqC@28#5ABS#pC~BLRW(n+Lv$={;3jQEM%2`P;>s9W zl$sGqkjHVfDU-$#G&af1;*m|z{6G_IemyJ|ELKV-btWAI+UWR9Y9(aJPuOYqxlO3n z-dG=B22-Og`;j3!fwp8)Cv6qvYthN6W5w8t5S>IPbH1;+s^~VaXd$=Arc)g$tY%9X zqSH9{*XeYZ5ADS@A6jqE%%roJNegm2Bz9tm&T;ae3$dVEv?x6{C+L7aI;OXo8K|qy zr*CjqeG{_`V{Q+Jd$Z|6a9y`-<*Iqh=EIj{ElGL^X?}|?&Y+9v5*UE>tk7tCZ*@k# zZ_{^}`ga|xb8xI4svi&0At;1_(t)m@wd%ySSb(mA@X_+Y-GwLptLYk6jBC;L z2}3Y{V}1Kd_Ngrmum#scoXxS84INN3IPJO+eUEO;q#NiaxUKrOw&tb=Jp(B@F5cP_ zpj(iutrI-dBn!9q)S(Y&;c;~e$6>94U(CvaKKzBf__3g2R$9L94mj{`g zxHUi-e?)ij`;-yXTIOcqX$&xGFs6|^`xN0L?%6MTrTHn+jV{3U2Y=m3JVP>G* z-GWA$zUD5Ok4b5gNxoN5c?;%fg$;V*R=7TfSiGaKqqVT5wPlum)PZ7!4vAvN&jslI zAl=8tTFeg6gD^kw&h>FUb3HJ2EG8HUH~y7mnWuQkTiaS{R_3^@<#ikV}6`49MK#vI;r{}B- zx3;yzOTmL{1L4hFL-d3*AAJ($9z(*Jov~74H23qqG042`m-I9n+h+vrmnH?z{S~d* z7;C{4r45RQ8TWITIKaGhZeF>isiT3X#{8fN6Ek@fhS#s?g$#P0UUVk%O_;BT=+|^( z5R=N6lYEbvcNQ71XVY(k^a{_URVPnPX2MISPI+c03|Wt|Fg35y@3{EyVTv|mM%aXj zNk<8kYx69)|M~#EE@(pXVBb1x%a$#(bOuxhOVQdG!wbhBq5p2R2ch(Vt&JxpIDAXc z5~HD*bd@x~&ctIKC2VhSon7ae$&`1M17~-FkGTvsU4!`{a^k+!LZIuxnH_WELU?S#;Iq6A{x#M3m z=zaP?P+6LagIB*MOx8|{wcGR|OfwXCaec!k*jLA=b~u`nXB_N|+n zOOA80m2ju6Z)#~QNiKkH{xA9{NPnk)2%0g3f;N2&hr6X669qlY=EWV`5~5G|b>m<3 zZ@h9Pm@YP4ICZ~q+ATfHO>J=87Dn=a;F(>~E{!!d)w9{O>Ax|+J;8eEsba;*rrknd z>fVb$BBL!-4@Y6lVq!3O$D;q04FEcDhViUT4y2*(KLFsGee zcD#c%Gbw9pOCo=~aPi9J%L>pZ{5ZEU~w>mMrjQiSJ;~gQfuahtl z266d{Rdvgktqh1sU>A!Ocx@MS;6UO}w*gbcROVa26Y_9u1v@=g4z?L2{kM8)i&s13|>XVSHwD|WhRmC3!LMhMSW1L66*!cO_P17SzXF%uG?w0z)+u^ zCKb2P!mW5c;^`qTeF-e2Ah7DZa8(uf`nP*&Grbj!JZ*YuS>gjykvD z>;=%5Tf|nb7MZ+Jmz={EC&P|nUWNH*NSwkveogQjH(us9&ewW#8qYjuh|`e|{-wSd zYLl{r?l}3`EU`1iS)BFkl;uq4xh?Pto&k5+s3#DDs{69pNw1*I_3=1{d?Llv6B6eO zymJ3b;FY_i-Hhk-TppYpUdxNq)F2~qTYRfWml;O-?y^gQ;$m?r-uRp1X6?Vdy|q0g zzT+qp-sICA#!1C(ad}W&!DQ1dY_J2a+ZI<1D(wNAbahZ{6W3tmU>54?4o}jUDoks- zFH?@?<$_Sl>%{dz5fe8I(4zWe^e6QNO5B(sZsPZ&ian^^7PkaN7r#lBIwCG?Y>mbB z{L0L#3RA{0)&d;XUik#kUUZG7!Ce&b%YKoe>t-F6#Dcr32S6(XCXRLU!a8ZjHSOU}0oUg^ zi-ssMJzch$>6}y|D4y+b$FuPhbvjF_KOFTsjCvK4qPB1G&6xs z5}N6t{)Cnwr3JSh%$Nl`w}nAYb8kj?Qgkg8vyUd_nI<_y*tCg}jW$+KtVOw_Ti@mP zA_EdZmlw@RQV#vLg$&u|ZI*4DCKEIhEPZ3~07)%sRETMBbkHcBA>j6)tMH~`jHu?; zhWh5!_3aDUSYSeuZto^J5!9A;u_X6_V!3YZu59tfl`aGQ&gMY3z@^*7pcA?m=?p+XN*G}>(oEUScIhwEBSfca}> z)P~m^^&G~vP;-(joU!CdDZu4p8?dysKgg>^3s;52CmKx_SYXLDXfl92hk8I@@uaVX z#Ilh1Z>%ATo5XI%_bk9_P)G{)Jr_${SMU9`GH||sK>8d3=ua&UJh2WF_GwcW_diM4 zj2R}r_t4qV;^CY(G2=7h0j4bjm{-aSK}G#J{A5bD%# zCnVNdLPjTA`Gb#u3?oI$4~wh3wqwgN2^_|x0g5%t!f7l_$#GbilKVgzvC4sWxIX3~ zy*n)NzTL~Eg=C?efCXE*FM25H#oW!vD;%G=o!Ix0v!|)*vp7ErFTKXiB*$QyHB!qK}D-elR(`j>PnZQF%s)1G0>v zZLHlb=tHnWUJb{ZCA*VoNl9C*Lw|Wv9N$vE0rsRAeSboEKvo4w(o(?xvJx?g#hW~L z$sGVmJuez#7|P8jD14kH_#bGtT(575Z?TptHX*68OweV!PAd({QBsFprv+thc2EXz zn~R{YMTiH2{D^bqW*}LO+I3pFEENal)nbMl%K?)(i+HnKQOq)H(s23iCuPN( zfKvK+t_=^1iFd;$tgEkLU&K?wrk2>U&duv%?Is0t1IGtzZ)FmL-hv=JN6}%OEm#(b z!TdMHn?S}xn&%}x)54T$Wz&Wh%<|h&&6u7=QgQ}Ywsy8R#CRlQG&na4V(U9Mc&i$i zV;Ksoohp;c1E-VFF8WZFd%(X|<(3?NFRkmQ zSTv|2nJN+r2cuaklFd1qqB$y(8_tR5sYre}?>^crfQ3TZ(SmTneFPVKC2io?DS~#< z*Q3M2!=l4gWJGxQeRKvVofRFaBBR11@1wI(C>#!(LNhsrLebIT(Yt6ybc~9O4QFw& z^SIcI@R)A8U=4Nceij1k+WlRk?R4pyaIl*$i;iQ?uFT(dA6+Mr_l5-Dk5E=Pcpu#? z=qj>(UF1_&QohNZ-*q4TK+ziK_J>0%{KJ&O(O@{})jq?KwY4Vy&ip&?rMs`BTrKq< z8>u6!TUUQscOcrK@a={(#U^E_|fqXM?)%-6%KjNf6mXl>Cv_M zkKapAMKif=&u*ue(3`(0zD+Bi%ESfeJ+zSUc^c762yY>LjN}`L!v@1?PykXA1DBnH8cMWwCO5{H8cNB-MT3|>Fu?^Xm-$_v~H+K9@HaWMG9tWmfvHR zkh@Fgp0J(%b}#*NW;cDhHvcp5xLwF_X1B1rMOGJ04`&t#3<3x(Zzl!T7KpqZBA<2D zxf^EgqWgyT3Gdr2Ms>-#$((k{vgF%tF}6#NPfq#bHf4O5==|To>4YwN@_z@XMO`!@ znbQI>84E4byC`#~n7MX`nDrBF*Hk1YoE6Pw#SLo34d+LPsmSo~uq5*~B0R!as!EO- z^ENU(GCE2{!r|QTD9=(MrcK?9Zc)Y->oH@ivbsfOG_+k*cZ>bPp>8q%K3<-QW`(oz zxAAZm%V9c7-Jy+mkukRY4DT-TuMyE~3WM-rSJJqhV%1uXui<}=>K0$!AsTjxSeKX= z&bn7@x{~(YDK_gIZ9THZb+*x*dcu{|jZp%Lbc>T5q2xY_Z>+nhGo0Hkz8=jFV?f>z zEl`nRZ0A!FQb_C&SLz}&cZzLmg>L2md9Ov@s1>%l#rL+0o7Z)VTeTUz25n#)>PMJ>0RK%@ z2=ft6fMe>S)18*wmSVqdH+Nxcm$)Ko@1)>bcxZ9w+Mm*ltGG8|+QAH5wY{c5+{MrC z*&%kY0pudvxJXDBxj&KZ0nYZ|4)Kt-lSZ-E+yzdQJeVl+7CL-4t)~o|q)jvYHjUGN zgPwGcbG8A%9lZZtVE!-36cnd^ue@=+F=Gr}Zpj zuTf)Jsl7_AuL;8tCAOPJ^uyA&A&4tb6bKY)!_!{__l(+JXy787E|PUvcX=C&X%8`wYRlT_Wmy*NMfxn^E=$;t=01vBdXNvDEjlSmAp~9Ez|;Uq28>_&yM8eg786 z_=kyg{;|03E9(8TMT5UiH2Rl|L;Qz}n7@<$?LR|o@SiU>`tL#5iTH0slmEB$iT`(a z_ByU_(g*&x#c}?BiA`1&LbYhIYDBBGK(twP;&|&&#E%ql>sZlYZ4#YUn>fMRiu=>W zR_lCmqIJ1A$+}vcY+Wx-vAV>m*3ZP(tw+V_)?dUKwojaCj}T|sW5n6^M6uPLBhIxC z7U$V(#rgIz;v4p{xNj8~*l}^8-61Zr&lcaZzacKRFGboFRBm5I)%IglV?Rx`_Ny?4 zf2KM1hqPZH3t=414HVJ5KqbNws+NnP>vOQ>GaKvOKfzn?7-(I-_^Ei9#$rT|6F(C_ zhu3?T=89j4N8sJx!&c8n@pKgZhE|Bj#N!wpuL7xg0%;?lw}+#|<1~!A=v#ryZD26okDV@f1!8- zPcy|%|7+rpkZw>!tz*QS;w@|nYquwhw-L*rrS>7>9n@jd3h2$dpbYm!GsU08pUFn= z7b5l^+0c`F#9zewuycz8KJi!a0bc(n1*VC=fwGTA1Zu>Gh$#vL4ibNd9!SPU#D9s8 zcm^3*1_|yW!K>7;lE_8)d`d3i$t9LD(8)x3;$zxCKDmf!)Q?fkWaL~SmZ<#`I7$zU zMT08h(*p6?%vn)C)_eS6i-8p1^r)pGHUlZvKtM_W$cvAGlmG)MzTQAehKewj63%cI z?2)4>n$7Eu*=C6?X{8YhY#xw;m|1DWQku6YX@HawDl(GSA{j^-#p{n6eVNHI22y~n zFpx4@MaG0fyq0Nzl+k?xDS&`3i;iX9lYtbEZw68_daU;4o7^52q6@p=#tqSQ3MYUR zE(}B}BYhwxBYhynrMk9XAVuR`ncnjrKuVCC`niCVu?(bG(NJ_85E}p~K@Ug?_5q}@ zZZOW4t#P&)NkB?46-b$p0;B{JKuRz@AZ0>$TzEn%kiwiM0V#Z&3Z#6oo01Hqe6cxA z22#G*oE9YkDa>gfKneqqj1h+%%p$`8#2!xI;l#rk)76%$l4Hia0bX%{;T(pBjio}Y zPap-@No6$C04V?u4UiHFhx!Fl9An$h@OFTdEMic`15yxQ!wJbi%G_`$2}r@iHqMch z%>h!voC+Z2#~ARC2m>h&YVH6j9pM}XQu4xi45Tnp$`-#Dkg_zK1%4SwsbbJ20i?`G z0aEe}kdn(lN?!iBK5>+N!~3Ri8l4y^icZov%B0~%;fVJ zUX7#p0Y?Kzk@&d4;3)KC_-hwP*%$Ex5SAhwg>X^Wze`-)EfvI&%_guw`W^gx++g?$ z3SJSlG`<4preAyo&pdnuMYeGf;44T@!B=qK6JPle_;cWu5?am3NdRjA17j-%edW+^ z`~3kc;USdh6IB^%mF2vE(YqO%$syq>{gc^aFl8W;c&qP!&;KGw=8MFOhD!$R<~~3G7#1iMKhRjopd``(N(Ld4 zE=rOX8D<=z2Lfc8gn@|9A_pEw>ER>k5W$%4Z~58*N75t$eg{TIhDv7;SY!{#Y5SLi zKfq#*NK4S#^qJ=M2Z#)jpWbWUE*g?1p?*7!p^(o>1Iy+m_%kTOULs~dkk3gCfW?vc za}kieMa_XfhCr>){sZ<=+EeyJT*l|mA`JM^gBuVU8uIZ`!2ZY}AA5zA1AFW>QaCLs z)y54`Qhf|w7SWLKi7A1=6bx>Lb9ytghonAlyMS|y^KcHrS#pvNqilp6T1jIO#?dN# zPjxsI(Q2APYiKGRf$yeQQG|}9TD%n0($NS<(j0LKEkig)e1~G#)N5J-STXh?A0T#9>7@0pYlrJ`=Zy9MOf7Hf|Ne#P>y5+$KhgYsEg;4m$zY zB5@hM7yJRX%ik^Y#r+7s5cgnBb%%Hh;cxhQ?=$g$+z;UZ@esme z=K8q4ZWT|+3&oT2BJq^`mUsqO$Fm48>FWdH*YW}JvV2s$CSMo7lYheX1MvqH5O1gv z;*Y>Po>2RWH&vN;2+C>Q~~w)$3xndIx3S$0z96apY4{`h3#w8zn7-kiM45EMJ+-_RWz6zSVM=?-*Pg zMV9-kWQBjW9POVcEB*E2aes@9_&a5_|9XTj#D5`c{Evvo{7>N7FL8ZVJmh~~ z*81O+QELLiM7f_;B=@&Uo7UrS|b-&N6Up)BkniLMOLRg*g8|z zS?9^c)&+8j^=-M-x>GK*?v^X8m*t_>2l6mm$d$GwSJ~Nekv&DOwkzZsdx1Q{u9Iu+ zLveqkJjy;s9&N9aU$NWdF?Oe1XP<(!GwDeCY+7gELtnL@qk8-IwBCN78tsoL7RW^? zq>X_o)D);jSWfFS&QVS^^lyW6jHb^F&M^jO|2Q~D7}%SGbBw^bQVz~B68N2ia}1-$ z49+o}erj-z0$_Iz&XG-*8Jr`B&Nnzmh%PWVN0z(~tL2Py=2K@Y$g{qG(Lh5>sp=z%>L zM=(CpbN2`@sq^-POb6;fjwXY4c#B@%sv!1>c%TPjW>pYtg;5vfFrbJ2+8PK4gC5u_ z;(;EBG3YTSj7>8$qGMHLTsWJ-5wnztRm(nhk7P3Fu@Cc}40?EcGw6}oV`VPiKJO~Z)r-cnl0c78D(EpQ1@yqmqiuGNgwg{&CWgm{C#HfP z%xMzn!MCZP#}~UP$)Lv*bI8O+iQA( z9?QZx;Mdtb0-uloJyLg%3`^cUQcxga11{*jd!#5_l)`FsQe<*;ibg%A44)jHlt4Yu zLJ##|)>BZA)Yhh;9)sl7sE5t_Gk|*Jc&Nuc@Z&D%!MjKHN8m3QjzqXHZ1)5`@-*ln zLxX`HD0oFQph1to0H6n+d7uZ1Y~vyTJ&>FNdf>i)(BlXOJ&w_PN_@RmetGROWk*Tx zEPC0zKiGr!lcZgwPuzodlcY_7H?cT-N%|==B;I&i z0UQ87(cs7U0h;9yKnB#-W7!u9t-HGS4wC+4G$=QT{UZaD_`k)EyLaSEZqWT^1={I$ zO6(aKSU7{DAcN~~Ixxs!RMN#k(xU@$3<89tN2kBlaA#~gJ4FVPZ}R8pJ;x`*GKqa6 z=}^J28W;;nt5JHCd#J;pdqjrBm<#2mq9M)>ks%W5e}BkO2=%$1jtzp&?vQjS^``(SZL^k2i#YECouKon(k#j(ip^)pd7rh-J$!#3s zVt*1W(vzQ|;vxZGAmB^d5z>RJAz>^IEeAl@JA5%MXR|~PzJ{`U#@!3jgT&APjp{(4 z8Yaly>aureeeR|$vSla<9XSc;$jLxPPR405U&HphuTdeL0%YV=nu4EPslsosRMY7+ z4`~O{nN){gTB)P65zeF~@~dC z`6u54^3T2p<$Jz|>4%6UZ5u1hpQ>}k!q^F9`~Enbh}l}u-nv3 z`*bzSK1UVX7a{FCbf$e7ooD}?&bMEuZ`dEuH|@{p!hnx10y1(@pp-5FGID8P5yCnG zK4W%)1PwYeR%97;WE@Vra?p`6^rk^a@Y@mw9SLK{hl7rcpqC9gG7>wQoLwNp=|+Q& z(<0vYZ9kwHgBVV{Sy z3#7n*wn0aR`A;_JNS^;xgO21|H=11_1=hu87f7y-F*=e5?8Mmxl5bU*T_8FBkIXKR zZ2uc(7f6;|Zgzo$#16l+3nWuS%r209sKx982~wTe1rneoW*0~X`rkoEV08^T5`dmO zq0teW4l?M7MTLR68XfUdUSPRKM|?m>j?w4{jynUs;qC(YD)#W?_u2)LijNe?Va_Iy z2?3xcQ;33B%qWn|CvyEpZko{j5t zL>m#}2xr5_{RH0%e}cneDv}Q)N*qNs^QUs`l{5+`W6j(p$9e~1$?;vZyN?66uI~T9 zEu0r;mR3F3%v*v^>=0UPb_ntLY}h2^><}8wnA!O7Sa%&dS{P0wISbO!3E}*3A-0Ri ziF~Zlc5|#zPPd%Ai{9^|!~Vxk`BHyNmRy&5J^7Y#8ud(a%9o-|_W-r=UGlqMN^Vb% zo}17mj`~t^dm_1_BwUS;7wiL9V_f>nQ`uZx?f>1WZ2jPBU#L^r^!Oq8>g*6+qAj~TqmDntCoA8+Ch_zQoGIY<{gHDkEchA+tJg@c>5oL&zO_y25Dh>I|doVN{cHvLM+_$@O=(f39LL_N?fTJ z^i;)k8mRqq`k48U8FXhOec|SNKnz+78Kx35XDbe|wS6M59)6xKYyEbqi=lsBLMo84 z6@N)M`re|Lgr$F8lDwAY@0*Kyw^vt1zJx1CPrRQSpeX%u^y@lJ?AFl_u;RME8XfEB36S{wha0kNebdV~c zBM>&Ka%xqT2y@JJKXct*Upv(PbiUe;E>m;qdNq%pM0j2uNUvjmpRE?)48w&uzwjWj zk6MH?3=hWng>%GIwI9wdoFj@=CC)6Y6UV5pFEZQop87$Msxws=8jCrtZMqJ!+%6 zU!9>IS7)kM)LH6p>TLC)I!EnR=lX1QjxS4{@0*~$fpD?DM%5+0sJhfQUwzxxg0M|} z$9J>(uJ8NmGT&{;a|iO?h3oz5a^DN;3g4@^zM-!2eX6eZXQ*rZIqEF`aCNPJy1LFk zLtXE$RX6zO;kroO=s!x`gm9a_cBmitJJjv|Q`8Urw<5f#?(qL!-Rb|M`jP)lrvF*~dtx5ud`?0wYF?S0il_9R@3)syzY>M45#uB+A4 zz}KI(Pf^d=XR3Sc^VReA_tgfwTfJaEs9v<+MfgCy5Xe$51+vw#fqbgd2| z_3OY)^>UyIVUv0#(5zk!Y*nuXPEo%LoQ?QJ>JNdd)a!xk)Ej}D)E@)4D@h-!c}f4>Ojlzh|sbZ)LQpk21cd z{*iH^`e(+a>f?;7aDSuvB%@3HJL6XMX~uo(KN%0H&oUlC+Ea9U#?y3H#(!vgFidv` zr_epYD(Vi-p&h{^5H`~N!B*NC{5rzrbQgaYpjH9R_j#v7+V1I)*gxr>4*5Ipbja7e z(;=VnPKSKnJ00>#?{vs(%y$7fI0@1{9rD}eyMQe0q%@~Ps*zM7r{na+(K z*i6JGsL@m^XW?|iF{*%SWHIuE6orf z$8>GhpWNE4H{9B+d)(S^0Hcwl^#ivy>khXztKO~6YIJL}|6;zE7=bWsrbK zp^YDe!_VCzk!ia>iIzLocj}d77s$vGCSUE4$B&ob@B$I^>alP}0J9c0#qoWI#@qwb z`S+(}Ef?csxt8N!DG!n>@Pm2Ju3S2AMKI|%=7NW`b~HD&1gEbobYlkvXB3tdCgR#8^t7ON;PbBk4!qsb0ONt7^Q4S60=!4X><5YaKyXR--YF zperF$Sc}nS3f4lrj-YGHAtfW|TIhyb41Bu9D!qYF3-LOFu4Sv{ z7OV2utc9Am#UdV?wYqhVpljJeI3**|+L{Va(6tzPo}gigaaUP85hjs!0yH`1r9lHt z8pedl$EMuLR|^%_Wh>aK=(GwR08Sdz!lYH2varV$5#-d*E4db3rV^qtY3K-(2GwxV zs@S6Gd{w2WS(mNi!R4f}9yn=`j!COBWl>)h?7#Co!nNo!kqVc`2u#08gM^%X)jY6u zzUng6tZ7%XjyY)+F1>1QiIWyFWl>)>%%D@IhHKH!YbsqHYhVFQTCJN_%lfVJ)xwQ9 zWoubsoiz9elg2G^(%6wPU#PDZ)}XAawrpZ0x{aBvE!R=bt5YlCkW6YNJ0vGH0_$l~ zBWyjL)EW$RlUjqJK7Ci(3?MwljD10lYI#U20b!GrM%H^O2ZaHTLpv&V3)Imi1u zamV{RapU~CK8Ti`e=W1gzMmtQLa^(1(lADK8m0#DSSHQQSBk`HlL)`)JcTvaB_JYp z`fh1h882GtM609h^mQt#gj@2;LF3)bFgzy8K3_+xqwMoJ8fBNS(@-0`d^amxz85w8 zpcEwPl!BgmrC>|ltnm0=)Z>vozD})xU2u7fAa2TGV#WU6p@%$B0Ji#Cw%XtGjpOfi zas}cTPOX2)6{+wj(5j8Owawh|t%?{tWL7eTkOOFS+j#o!r zpU-{EK0i^I?XoGrUOy2x%s~Ggzt8ou-}j2LQwgoAZb$3LMLx&RL=mMWcHCJ=GDOy19YU$jX2Nwyg1sV|4k7R~ zz%9V@fJEFd1JUc502hezOdwH|J(;EhGCXH-z(m{>D5#TyA>%}#btd9iFc?5% znRzOpA5}m{OvEY0W)j|$#~JLCGx%VCTtkJfa2`QDbcCk>CgP0RC{F;K6lj4Hfiz6S zDTPY3^JkU9h%}mpL5PMsY3%$>%uUnIU#Ds3@5H=eTg}ejNn_`4Vx}zW)6Spe2sJd~ zh30u`%Ff?;%FbWMwDUJH(`)E%S3_&r`8!Y9`8zRo{v1Pn?ED?!!}Xhpkqf(hEe`GU zHK*F=J27_onws|bCZ-)eeoKk)^Cm(@$uDOgMXFBD(SJA-&%HaKPR^C{kSY&63fmCm ve7WE#%8QGS;^J3vSr(@|;$+3iuOr!U@v)BF5tmk6mU3Jc#Ko4lT=;(gidq1Q diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/apis/UserApi$WhenMappings.class deleted file mode 100644 index 2a3170461c2fea1aea6bc83150f91ee5384f6289..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1459 zcmbV~+fEZv6o&uZ0xd9TQ9RW1p$d2!%2`1Wk&7k}5>UM0YG^kw(9TR|rZqm6V`7Xk zJb({n{5zX<(PX?KS=sB`Yx?c3J+uD&{dERl8Xpv@et2a2f%crhjeWlv+4ZKYz1ZeH zvOh&STnpUF=VR?{IYHohM^OPvp>*PO9J}dwNA~u?iLS>5 zkIg3*9-DfF_4RaQHp0*kEj%^#an^Tr*wNv6ebUsQStytry|7R;^vc4Zp(zVPhNdkH z8=AFX8Jf2+VrWrebo11Y`Nixl9Xkytc9uA4txlekt-1?8MD8HnqPyjIs#Ar&b-$q% z$~$c@c3XPSjogE#Uh_OZPH!BQs(jgf6pE#C_uccLa<}6&v)?qc+cdM+G_%t*v(GfM z%WfN`A}--F6y5{5k+cou)K6SH`#tm>HIDaJV) z(^AQ@iesvaYig_ON^0w>OS4dZq6VRuUI&^AFK$cf7E=A*1ZtSqR zob7XL@rvTC^5TjmS#v6C>Z+V}f9JFB#MMQL?H-42`$(!)8nw02Q-aal!8R&hl|Wv%XCP1f|v+Ua%W9S6o^<7q3TV7U?b?l1eS!ETqrPUS1l0FY|K!LMAKw?P1_!Xu_=AY;L*eA&@k)AhH=)pa@o?_+N#{FgYfU1>T<c`fSWinzYxgg%DFqD9x(pq*YqwHZHp>Y!i{)|_X%VPm z`9Momadk~8XM+SYen&SrKRb;*>b0yu5TtarrC|erdw;0O4mW@;chT ztfqfi#fswcvc;oaHlDMt&9$c~aNjT+$M!?jIQ-d5t1FKyUQ}MH*#02s;*yfmnwreI zs>Nt;LS5}ry;N#ATbA_11{`W^8!5}9YQ4lJvB`wv127{MrN`}GS6055I9xBxNK>4f zm%!gaY)Tl@cra%Q(>SxZc4-QmN|V)(O#@a8cc?8rzBbF7g_=WZ6`KJ{!P;I93|H4` zCK^YMnXDrwHcJSHvctk`CYuGcwa_WW=72bh7cZvH%qm^79IPL>9M#+e?Pg%}*x_L| zm(AzQ#lQ}&E3ID1S(;Cs!J0^6N3bJlv`3*JTB=?-s}v(@To746)k5~m4y+F=Zp4i6 zO0g2uEdysPuB`;ZyESTLipd9nQg%!SwwNv9EIrQ6{P&8LVGfoS*GvblHUC?X!j`e} z4(wRA9E_(zXE$D6hU2ENN>)YXe&tiCKfKJzG$O@-Kf=P?;_|xE6jn#2YuO6FA9_pE z{m>+Rd_nXX+K!|o_^H9M6i z@HEak7%H5DtwFIfFqSFPXU(24ed1(H#ngnC!0}n^><~MXodZs?h*khFvMc?g+_~&L zf_}coz78ra##*UKVHbMD@N3Reu(E1F5TjAZB96$3ON*;#(SB4>0_JfA&{YfnCXd3+xwHRh5^O=&d{J z*qX`;mtBogRdwh?VKaS5K<@5(buIfH_3ApbJOOO0s@7#UaK>DA6VO^*T{`(!b;V%g zt!(Um3n0;Yb_;Fnw{kXmT3JmE_WS;cnCrh(qjq%v*-MG#*7UE&=*y~0iS6D7&f(Yb zIA54Puk{cxSl>u?b*FcxM|TO04D< zPVT!s#-y-^*(1b)w{tc=NeIDynK^H1X$8(YRUkZ^Rv*I&1Wd1P`K;s0YD?%?NiQlm_7N#)(5#%=k@J@)m&ECZkVHW`Lf{MN0gdG@?jSo2h zkHHqO55w#O_7R%*fi^n;#XbQG^1j6449%bhhaiLBIOuqD3GmS1U)g72_9^=taJd`{ zwG8LS+AJ*H<)d&KD|Xr6IUA73N{=6P+;PW^(giS?;KTUJTkNubg1h*Q9)Q|35%Kx| zlC!C1{o`z$RRS(vQ(Buv+#K=PDgGwZ=qqZH$2!0bYxI|BW%ab;>Sg+4lD=%d4zsV= zH=rr(o}BHM6nlvyp=lq1iGQH$ z5eC=A=lF;=R8-u?q2;)09JVx5no#2rW9!?p&u6*fZkRhfgs;H(=ti6FdYycC_03Hi z7+T_;28OvDAKBxYn=BvUNsuh>2$JRa`tIC_GMAUT9G~00fj?|owf#%#s;hAVDPP$? zkT#5Vd3qSTHFm6V)pU-isU=EHC|X$&FJIID;8`=K_ot8j{>2rG`xD#IPXN;u%MbDm ze9%LV5@%?Miz`lTCf8pOn7{742bda<;ABcWeB;lIU5oePy{UK~{ecI@oWlEg0Q#q} zYrWJ!fU2sjsZHUTUdCW>=@~O;Pnj`&mdp1+cOiYicQ|MJ?+*RR4qzA`PCddm?;vxk zm|jVH$^O;F6|`}nlckH}2Mj(c%tzA}5W;fxj*D$SF+7`kk<<8?YRb`)<$3fT zAI9U7-CW~aW24V?UJzmyFXSwilw>Pkl?)mfsEth!+b1< zD5s0RG7?KD4iZ-QPMug>jxBY-E)Qj+Vmb;aCGehXXg>(C`h| z=u^o1U? zQdTpoPRo>zsVh(6D?E}ouJLm7M@;M=jG_}?N$s7Gu-p<$D832|6z33}hEw>-)VY)R zDfr}rz+ve`O)#g@Id~Pv_qKzLrMMjQ(nu)gf4l%yXYezr=vj?q1m1ha@#!6cfPJyv zpgAjOj#(#s5SJI%)L^a0b4)ua{9Jw>?bPSvcu{Q@a&mhecDD=hIhrKt7*s2MQIokc z9cg~9E(!CC`EMY9D626d{Oan;>J)yNM@5$>zkU;{D}H5|uO+a_E`Fl|ptco<)Swk? z?{-L6hxt|f8Y~%{@_gE%j|qYbo|^2ZoyT&iB6!R1_;q2vgkQg#BWH1fR;TgT9KSKd zZ=#R2+&ySq@%k{og+A-Xco^=#xU#fHpR3Gis(+*P3&Dif^BR!PdXP^`wG#MkqdK=^ z`2%xAqAC3Mtcqq5Qi&7;r_x*Bic{ed|3S`O($w`SJL6fL#q4Ph4M zn>=aNG@r?Ap>=!}zXz>&gwWr#axZ27G0ak^N=FY(<%`D3- z&ZO_6$;Bm0N5wb)YVVYpiI1hsZ2dpM;8Oq>r$-Xb0_ZMq4WVJ1$Rx=_rh)4h?UK+1 zU+@U&dMAWB)LR zF+%3(R#4;D3`jFRg-ws!0lBm^g+8rkdx%?v&KOyyKf*BO`48O!Ec)z{x{o2HnIU-$ z#f*uxL{+p{Ag1$qjebhs1q?uh{k~B7w1g7+n~zA>e325P)nLNrn5Q2cTCR<&8iFR+ zOFfOBF5vnz=r2FhFxGc@Wl3@Q+~VrV#JX@SN_KV=b~Ln>bhU)N4AoNo)_vUKyD!-e zw0Ncj+zcOX87c5Ey-*6bU7_pM1Gp}Yz#ZhBo55onWglv^PmMA?vaksK;4LigURmwZ3DwobE2mUw<-@R{MC*@ri^T?Tls}61~iZ4+!Qg$ zLvp5f8X^quzj8W|%UMw~LvQ)?nLy209P+@)vs1)SZ%T$W-*{e%7~wTO(mSwCf`l?f zjHUzI#UhKdgOWlBme=S+8>P`D+Q4YE*P+ogB3EQ%D=V*DQdU8aaVfW+ofhY?nfby| zs0yD+$3bV|3dn-o+Dfl_iYUMl5L5)Yj=_Fb!W?ByjL#RohXtfJPC3Yb2EME_6Y<=b zRP-r}mdV%@F;0vRi?IS?oDLp+>+!e((wpYiPkxHn-^1=i)JQma;FBitSV0H@m(C2Z zgOs<~Xtt~wW+u=VMuEz@S`U9IK@X7Sii4W(LNrAj>~-M~)c1@sy!x@kA^Z4Gf=_De zFFA7#XlsT?Tael`H~NAUahTWiEKCxanve~HE9Q`01~4|MnGUpBcL2=_?ccGitg6!5 z8dw~Zj;=Ybc*&B|>d{b5tjKZ2{4f)2Kj;_)Ody1SU?G5gtm8A59o#9^#*>rdq$B2)Uiat0TO6=(u^58b?jBPc zwDG23|OujuZ5aQC3kpy>9uU(rS}~<6Qz}o6K+^ zS;pp{d01TqF8y$1<<(_)R@hG$jQRhN{Kh#$o1JxnTHRJSA$ ziD6qe5axQ#B-Dq2mH>^?e;uIBx0%DFSjJfYFOb@YvG7?V(mQWvT}MolQEMyfK7SMI zwT<T0;V~tn?nX8yq8eCU1B=by&YXId zHg78%H$VLso7jYHY~uZ~P((%S&FsKPsDT|4u^ZTQ>t1`lOwF3Jnayrs3u0jz?I5Em zk#MY|jCP_DN5?wLXlkT$EKNq!BWYXMBF?rjNd96Ok&G=2LbAHnMq_&N%jCGgM9+B=_7=&lBNF-t^jieMR#d=11Zey!ry=1g^q$5>>+zc6! zUJdN@d8~ft4j`?5=Vgp-WNYR{!VT<#SRd-yMd_DpVV4V(y)xeK?W|)YyoFuG**d1I zdS=PBEZvk&zh(=&Ub1=Kb^52J0y5 zx7AY7-^Yu3W19ac>$sKOH9vjhCiaK>fsORLp_<#ww!~6ov|}VCc)yk2H?aHWr*GTL z9*T9Ku|2wxJ-x7j?HIjY6P!H*5o}PHLKunU5`+~9=P)K70yp}RF}r9hdmcph=SZIh z_EJQ}I>!2f0NBU}*eh#UkB#ijk=xiS8`*o24h`(%2KIS9sJ%n_KQP>Nz<7uBFZ95# z+RDC~&n>=*{Y#ULjHZEd(q%LQ)%(P{$Y@uPM>iSm9_f}qNj)Mx3{f0RDMLvhl~_+1 z?G@=6>n)@GBE5aei1km%(loXzHXxE7=^q);z`i4r*=UHRa|8Qv8+)yu%|aKi(On#f zv25nn$OayspTSdrv|v=cb3Gd#>5#$Gbjh@>%teumO}q;&9`C7}d5R5;^octi9sB730vK&;;k8DTX9-(eXJsXgSx(q&) zH}H}5tix75dj2M!b-&&lWwdjoV=R?8Tv&6sNV?%~35=~9u{pg(=26Npw(gPcu^uuS ziKG&@GrJv99xH3$xx~UAGc2rQ1CPd1Hu9ndzHcO@fluDTaqfmu}-r>iL97$IX2CS~hSi zuhcKAn-r_l#d=ci@oQNF7#lFsz)$p$lKLpzH0oJhB(;IBj-^M^X`9ZF(JpjWXtX_3 zvFVXc=&zbr&!Tj$XyB)Ndlwt|LrM5R3fQ|)HT{|fem2+#ICvyIgRg1e7vPlRvF2a< zta(smP@}HKGNXfIL$>mZ=SPNg9URHr#4n|;vxPLmE7r2nTlrc&!V`hM5W1^z)Cj~T zzD`#exs_ivpX*`nrtGyS8*?H~1HWM-zj1zH`2SiH}TE1XHk`_ zs7i{ivNc}pPgLx_O&n(nY;A_H=WRewq$p>sb1f_03H#lUVnXpB>5ui%fBp2o0$(tS zjhu$ClTBw`S}cYFip}LHJQtyl3CA+FljX6VZLOvl43ujDWF-QCAnr^v6FRd3oO2dPSwGGrc>zaYdi6k_mi>S38dAIccLe-kVN|W zFXO!(>)tAE$GT<<|4;Lnt~;?)B*&?+;qSWe=oIk$PBuJA7${8q{CR{Xd>D(IvDi*F zEh$I>XUk~-(%j}pkmyyiJlKQPa<4pC@Z?Qm1N2})w9@SOJV=?zL&7Lpg2jgHWPRHN zNq7IG=6i-6eh-0R$JZw%9LDHBJ&pTuXNsPHo_p3o|1^>ab0^%Clb!)I9*lMsQ7uN@ z7+A+W0>;6-<+D ze#+TBBn&%*y>SP`Cn!E)FHmWz;w zki#ZHzCRb?7=A2U&dU*MO7x6;=2YCYjqdX1qIlMt$$2ZG6 z`4)LM|DD{*?~zaNt@3q#uly(fll+3;XEA=ivX#)7EaFzm3Ra2FN}4`k!Q!`S%nWP~|vzwnW4 zLbx2^3|1g2uoh?It^~ol@@@P9){EOL9n}30>kYX>AO0|Z1pD>tushh!AI0h9EnIW) z7~b|^PqUf)asC8W?+#q@@FeoO!6|kQYCOTZu-{_UZRbz1&g>fa+Ea~Gb}_pIYvvh< zA1-CT=FcLplkAS$Ja(W)Pn~)WJ?O7f&m%QJ_GDxDpHZ%t%wUE5FDMrgAFyNj3xM23 ze2n`A2y$2PI>co!@|Re;cnjATyo|gIaS8myUg58@j#zg+`D@ggRpYm&Q@S;s(ydu5 z{MM{Wzcp)u-*Z8g3EBw~%VSZ~^d!{w#6TdZ`(yi%~Zq513Z_W9@Z_U}{x8~gAx90rbZ_U}@ zx8^MNTf+)8t*L*2HeSbk^iW^IpY07`H=;gc1NH28SNE~mdiK-R1ME;eM;XxIABow2 zlclPAaG%CosFCKr#g_56G1KYpQ|x3tTb*_49sVv$b)Use5%1}8mGBjMALTl^W8e(% z0soM7bo=s+{3HG`OA!aEHT)C2?ZEGJ2k=ip8}PDoujhZ|pW%{%V?xJ*Lx09XY(nVQ z{Bux*Vv|DW^S=W!ju>nt{|EmkQ&<)Kk@|uute-#fFZoy4pMDWOh=0w$f%tWBxS0P7 zkS*3NTm^3b6pj&Y_+w&w>}t_l%25Jh)Vf!Gc~?(Psn4LA4_i zX@U#!Q%oZ=gw<{v(QX@|Z6{i{jj*SK=6utL5l9|`P=|0fOd}q|2Jiz+BMK9>f$i%1 zq}BKBrV;-=vy*ny2yKVdZW{4FYV6c*8qsbVK?VnV$uvT!|GlOW^E}fCd>iAhRnv%O zi)o49ZcQWFQmtjvh_*l>y9{F*(Q>u6n?|$@>!+DU><%tOeXW^B?C%K{cLPOh5_SV8 zZW_@l5Kmm(MD0c2KBV4mWEznqsN_u}k_6at-x5qCl7j^qAchwFXT}I=ZQL}XRX{Dz z9!oHdXcbI5-bo#~ckmvVMzmwSjRq;LB5XI*-j4Ogsy1V0_Fv{Panp!a=MD>O*Ur$Y ziGje!}{h&BS-Rps5t zG$Ki8Elz1*8u1eWHDemFmmnsZM*KvOfgMAF0mt3~nP3{x29V9pZrn7Y38XeE_!CVd zc7^oQOe6LRyadyTy#~+N4D1T8Ek-4QX~eEza6gegbn9bEs}?0qO(XUiyuC8aCZ-XG zLUD8$l&gn9tvU;)5wl<#F&m~4bFjP3g;~Tr7)Bhgkq8UeWD#Za z5SEA{Rw2eBOf>N%6HnH0jhM{N5tG!-WCUQM;yX?h^f4{n8y2v z>3pD=!3T+nd>=814@W#ojOAHkCO=9X%FD$pzD~^Mw~D#^E^#=22;mtqpT7p5@y`*y z6-Nn26pI584iY5@%S~LN4Tqdf-<>FW3Mo}$pN4!zgitVBf;Y1z3C02>I#7W{~ zak9)n*iW1y4;HKCbaASjAx@ODM4g z@(FRSd|jL;|0&LwUx*7VCN8vG#GS-N);Oh ztru5Yx1r3PD7z8yR&kB>qPW(26Y=}vI_n2q#8u5mkE|$C9M1>nc+*_2uG~!K|M!W^nh__%G z@h(gw-h*kx`!J380HzV|!8GC{m_~dI(}+)C8u2MiBR+y@#Ah&#_!~?kK8I<<-(ec@ zPnbr00n>;tVH)u@Oe4O5X~e%^8u4$KMtlp?h|gde@f}PfzK3bV4=|1R5vCE}h3X{> z-6nbHb}2%Ck}~w5v_elHZwFfd)$T%=M*I?{5ydc#SOn9E#ZUp4!Ze~3rV&e_1TKSV zL>WvY76zsfGBAyB0@H}^1Jj5%0@H}MnQt2LOkf)ETwogUL|__mRbU!%ZD1O4Nnjdr zS-WXOyJ^H;GmSV%onuTR?sEGZ(}*nhI%68KBvfWhBlZtnXiOs}ht5mNG-BWIfqP;a zA>7tXBf>w`G$N(lG@{)!qTMtC7fH0=8u9<^jU4T!5$&cC|MU02w3|k>n?~$S(}>RP zrV;I?5fI@uxi!OR)P3d4Zf=ceBElmR72jPAV0UBEKyPa_+3reQxf z^Q(5#2<4esfNQs#M!gm2|Y;m9%K0EB~N4#GGSkJs^P`3rHG+*e!u7LReUU`$qa=3Dy$aEy+}$|crV zxzw5@%dAR-tK_lP&2pKwUY1+8q0F5qyAknLx!ihDR#`DlHAk z7RVb_jl5Z%D(ltR@dOorV;1DG~#@i zMqB{XhznpEaS==-E{18u#W0OHyWKRR{niN9<$w9D5&sKKBT})U=^xaHjKg&nxLDbp zJ0e4*;}}$O!NPMJUvk-$5bK=)w z{QL$ppq{V%-_qAX_3Y{YEq!fQb+@a!_ok|Q@c%|tcZZwVoSm%Hy9I!)vRl6cpqWBi zzQ0>Fck-25_Ww^FMuPW$OO@L0``;3zpXT}BGSuBFr9I{Lex7o>MHrs`YPTM_!@VC0 zXaz)Tik-}%J@6A6am8;d;C9m^Qv3eg`qbVdNNQU#l8CF)TABN19A|OLG=?B?KjT)Q zB<*FqTR3g71VCLirWOLS+CQ$;w&jxEly+LQT&s@NLNk8U*aX^dj(#iH}OvbXu0Y* z{585}eeVEF@FY$eV6!tC_aklu=O=g(H-*zCA7b^btG-RVUVSe>OHh;TC1^%_)D&7^ z<3}5huXd+3uq)=le9Xn_O@XvYq2-QrU0h%kzde30LE8%h^!#jb;7@Oq5- zdfbT#9&E$krVO=IiXOm-W>?Fj4HEcq8!iclwCVyomU z2=AEqT@$~j<5T5(>~i@oyFq@y?vNj{ml58QAF3& zZ21n)m+$gI#AD?vd^|2oUMBy}Pry~lx5zK}CixY=PkzInLwH^Oi+>{j!@rmR5lVh1 zy2zbkHo{zsBXlrvijL2>I>O_&lepgMEN;MWKX0-!5F$F>Vf7R{tX|@EtH1b{H9+jN z`b*myB>P%}mX~4H3eaYj;B~N@pPy) z$C_(ZS@W#p5ua?$x2~{`ux_%Bv~EM)4c1ZCcI#;CQEQ>~n6=1y-6}yS)A85VvDVkt zGMigfc5mxfb|&KCR*gN;s>pVYpwI08?6hRTdZF@cUl)YPg)l{&sx86zOpV=Db{7GuXVW^WL=>~ zSm&xq)><{wTBnMw->PG*t5gM^kF%~(CtBC4Ro3s+1=e-y66<=k4tc+0>(%w_PPK#G zrCwwk)cb6s`hxvYear54yCMu`o86IYi#rZsHoKFQPhuP^;%R|jZWrG#mxlwt+`k5X zxt|AqxvvL)xo-u2xi1HPx$6VJ+&col+}{O$xi|QJx#DTo*<3chgQb|u#;;))n#;zo zW9NC7jmvd@IeE2TPA>Dy$qK)mb%0;an&OwUy8Gp|7vdgUjJ%t`$GR}Zu?^YYHs^%|7vdgT>olr=T84>Zs#ihYHpp|0g zn0<3KH|WH_ntPfXGXAGSa4EQVHFtM+Uvo8g$ere2&F#+hujY2=iZomk-pbY7L&QGJ zqF*hK;D;d@DOt+fqGTD~u4HNd5%WFz5%YE>i}^YBb|s7d3-o(-^K-kBrTtf^_x`U? z|M>I&6>2dmP_q0HVnb3``@cf{3#6waEI_z`elYst1~CRd#@)%&H|LPPc^m(+{{QbE zr@jmQ)4xsKVLhAMu6lt))7;w!yl7#f+~pUk8-0o=xZ4Q6^^uNBxJ0U4i8r~e8`l_6E)eHF+wMCII z7utoyOI#ZfZCm|{+*H?1-D~O>58Cdu6K(nB-8i(ppqX(VGJ5isk%&*$+g8a64 zC%FN%y)eK775|Zb(blM6o`B5oNvL0*g!<(v><3Rl{qi)_FV8^z@+{OZJD`4f4(gYu zp?>)@)GmKPcmd(hY?gHcD@CZYZf2{jTM+It@dgub)bXj-Ms~Tif!$#Jk=2;#q+HVyb$qN>lQxV`V(Jf-N#R`w((o6 z2lyuIA^bM%Bm6mp*RAdR6YFvQz4f?I))S(O^^BN}FxT3F@T!Sl)A9M%>rlVE0rkt9 zP`|tbwadE*AM1FB^$FB3pF;iecc@?f0rkt@p?>)S>X)yee)$^em)D_w`3CBje?k57 zZ>V3sh5F?`+DqsR>qmI{SWv(GD6h6{1V`Qq&!LCy6!{e5=j~4NuXd{Z7M?^qt$$m# zoo@BCGpt^A7pu43-5O)}KfiZbRJ- z_DE~HJ<5929&J5lXIrn^=$&1tuWn^b9-OAx4oa8iFmlZzdg~OWFKlzw&&R+ z?W61ipniGHKG#0TzSy2(-;3}N((l*@L;dn9)Gx0={qic*FFWkd?L!=9Pj$v4>}$_( z_OoX?Q|&{YL+!(y`A9FaXFC=49H+*f>l|;-b5`SdjXmGF*k0gVYaij z7Q!<2a=ZG)`ahw5!TkH`mx&4LmnY0GqfT@C1?rar0`<$BK>bn@s9(wh^-FoP>X%>P z(-68N`e9VjA63O423G@2BV4@nIWR&_A*^Y?X9f){7tME)Lt=LMjaVd z5j*C}Xei>sIc7wIDB3Lc-NLSyY#!xAM<(WMWNYT3xP^*|aJI63^EV3UawbG9yjC$c zq9X1lHazAG*RVITF%h?cUqZyI(Eo>2o zN`EP5u`ZD=TUZ5WYuOS?RdcqD)yBF;y2iT6X!i)jo%*WBm9ZW&8j1AS!cIV?o{^rW z(nw07Qmj`5Xj&EPEu(!Rov7L=1Zh>IcLO_p9)4tR2j-%Fr?0=k4SN^F`cls>O21?a zyIi2`mGORWXXyMEb`@vqn6m1bCD*caQ#$<`gK%B>#x_;Hu~Fq%2e^Uwt*`QM?aWKR zIsN9%^c$V28tbHA1~@bg%Gf#c7oZcWq@o|`rY_t_|0rftfP!}igXO# zH~FE}6dLNI8`;wf8`zG~>w!5)?lSO??*N z)+yEx1ORn@i4)Vy5(JrGB{bW+ouhGQ^Ze(w6=GLeN z9-g1UQ#P}QHbRq-(!f4$@H7c289YswOxwy_6v@DmfvDAc>Smr|gChMRgBp0x`naDA z^)UM!QA2Ca}5gk?w|L(0mnkhyWO^d=Mv|7 zj4{p1J2miVtm8&r)WG+pA8?$!g&zXO*D2B|{SsQ%{7|rvG5!)qI@2)S7M6KE`GCYa zvj_msUd#Gy<#Xp#TK{uY17Ea>dww$eMLKQf%h$4jTY05^S>2>q-8R0Yo<}J6__geA zEPP<3fuHChCGAoCJa|2;jifd3)v=672C>>MGTN2+eIpi2#im6%qrYliJoXkjOqn^eFM~B4r*~%}TAK9ntkjUUo z{8H*UTSx=EVl5lJm9NzUJQ3Inp|=`EjX-ST>vWZoTlrP4Zzkp#L6xhhN{X(sHD2sbRP4S@{C>?t4Y>yzoRq<&!CA+`B)QTS^1H|>Ntiei zz7ZpLvgxdA%jL8@vn3arUTv<|tQXCmHJ{^qh+u@f3{Q8vO};e!S{ch8yVJA|7z1cc ztuwLJ!L}}sC!IzA)<)@(3rg)OY{o*+Xl<-WX?1uW#FhuBe{AyS*|VQ3#(u8-(#|$X z5=1lF43EI*h4!~e5>PTOH%Wm?*6XGXz-TDDE+niX8YHwfJh^4<^{h1oQ1bmk+bsd} z+;7?hidf2Sf8B4-pta(Jv&TT2@x$rXhH233%nW!Ha9oo1J6$=Zt9{R2%g~ zbK-iUW=Gp*RndX23nc?Q!a^{y!=Jtw&C z37W;ry$x{hj1;~*t4MhyNwn69eZ^AQ*9hO}xF6z?>|glq`8O0q-{Kblzrip6eT`rJ z`wv|5|HGEx`rT#hdse}IV83ENvKsh0orJv8IA>>afglk$JIAhO>k!u4b!>xu9KtCk zUTxx2b=+W|%AT}WvzP7D*}L``ydy#v`%FH_K8sJW&*n$i=kSI08vaZBTwZFQ$B(g3 z;m6vm`EtZn_Hn%0KA->2zJT9p|C+yHU&KGNFX3O>mkI|V&Av?ZwXYP}2;=OvVv2pW zSc7n$eJ#SRCSI@Ohwas87u%1@o9)MBz5Ten#ePcOYd?+fXC1#_|3$uFzaZbS zUzOk6uUVG;sui~1um;(0S=sj6R)PJfH69)`he3ri%YM(A4K>bE`y+(E>G)K5(wu7l z-MYa3%DTn=+PVvIgZ(e-S^Hb-4f{XVd#L+~{hjrr{k^r*{=tU$+V0|T1f}Cqj%$x{ zLUxhU2`Zk>Q0sJpDksf8(aEsaI9=>t+uzxjIbH3$?e+G9PIvopr-%I&!go%0CxZWb z+P6A=?e)$8#F_TB&Jd@kQ|R<^>JW}|`Z~uu{hTwL{>~a_fO9d@>zqN(%}%Csn={zC z3#B*X`2lCB^SCq2dC3{>yzY!}-gZVgA339ybh4Ckveif@M@@8c)f^{JEpYPHB4?;N z(J4@8JB8{>r$}Ax#MDiA{=G9!ZFI(~KRCZo4?Fv+$DRGubI5xMoAN8%ab2$5Ozyfl zJml`jJGck(6t@JShIe*P;HmDp2-o8mC&{m80UL*l9QP5E`BS*$aU{zW2k?hjh#z2l zeR}gL#@DA0-xu}`5A#P@FW%qy`t;y~jIU1w-a#|@0F#_iy0fb&N7%e`kDsdfHzZ zU!NZKcH`@lVLxtseY)898(*I^`$6ODlkR-Pj^%H|GbY3N3p+{sF{SDh`TC?eFF~8| z9%dokIgbC5zmIaAokD&s|A2qUIypo52L2KMn03V3ovM9(Qn2dZ*S<{zfaCBIpfEy;6h@IqgcL?SWwci$g+!4?Vbrr(g;9tUM!l);i3+2j-=r`KHIZhf zo6>>KM_2ZhI9JA!sT@}rQRP@D5=vfS6iQxU1m(d=P&ZI>$91E#t6-FtfFzR3wMjZl$Q3`ahEh&t&zP?in%iL2K zb%ZuIL1BdSe9A~v7)^+zBq)sVvYJXH6!R2DJt-FoqXsN|V1yJ#8Y!JUg;8CkGbxPH zB59;B@(l-eQ5a3vdTde{MPt|-;tHdYjTA=dMq!jj3Zt|PzNT4?(ZI;SMqP~!ie|B>y5NPjYr!^W7JAntueAAw$>O;4KzkqV}noh`Pm20`3Msc zRzN%0nrg@<)ey`;pc-;^qZ-1yKsAIaS5XzHhLGJzHH7D;s-bxs&=b$QX9QiWHl4W; z+wGz@X`~g(Xs(3T0JNkJinO6dvznl`HkqTHZgv@l?qr*^KhU1+iVY2BkM%yg1Bs9C zmK7qNXn5johL)VJhkjtJdDNKtc#pQ4+?xbC(c^Bc<=M?(v_Nz>!!i1upG$8@chcUM zxX{|0Z^pFlrqyX~U2D@Sh-CCNtpG_@QH_}uIYq)kc> z^?|ECFj|zo0?N~$>@`pwno?*Ru|ztPW;)X*ZAlN;?E${E6Ed>B2I{AdtI_RdjQ7J~ zsXyz4(3uZly%F#OJZu2uzL`9e?ZXGNp?nC-MqZQ;#T`+@5QZZRW#gO)Y&ycx&Lmdq z9Dp$0#4}7hQ^&_TGubK540gVA7`xn=#U4O-%$dzza^|ofoVmQSGmmFDhx0BDEZdv~ zyr(mr_jP9Q0f;l51Nac<2tM06l9xC~^NXE@{C7?4Ob8eM)IqT(S#P>P3%a@$r%MYA8#fXn}w&O0b$8a~;GfGp6EPbPjTM2%bb<=3g<)nBhpR6?guvgbFLE zIx9Rvut zJ;<}v4n9V`$#c{PJlEw2X*}xo;05kbg#Gv^tp&+ph0yPH<=Y^)?g{N)I)4!I_g?Hv zqw$EqZEQcjoj;02|B}&obZ3tkjYk*un9+E2We*sQM+W@Y%!XLG;y!dJfw?rjpiXmTwpX09pzbmIl0C!C+GR)r8OQ78;5(&{*Jj+>I0+kaNHh7y+TCG1gX<>Rja}SfY`Sj8_l3c4#_+`mH3(;d zTDL(C2CB8A&HKWPdVsyMmi2%;%cyPamB5LGeO}L-bCbC$;pb$UxXF-LnCEBUiG(2r z4!o+M+%nSRgDGXC$8ej9^^(!vkzS-`=^yFii;!aj60$s5a%^BEBQhW|uz`I?P6!)~ z6GCbO`*9n4t)9(-6#2j8nj^nVL|wgnKk<?xqi&B-m#7x|zwAdfAvr&)p5#@e)nd*1QPm~qM>Re0qlz~6qiU=c^Zlr_S}da_ zwb;+gk!to{Q;Wg<>A&kS6<3R;X0YO&YJ_${?hxSRpGS|LP z|F;-YBe%y^nJx|yyDm;TSu}EbY!ys0YV;(zZL;e0Hi4r7AvD^jg5OhX%TR-LQW@ogM%i<6w_3Ylc*T7o6r&_(z&>iNCYK_6%ncgUaERm%-+#h@~>USItWb>lm%BR>dA z!YNSuPhoxe!E6M=D1Hdk{Zm;UpT;Kf>FfYL18UGip!PhJ9nKF!n1ygCJ3^(hqflozU_ECT1a+!CL!D;NLwuAv z19wrLiEy5d&sFE!=i-ja->3`i`w;%Ber7u)|qnIF}e4p-+nVReZ!SpCKs zg*aDT=1f&rI1AvK_)B$)bBtQ+oT%10tJH6ubJbPOC5W$7*EqMUYY}eJ@gwSH=Mh!! zJfm)LzE!uVA?jAB_SdUCb(_jpH>o0ZE!6xssmbbg^-FaJRQtE93U#MCTWwI6sg3Hl zYOT6X{XspT4pPskyVVP-!DR?a;YZ8VCU=NB&>gN0az`N^qsF^AYO^~@ZE;UUI9=WA zo}vEaUZn1GFH`rsS0jD1dcfVN9&|UUhunMB!|ua)ep+pJUr>*_@2SV!kJaPuXX;7! zOZ8N!vwAv|p`HyDsvV)3>bcM&^?YcF`g5pKZ4aHJUI<;PUJTu&UJ9*OFNZebd8>Lg zbiaBnv`xJpdQQC&dQrU@dJ}o?^Fu=)^10zId|tRGKRi5?&kslW5#jOt$nboGGQKce z#eW%Ijc_HOOXdmkX#A=|Byh;=9XMpB8}kG*RPf9bdcb9QJbw%d?+AO}cgSQP`3{-v z?Z6>(W8jc^ci@nDOW=@sTi}p6g5~lZaCqz`DfJu-BnIfz^GFSpquCh#XSCK^?!yZC zUr?^6_!iEMFTkC&tN5NR(S7MA{=sVXPq<}>FWIm3Pq=jvH}gK)^|6zQXXm&R-(!+qPBZKUdyc2srWGiDpa8&=TXQdU)u3XpQHn8XoUEs)nn4N7c}W#%x2eIpN91QFT;! zxp7qO8(w7`RXc~z^Bq;g>wHJm@H*d7HM|anZQt+Ws7iODHgQhntOwiIb53Ow805=T)r@_(tu zzd{@eO7fvg#s-fD;bholfD$C1DOKQt1D{8Xn)giSD7wR&H)S`S||AiCd1zM<0F&#h!hn@ ziNY~RM=7@uWwUkJF?h%iXXh3mJ1?73$VMs}&I8nu*_18_=M`!Qc{xSle5!`r+?;Se z!7V_Ns!{3OSYBREykcH{P%*zCs2Cj+RE(kSIh^}y%~x|^MZ;|;M`OMdObu(3xFjvvC)FU zpc?w=w^sz5n`%I>hvpWV96l55VYY} zLqAQmqA|fjC<1ytL>FbpyIGVSbh8L#;#bQFx>=-0=OMZX6cZr2C@(uebP<+bfaoI7 zgpcSVO~-`jB8^55(M3f>$Asu2!lFSm7z+_PVH!yw-KS|h5seV8QHzoQL&-Rq;US>2 z>@k>jGZ3T$N<*6J625X#8+^gX9Ug#xkGQkPfMSE%Sb7HQ*<*lg5AE4wihwkOcRU0O z13eB_2GYUO$i@Te5;s9Iq1V~j@m^z8LA%+x@m^=^5qlGmolUI6YdQ*8d4<6gWM^Yl z26KQ`@`6b~E5s{k7P50Rj=gEX1Ccq+1CqdvKM^@&Xd&o{$N_!CCn6`CXh=^)4)w&F zh@8AQ8D{6i8FF?`oFixF#91=ZRM$*IP6Aub&cVX;Cn5(F?N3AwmZm=uIl#V|h@2we z&!31K(2`#_7v1*j=4J;=2aVF&(G!tNoY1eEn-i=a;67MBXeL-cNK>!PMC1}{2__;p zKR-SZxmdOFiO2;B`Kuv2S1$rR5qTQNW+L*inV5;lBNY1+p*Kr!BJw~g@rlUGA%fBq zkw-o8CL%9CfiCmn3_Ck7&ash>(ofH!t4nd_7__5&6V=f{DnF z=ENr=A1gUN5&0mYU?QS=8R&_K(w1$`G}%#XHfAECgkpap^k(W!L=>bFpNJ^-bu$rB z>WMcI(fkCujK&#yb~Mh>k&e?PZJEJDL=)J0b`)#ZM@SSD?jxiCYuBHM0$|@vL;=ns z0Wu3fOMcw~bUUb<6JJdQz`mJ?0^*_mL=@mi5Yz=-1$Fb|y)MurHWN`m{3n=*f@o2E zA`0l-;_t)R1t6hdA`0~~&=XNeTe?3Hh1iVDL=+N={fW?be0E-0T?M7zs}1e!q9nngjz3;z688HEHsm+CztBx(fLW2 z%cosKm&*t9)p;0hKCK+@J+v;%p$xx@}lE)CA)(kBAt5(($x zfMts0QF~sIJW#)%8_Xek8PBDi(3GWPwbw{K@mw!ApBRA2rO}yOIyC!D=i^9WibSbB zuSgVUS3ftHPB7abw}5!RSC&3AOxXhBGA0)%F+Z0^XL9NE=r>(}P1F=Ar1rcbg*dkP zx$#*ojL&KjaXYUp9lTB1B3fT27iSMYmqurD>Ad7OT}0pA`9;}-@L^s+qb|y!WFg^R z=jP)p*5u~XSFD#?fKM)yTR@*&UM|R!TG1eo)%1p)s)Yp^=$I#qutMs z(z-MG^o{A~7t;DL`SeLNd~#g2GO2V?-IDO|Jrl4%QUT;-`|=4&Yw?86^rRCePqWNy z&??C$ygcudA94;)GNCi+tYs3KxdXH(m!M44HgXA_^jLVdkxS?To>)RBsUDb%U(Y)P z>w0tsCTNgnU`i>er4m6c?{uJx`dtJpl1i9bm`|@3rZA}GeeO{$Bb3ldEJjm{gc3UG z$t1jbo=Cz=dm;%hZ6p%Z9z;JRktm{Wl0bqIB-fx5t(S+5obpIsfp0#Y2R`DJ15j{k zok^!BlYp>;Y5+wF%k(Vrpkt9Org41K!2lc>3{leJxf~400pf-v_E#)F% z@~AcJ_kK~oi^#>I(7C7ujOtn>hR}JaMf}0kA~8ge4Eji72%Vc7BPoPeFN&SV)PuB# zgb-dn%Fvp|$wcE;3nA#i6GG^06roMj%cYG@=aT3FOUmS8(RpP7oAxH1?F%8YVzJBI1>4(=Z(%QA9j#Is;^T!U!6KcXHBW1AICZ z_*IF&n>5KIymUd#6G%{15=eNt=(1*vesS6ag0$Z?R5cfSVCtbiIIDy$IuJ($h@GBbUzt1 zM3w1OqifIueYnIQFgE>AKyOTaUo_#p0Xnp7B3_9;X#xmXh;ayXq@p*dL8l#ENY^Ja z@~hw+o%rDQ6g|K(!>>;wiglAR6@EVUQ&S#|kf6eU0kRL0L1R=IJld;4 z58%@A2P{+X0Rtmph4(-m0dMgh2(=`wh*tv1Cp?&rVTojuz(T*Fq@S zXfabmq6_^L%O=r<_X4Fzbm8X{(sc#&jkePuKPZnzNOa-9puSKAwN2gbp21e2h z?};9WU;?nTl=TA!MtiUKKpg>Z@*Xq zt3eMSnD_&hviAVQ&_?Y&P)ERaB;-hVFdd^+Lt+m7hLV0h)h9Veyh<;eArXNX(&gNXkJ8Ithay>9~g@v3CZ< zG1#1!Ny4FDk$}TX_{ZxgD9X!0k4?hBA=!q`A<+gU(1@07(8&fTKy%C#h+YY-pB?ZGze}8x;uNPh$3hWIQ)vqr}PA6d=h)kPP7F zgWmmIoWgaInkLDHW+~vE)Sk!2NV4H4>EvN@LGdO@l8qo~7#28EoU0e$_~sX&(HZuL z!>3MC(zbb$AhajsQ_Spl7Mg8-hF(> z87+1e(`6&Y5VbHPse!4<(aaVLk6?0&_@(|U7K{9+k||=bC`GO~<_KIqA(n`xN3gCn z{JR?dYK@pv!)~f!`_?dA5ragh8vcEaz!eoY)d*1|!ZjkbMx@n{hvrT;CxA+S* zCSo)(#7BRW@yxa;3Tk3ZcF*<8IcLu0%hwN|0L;D-sJiHzO_(wqPq9G(p;gk!Q0&RxLS7~);C1MhEhF~lY&YXqGrPu8+Hh2abm7-2}4t1C~6)zV!O3$%9~ z@R7aUSQdsix#5(>X|-dtvdoeksr5*ORbvcnlT6JyhMC>%{><)n#>sUV$-CRR-R)s# zmd&Sg&T#w`n~mMie14U5(zG5rtd|#lCOI&U_||GdSKu z(k!*-m;0I7G}MohZqn8bRHPEsuvHiS6FXnqOx@sKjr-E-UE|2(P#M`0W!08}Bzy74 z2GQdD>V3q0-V$_lKf$tPrG#Jdcn}C$i-EhU;pu>miF*A)HyL_XwpqiAaI7l*z#=1MWS(BC3>5FhaQlR_&f^4 tON2a2wVhi%~cL8I2+ISfkamkX)t6%{pFu96EfT;k}0Zv3T{SAy&Z*Bkp diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiAbstractionsKt.class deleted file mode 100644 index 157ae0f97df153e5df29a5ca302483526b8912a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5327 zcmc&&>r)%o75`l!q-7DdSg>PZJEjIZAix6oQGzKc#imvb*fkg@#;LQ2H7rOgtX&Z& zbrU;H+B8kyPxqPHZAss)(@AmL>Ck-a_f9|cZ|L-Urta^qUaKG*$J3c=q&@eZJ@>rN zx%cXC|M}xz0L1Zof&NT(K9*TFEPdH@GMSVeOQuZ2a$=@+DXZH~HkWjAStB;QY!1(I zswW*YW7#L2AcR18QD4zxDczcnotj-VlEl^sG$k{s6elD+W~9ut=@?mo{T*Xv>PaVS zTJuLcH=+dE#-vV*hBKShP0NnymX&dIS8Qw|<4ojIsiPEK7BZU2rgcYwBJk)^#z~o0 zY;h$`3nH5JH2B zdTgn1LEfk!!UD>IZZC{v<_v+Fj?P2~8k$rzqM38YUQw`JAYfe1=_y-aTNSaL=R??m zh+NacHA%Tq!n<1w^-ky##d%+6k^I*iX=^phEx(q5|4RD+F5R zj7xeh<&5)ZPV1?hF_N)XjI0~2)-jJKFXgO!*khxGQ6D2Px(UgkN9aABIYdUg=MCrB zeRSE|(Yc8zGC8p+(F5ueLJtnq!H0taAtzJzj=;H&nFq0HGi3`|pL5JqY|OMBYX92c z)WAm8Lme|yQ&lo>69I!gRaXra%dI5X>ybi5%6QbWVAHmOekNX8Usf<6u(Oa3<*Kt| z!`ZC#z&XaWtXElT5KplkmN%lJAA^`-*EVGa zI~nd)+u2Ua>s>11nMqIM6ZN=&i$yN3-NpAo=mJ6Z{t4rX#m(PBEEJT@q;bT2#5V)J_@07x1E7d5!&$xs+}< zSNN^me+!ER8rz)(({5*noyrsmn>{{qlZx$>9l3GNupQHK4?#uJ?VkKB=QoMfcC-Cb zo-L073GQMgL9Q}N@x8#3*Q$~{j}8ymaqsQevU6BogFIX2iX_{5+Gf+z)b(qsZ--Cyg^L44PPV8%rIxUj zP|h0*aFkY&MVO7GGGvWFcMe}PM_lEZRmGx`khIlBvC67GO(7Uxr z8gEm4;c&}ttx0P<(eTdAKuD?46veOk6{VxLz(NpD!7byPvDMxm+r0;9YRevNo7S{L z^!n~2U6EG$m0(zj9tbz>ZO$vEsana(-sX5!>^pA;wn-<)W$qTL%6s&xu-d3HU^hGVm(8a<18a>>qE0%srgE>dhfWl5!zYZ6EMeZJc$_+u zvm7&RB&-$FHd*Au#}Rc#$JEn^~=o;9)sj5d}@>ZxfxYf6d& zvi-fhOEIbt5=vN>ksV3twr%hdqE2RV*`zUQ%JW-uesav1&CMUb;uyR<$pA$PoToSF zj6Uuaep$C@k>_X5ekKbQG5nk`Kzxueh=|-+Sk1rS>|cEEBYZKc)vaM`bgb)bY?Cke zS?13V@lt@WAL6h7AneAW>%S&E7I^jF5`Vf&d*p5Gyn&%rba!dH-En*sJG-{EBbl zyzvF7dOuA##?fist1h4p3mm73%X0oK=U1U}52)p@9#Yj14X1&8+fC?o#cwzdvO>5R z^hz&1nD@#qcL}Y(jYCp3;VK|K2s9MD8n0j#kw-^*OSoAIs z5-*jClXWd&*pGm+;Jdz2?$O5Fz@Lu}_-l^TM*IVTKVjmjh(D~ZVd@WfavkRff;C5!NZ<~h z5g4e8)ZGEM`Wx6IM~g(MkzjX3y@O>R?!flp-0IzbMuO|eF|nduYj}1Y&k0c@y2Fo( zHGFCf*UQN?jM{h6%>=s3(5gXP;4p}k`@A6B`FVm_VBcLPf!|93oDCx9`eQ$B=bs16 zpJp88Ujk?8naeD)>x3_3Ctk-k+~j+iZ89S-Gn_Bs)6By&I7Et9n4xm?8GM#f&Qh0G z@i~UJpJ(XT_|{LZ6ZkxFGD5eAe}zzvWX{U)->L}z#~wWVuWu6mLLycPzeeF-z!wYa z_qu8T>TRs9BlQ*z{f=r?)`cI^^D42o2th|l8Xw-oZIV7SIX-+^-Pn}XlkVR|YIL%- zI2u*ETKih7kUs3@M1Jwsi{%rV&CNh9Y^mj|j~(++oOCW;^sYGRsL?UCudS~;esG{q z?K{|auq{3iKg3agye-~+a3FqIjUF$X;WlnH`oFh@YQ%fn`lM_LOOo*xy}d&3e~D@I za@yncE3vRnzpq+31Zjxsqz^YTa6LUN)YS?N-XJW*H{VW{snd;p&O}Da>)i7-B-U zRl{W%nVl=`@iuonF6++A%AQ-*RAY?7r!F9g1Z*1?1{h{arc-;auJ~Ng;<=Pc^X^8< zN|!^=BdW~bwlj|N4E@JFWuRXC^ND1WNMWcSgBWI5`FEZ;Mi}h6tJgx|)m)!p>Wmhp zdkCsLic2;wVvJ$(v}PV5fSctU;mLJ=*i(e!@Q7x2-XYOzLod!pgAc_V;%&D`6STBEvwAOC{enRT$99M$gjR zG_D)X-B02sruu30kRf?|{}vjW_ES(b((__kx#S zg;I;ATa;}P2#V)_YnP~tQo4S@<3Zrk2@I~ws;2@W>(qo@RU>t7in`?HD?p;yRH0vW zH-srR-s9c=gB2NCb`%WsX~4MI2eqp&m8bjEPmvY!u8?J9qw@zyzNZ00mfo>WkW_50 z9+4R6at~^M#DxQlAKo|Xj^5!@271ry|c<>32x}YdlDQwf^E?^8#$?v1v20Wv`MWV=e>|?BveL~1t m>cZR`M2eX2JhyS@$h%v_0vz+oya5Yv4~vuvuoPf9K;jo{xN(C3 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$Companion.class deleted file mode 100644 index 3cb0f55310027b00fd8c69a9bd754e9f28d95b02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4330 zcmbVPTUQ&&5&n7*k{ARG0&H%!!4|uKjfL2F?KP}7m`fIOF#$~MkYqE61`mv8l<5&( zoXe7pt=7!()C_PO7IRF-UT3M+em1)zwvBRaaG){{5fN{{>(S ze_*)ndOK-1&mA*w`L1h=bk?@GO=l;4e{+{-{TS*PI#Q`EZu1?}=UdAjiT8Yq3x=MJg+14|Ehp{qZJW5$^Tq9h zafbK=>2@st4ny7G&^klI4);m%JU?J)9UNK+bQOHdPA{5yI&ia+HlbJoIIF&AIXmOk zlsk0t%7V0em;0NZX*nWoI*#j`K3OHwORm3Eux;WReO>3o(8SPYX0u#~R2h6Kn@^wx zx{hWT3=#jaMZTB_ApC!>Cu}Wc@yp~(>qCaFO1)|$(B7f6pJQmGa}Naf95crm+Dje` zyNn_AzuZHA|TnrRyy+P$gh06p{?*N_n%ppG)7{&#lT}&C(Uf z6j6yu;^{Koy~n?dE zt%0a_5~xSC0UEwYE({%v;Vxw_Az3%=LRD0$xp%M6*pk}sr>EytHR zVyCD1wppgQKe?`iz6N5jqp>^E$s~;D%><*FV01^~38U$9B;IVatXwdR?&f49Nl4ZAXe+VB6N2`l`i&l9=)E;d3@6W|dy;x2-e>d^*M)%V zqH&4DT&{)mN`N#)NPCTeS`2Rl3~w4OCx40#${QSGbj66uQjzx=nkEbWW7o5u2JaDN z8pWPZPx9J9o^q>o*7b7J6dsFw%Q6+MP0}8C_KcGaQJd}w*9ol?4|8^C*{E`)SkR*M z{s-@DLQP7KO01ZV3>RzGmQd0~RpFAws#bbaIJYQ{a&JJkmV!R0KU75W>5jgM?ZcDooW6WHn`IU6#Hd=s3VLs`Yu*qa9=zX3AP# z;C>Er=sV z{|rB+)dE8*%6a9zZuqMUcg3XN#>SC4R6x*=?+5_C>66b&U-TtSMC{ff9_(o0I_ zKrL*8mDqY;ifyPSwriExl%Q9{Hc|`QXeG7_FU6LriR}xO*p#4G!Dckz1_h~#xh8U` z{4f=czYZ3^p>G*>Z`0U{o48fJIE`)s=sBVvHlO0X#ZNI=H?~ywcI4{c@g;_1%t`xL z$flm+6_#RwVwCjXdma7rSSacbCCL3sM-GIPMyi#P1nL3_nhfMLjWW^dhd;wgr6Y}y zpn4^Uy0T@g77v%BmkzJhK3shZ53o+hBls<8)oG?thx#rB$nR*a;V1Y#jUTTrPA=== zI;yL;M;~78E6ry0t9_ZiGfc1h`}Oq4y*|94XRc(fWp3WMozaJ9bjX|kGvWIR-Sfi@ z)Xm{h@b^`0lvZDx!`JZ*qT+)MFoAEv+`y1Po4}?(Tp$}vwgkAqw!n_SV*yKGS71b- zOCTd~NnkHvYY@-{Y=L%xoPZ;6PhehPLBJKr3)~R6DR4{RTLPYd5Eu|roiETSa8aP} EUq^BZfB*mh diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApiClient$WhenMappings.class deleted file mode 100644 index 9f70f9043945fa2c4f1d933ac21deba02c91fc4b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 768 zcmbVK+iuf96r61?PJ#g!$|c+{fhOGCmV$%|NKtB0ODT?;P=xZdNtR?=XKn0t_%1*~ z2%&xeAB8x!%R8#HTF;EnnX%9A?>|3}0BqnH!>b^g+CeB352X$QKeord6iVAteT;al zqhzd;NZ9RAcCr_Z_cNh(c^FDHjSVmc>wqt~?Q=D?z0rXfYXb#_m4>5|dH=K2r!=oOaJ{#E6U|&} zF)Viv15GoxX>@$THQ%D6m@f)+4OqHaL`NA#O6mOAAz62ViD0PjB}&V=*q5;!`J$~< zpt+WTimi1TRxvfP>gnt{$>Sue1s6uIGDvQM%N@FdN=5R|i8H+V0O6wY+G+w0U_voJhu7 z>yoYUNa>`O=oI-vC1%Q58D1SOZ45Uzl+IbUGE$dR$-$HnkDS*UNhBx7>d$8yKWt`a zsPVR%+GIT1+%SIl%-E_G$z)4q>AY0q@l2B^%n#Y1^!q&^y+e|}3uBQMjyRk37aw7GQU>Lzd^ z8HqQC8%t}N1A7xRtmoh1b$tRf= zjg_7nZH%at%aqp*XH?1uty5x6E#YPigX#G0_*ZNJjQ3F?_4QBz^<(N|BAjK8Riz@P z0Tv3Yz7vA}9y*Q&Fdf$gK?+c%oj@mgDL{ijhKbxJ2zK;? zncQ{pNH_`nV+{ry>>A&71cwkT9}T5pUK&Ef!QZCV#$*%}Crg*d;!UIK!^yBlBbl^t zJTmRP)^KB|ffz#ARV;^}<)cwFTFhiA(+T00md0qEl(W*cqt>ihGfLubjWtgkh zdX37N`kCWB6`c!}DW2RKZLE*PRjR~LCq$d0$&;C88bif&m)5Ni>`j(V(eLAHW_Bm0 zQzOg67}*p^xm4d+d{#KVDiR+*90FHG)m{qH81!$n6*4~snm%o9U8F_mhDzg@7BxdT z0(DYj0?Q&OC6a+;EYKWl9wlET(JY{&7+n`@Y=jXIdNq1hxMhM-txtT338g=ttP#|^ zz^);tfJpLA@=}N}?o6oA^45r*v=jMBrW-_TO!im|DwIIMTOicQ0 znv+4ZXfBhpSytzpxNWu(nCDTgfSV7YOJT;ail>PYsdOeLydjc2J#xN}77Ew}v?$HW z>MT-eF-8KwGsBIo5g(ncgPsF&!u9n`6T9K6O5%#6?(fY+FWleMS25J*ho!YT17CDBafn?N-dcGHF3y` zq>Y+Xj1m6sLrj&Lc=kFg3c-2Dy5}gX@3Xxr1SKF)TFA$>AEU zhBcIn%e1vE@kk;8#gepGON@`!>I(vHnOPSi#B--pNxHOb56!!3&OxgB% z1cNnN2LmYORgUkB=0s~tODvv@)X%|`Nc(0p8ta+*qZKSfGEmnVk7Fo}=Lf7Nqcyt3 zOB;l0>pCED&R-FatqCs^E8gW8ip_zr;fOV-5G4XLYUj)jEQ7ragq!OFVzrb{z<(vi zP+Xr##*0@)&M#gqbOe^hW+yC-g9UN`1{2*?Js|l;)1k%D;&8Dr-qXT$D@Iu^P_d27 z;__nHa;{g9WZK@%S=`1p&UW`wWZsP-H)%H|eudhK&>xUhE@3uKH zI<(ao5?*7gvUJfjQ}fbX$unzPA+A`#8XFUVHPPgXfI(d#9B*h9QHbwEflbgQKLIBg;38HEPD~%=Y=k&Xh^;2)@4m8mc`X6hj4m(j1=B6 zQ}N-vUaaau-2j%~9i=M$2ul%E2)?;)`cq^YocGa>sm)7w(-v6k)LY?`)C#^g*Fl-@ z1r~Ta4N0s7SSo9L^b@)-gSOKBSirD|u9yNp$VU&-eO_8Z4*?oY!;O&EG|#}CSuC~N z>0tr-Qz+Yfjdq~#cqFQtSKcr!_^&EmYS0=z1?$t=f<-?vsWrJmZoeQl<9a-1 z!#IHP%cIzT!u85Dv|6vy=+{`dd+5ESAyer$SO#D*rbD_SaZr`+regWQg8N%K;HBs2 zcd)V8b1%g*q|pn|60|$Ak73E)@98Ds?7j@m0T$^v{*kWtkV3D(D(O{oxH%D__Neg>4CrDrGxY)^fW0J=h-dL)4vcZGwE&F8-fLJ3rBUMHg+vZ z!;fLVL+=W_e}n!8Go~p? zw0?!T(ih>zNYb_hca}`y9aQ&p2~3kFm}u1yOr~!iqj-16wH}H#+?|@V7|=XpsRLnc zhg_(77EMYY=>G+g6R;GX3`(<2yEYv`rZeJ=D!UNJu#Buxn~F0)QVUu2u$whqmnVl4 z5w!EMR|u)X8BG38I8&`v&SV4tD)Ey7fhlyl7@ z9JEZQBml=G+6)&pT0dIjd@tt-pSrIu+Qpsak7-qpMF%sk$M_IWIhJ|E8q0mTpWu=o z%xjLUG0Y1%ZrenfJU3pB_wjMu-wTc-!lc3q&J8D5`1p9i?&mlFkH832B(cLT)zvX^ zdQ#;Rv5v!0X#%g}FdD1+0+i3=t#7m4L#N$0Y zjwe70yG|rTxt>oJSWm&yV>mRUWGIy=u)_F@%B6TQ;8rt#@mn#OB93sRA2U6znO@Z<=# zaFLX2b#{*?pzD+z!EG`o&c}0ju8_=cFje(v2*PlT76LTd97Qc=HW`~4TN8;Rsu%I` z8A6ekF#Mch!{n|eoCtJoHhi?L$*|!XFNAJE6=y}TgkrHDD`x$uOoHALqH`867J9sd z>7*WFu*^{Lf)$Zw5zc|EBvd{J4le>`txdJq#MP}ZUKE!xDT`}-d@hGQyp$2SI!fnF zCsk#PQ;o&zqX_l;csX_^9ARvNEE8cYS}79|_3}#LC^-<>Wh#N4HBuRd+SwGbQ(N$* zk(cK-FuhkJC z?)b4@x)7*ZVu_@WFVZX4fh}|9&aas>yH;ZadECf$NTHbAoi3Ox=;;71;Y$TYmm#KM z*rVAoG3}G%;bt+%ATm;KTL`c4@|A+;9#}`+%|3do*p)9=^S1;Q*QDDw15Vnv?}+!; zB1F|wJxED$S~7;OgU`tunL$s0^lYfXkoY~lXtMc7US^6rFW^g+LcC#xzc7xl-TfF>Zz6btFG%*i(u{aVL zKHf@mMDMW)BcBEkVgh;XR-(6B2^TSN7&BKW$U9~O`ZaHM=z z{iVtXcX*SrSt4K66mIeHF1Qf9lYb^~8B2?qDbce${Btiqz>gp$&_nVM>FukG_{R7i zVln4(+FArPMA%w7YKV1YM-$jgAkif^V}MM{MqPTGnt@6Pm#?%fwq&L0%2EPS?M=UXZz7eDwuJ5&tc)D%B z9Ty?TM6wu5un5JA?RLJ+8klZ1c7iU64;hUfqQXAUlF-h6^pPU)IyrFgJEbFJBET)O z6Cz2V$vlHBjyM8QLcHYoM7zvXra?B&>zr(mwOO`wf~+v&6^Bh4NI(RBqKT!l=+=!E zQfNmY(98wsQ;_0Z=e5@2{~^do;lW}cLZZeVK~kfN3Y{*o-EG0HPm3E-36ZGiVoxdb9vW0OPh29X8W!j7wEqs5FJp%6j}3#;s@WvgIZm z*-o$kDc|{c|YVT0ItpZuSRs`Txg01yf)$*J|#m26*8($ckZINGadG*sAocDH zV{TFJQwnua90@KPbpH4 z6F4B4eN61wE{DaD3)Cr1tHtp-7JqW^xJ*9cBp|QCQ++wJfA9K`7nFFFoW1M4_^0G# zc@@p6*J-F1@2tD6K1bGTh5h!f5A>~2$`FIqMuk^Xa(qR2UB=V*U8c<#mXnG4EIVL!kuu#=p#d;Q zU>0B!d!HGjb87Eq0W?;*cm~$lNRFnJ}IXMMDQfT%+-8rw1MX-kP7dbUoj(gu0 zH;&^e^%XehcoYl8A;a+nmQ^v9C8<6LUFZTaswI+4;OJ9ilyL?H&J~2!3eJ`fGv_w# zxZ~l^ktwHRU#ZMQC(@QkTRJn^yed*Z9qC;JXH;djSD7QM_>`kv3sV90V#Bsps0w0Y z(~g2!hH6-wW(yOxS|O#@qs&w0r=RmQv;2wDQ;mFonW`XcmT6Nf#GMty#+;2X?BYz4 zopIf?$L`tIc)U+JOIhqy7Ac5^^*2pkcME~4oa0rN3f}oF2VwLoxI4$qYi-6JFjCXJ zI+}6tH%0budMoJD50 zHZ6<9jT*R7I4W^w7{{^zVN@1(?$-)RrxD<*X>LZ`QKZZx*yws|W3BPJh&ZDIBcwk} zjVxK%QS{!Zy*dl&8WF4y+1q|>`R+q;TR@A7T$E>3$_L`d3V4E16RNE~#Vdy*6`Kgev!#jUYK4Hx#rxF2?*P&bh zlRr4ub8<;;#!l)(BY#18o2lyuQs!<7Ey|s+gHCyLFHH)09MxXGCzRo+_W3h* z(KN;h4g~2#nf}aO1aq*NW{A=mOnYfTD9fJ}%63%e__ITO9M!r0KD+2F@n%UV&sMcm zugdqU{ycwvJJl_qwvKILn9g=;*h>X%G_xc(Dv1qXNINMuvYlEN<*wOD7g%GvsEvk{ z7Vqvhl$4-F?Tji7!sl8(oH zFb*e=q0zW-@E7;FREDdZ8gTyRdR&iE1wBQT^lN&Eo(0TvfH{EsAE}x?L5nY_nsLH{ z`{LwoF-}ew(*$J&`nn8sd=Krerf*TUEL{U>%af(=pp=gpDx+)ZyU^h4X)Ij_xGWqT zT}d19>_PtxbOYXcF|JE!6WvHE=(-r~zbiDH2h&Y-Gx`yw&2$U&UX;ARtl)El6X{mK zIdt72)vh~A6pcKJXekioc<45|9pWtn_&!5`C-|LD2!X@geIL{H=m6Kc&E(FF&T{n1 zbsu zAXkslI_UmAxL%}R(Cf61-lWIqEx^1D*mrRM7{R&>+RwST_oF9~mVJuH(>7ecvZVVy zOS(l#mu^wgrTalky6>^1`$9{)*ICkCZ%KE9O}Zyo(mlbF?g@r;7n#xx+l%duZhMi* zb3#LiE`;qJ`6RjcL71j{LQcPPFKrD;Tk6_H4=_|kb+(byv01>Bz_6+d+9(uq`CaX_ z?OtFYD*Lj|dz!dV&hxu+qwUnbnF?X<{7yA@=T7>0E)3${Hqy=8zAhGR8EO9}4}V1i zV8~S3$`jc+9mNh9AXU!d-MWRtOSn5Ej9ce=r>ysNsRulaol_dLAutpUIt2rth|**j znkg`AQ(@9hg|Rq|ns99Y0y$yCrltgP}cjL4JpOWla@I%6hoNEwk|buuDHKSATuCWy*yGn9WUGZZ6l zwx)K_fG+&q3PxDdRn+D6e==Poz}^Bn8M^v34Wwr%fE8s3{RR{F9474mt)So0<@7x4 z{{d^thF}uSDZ9a%vKy=^yTQ~7I$xhMtSktQz&8>GJr9!(tziGi+-KpAKqa2feQ_84 zL4odXg*A6nJ4>E`2hvG1uGmJe8gNh0`P=Aq>tT+LVmBRJw1eJCy@4LNchX!X$mL>SThJ-!j2$ZVrpTxY`VSU?}p zLe9fCF!{6q#(A+6l@U<7ztJ%1(z*aK7zn=$OqhC8Xi)k!`eCWRDhhJ>&u0Z83hBQV zZAXI>;T-G{HdG4CHuj8YXJ0$_0gK&jl)GRz=Pk zoIiIha^#erv6F|k^Qe&9Q7zn8zgxPi04OsY)=;LSI!pMcmfxD~&o=zl22nEn)*OG1 z<**9xlq*7cj_Q1W-Y%|$vs>UVFdCJJ5*mdH{UB^fsIQ~CpWl=6bNzkWd5myppTmT= zb=*i;%uZV1cenGzkV}Y59#1x9Ek!n*AiuklZsZ!!xzUuI=JC{{YCP56IOO)bQ@tM6Cta#ke*?m|q}r`XSo`BigY6U97lB@h)u4eI?tbLldyb$zO^$#$&fIJP^i#R-Pd0j>gTBT`}KGH%D_ou)aGwLEjx=vzOW(8AHVOXei*0xIYRF@b~u* zXy-(mGt17yHb;m3v7OhnIo`L|^fI}fj+V(6v?=%W^3d4EAETgtvyCIYJp9jicySw@ zVCP{TZ{T*myp1w;^OZ28S3N3MQb%wyW~q7n;-NNyp@IH^X_SVJuMUJTsV^<^pHL9+ zAHReDXb$hS%~Z0RUzfvs9=!8_T*;m^1UvZ8qQP!{V-d?i9tQF+0@8G8y<2Hv2R0je zI1GL)wv?>0dp52Pnn5{oCo1bv1C|X(ybXWSLTVj|brl{NP^AUm zSKVE2c+~|STlq4v>qq?2WUNk_4vZIR=rL91e=5$)Ql5x`9;vw*7BySqE*b-|jFR@S zxqXy6CP{$|q2?Ts1`%)-7p6M(pF}XUumgLTBM~8@8)^R;BPi&gjGi+)3zE>w?yrsA zz0Cd^WxJQzUn8?&c2vqdq}i6XRW6<@JCHNVJ0u{im{@~W8rIRUkf9DlaSqi;ajQ5K z+hrjUHNub{zFC*P^kz8ia|jak-mpivn}5C0iHC0ldO9_uVi7+*Y)^94!&-QET7Ot1 z2ll+344|VumYRv|u91A{dsNNknvUj2MJ~EUSWb3(#Cfm}6R~yK3V*O14?QBGotY{; zwj=ShQyYioS%rUKa|fb&$J%%aoR7StZSB-NoA3|8&|~R4)q082fI#d(q!B!H4mfZQ z@)%*P?RB_T8TW{Bub1~KBui^3f|%%XT1qbC^cUq9^tSRI zz3uSRUmb(!9mi05*D;LVbd=C*j#Avm(%&5O=sm|-xSvZOIM&cdj?3upj&IQ=j_c@B z$M@+n$3t|vV?TZDc!K`nc%D9Syn_2d`qc3$eTM5xad&3ZSGYQyIQHkn4$!%d*?AQ! z&Tq5B`5pSwxe+j%aKD|M&K>M>K8pK(R-Lb~$N3I>ogdQW&VSMsE)Qq8yzF!J<4jio z_aU6^3ULmuLV2&{zOGvC=UT~r*NwRLagpm8KF;+V_jmmkFfRc1CEWka16*J5K(~Vj zxIG+j2lzzyC?4dlq$}Lx=t}o2E_To6!R{qI#9fd3N*?B3$HQ@z%KJ@R=Dvx`-S^}0 z+RI#_y17!#;h>t&RcZm3s(v1>_Q!oNSF5M+81*#VXYn|-p2w@_@dR}ZU8!C~SE;ws z2K9EjTD_OPr9Q+bsjuLAgTAFPpR6f#jpnASH4pAS+Ms38ceDUqtA%mZ(MGMFuGd=V z2CbDgX&0e<8GTQ?j&9O!q?@%{XtVYMJl{jNY7fzE+8#bddyFS)Px55#S)QW3%Tu)v z_*730pXM2jGjpfV?VhQ0hi4|;>ZzkUJu$k=vz~t7xtxCJ`3{~p(cPY#>BkzLQRp zhY0d<&|ogV3mxeL9ht>{LyKHIogt4M;{4wAPls)*}s(&D%l>^z=4>a^q z+UOGg1X+zN=)}eRPqfHZ&gP-~DGoGvlykXQ9$xS|&oFzFCE1%S$=;j`&EA~fFneYW^aytW^a!DW^b;|W^b}2dy^&Eo9i~SH`k43Z>|QjH`hwDH`iRV zH&?CMo6BwX27NNd=6==eO_pSDvLt(Rzi#&Ce%b8Jz18f^eZSe8dz0Cl`zEtD_YAW) zp;bC3)z|R@g`Z(Q@*(X-{4a34Kz#+N9&zX-PraY!%h}ITAEIx_+0RznAQPMTf5-=2 zS;U{CMW*&FHSrgi=`3wGt(UWvAxr;8_SmQGp^Ib!GE=ML#r!4UyjpK^p;sjO35f^q^8ETwqNoA<IdkgVep* zF8Vr?i@mb_HOh7`v%f}W_h!2~5d1pIJV|f13&&k#`tbih+jX(#x%k*JPDqvMjgK|k zwMFx6IreOq(OS=Torq6n3i1D`2yhMlpC>gmnP<{zJR8@U#(jZtUnuW0c_E$43lN1p z3puLAbQi8Iyad1ZeKx(y=g^0|l>Wiz;`e>S_~G7V^f~Z+#S57EOng;38$Tji$3gs( z-xOZX=WzpmuP(}0;MWLl!PSP}-1{lV_$gd3atpu7No6>$k-Qq$dgH!9-p}Prlq6rO zwDM)jrF^+^4elHHO66|83fHyrzK6f7?BVN_7kHxs2f`hr_<4S2c35T=5D}l!TlkA$oVvH zbN&wZm-%7mN8IlGl6SZqdT|wMK{D^Bd@4@xByf^TER|7xc zTE|bi?!omU|I+n3KjnIpf8}}$Fz*2NJ>37vPrI}E8FydY2k^7*AV24x#J_c)#yb(0 zKj04Y@7&Ayd3OuH;9iUSI{v-;dVUGlYx2I8|K#4vueM(v& z9nP<*qxdDY4EJ&TmRieyQ5WML=D(_I`CavL{+oIYA5b^)d+Gzc8kw#Q>K^_;-OnGY zAL06pKhO&JBdw6vYel?48-RO&S8FHo-?borthM4=!~fLQ@~7Hm{F!z&|4ZA5^3D9Y z_9Om6yNCa+-Opd*Jm}}zBiy0wS4cacu=aaJ(f+77wS$UF`$}*HUo0J^SW~GnkEo_KmGQdE%6KKLjMr)_<0U@5)iYjAX2#3mH1jmF zB=a<~B=a;5)y&g4$js9q_-kgoUNG}C%5F1HgM65o@jB1U(?FNZj91j`%_&NH#!Hm+ zj8~)Cn=@ke<{V@8<_wv=IRj>I$cGudIbJk-gC-fhx$v>3p3RdbJ>wZz`i;|x45+yz3^@-V= z`+c)F_oHTS?tSLi+*{1vkPkC@bDv}O2CXtPUY}SQug|QE*GE>yYoC?z+HYmNc3T;* zJyyo+pq26Zjg|2dB|YPHz{+^7u`*skE8}&dmGK&>wiy|(E3}z<#*5wBGe*X1vgbN0 z<8{Ewcpb1ZUI*~0pU8L>d3NdSO!}h4{GK{I(3qzWz9NAwMn0VGXPUcsX%5Z(77Vlv&%cB8=ay%vrQUnTsDZ*iNse zKfbNR7$#o90lpoAyZkW=YHHzcPyj5jJvC>-= zL~#sitG(5gqFq_2qO8(tSW!O4Y*2P-V#s-Oj2HO2z2E=vJd zr!bF6VIG^pJl2MJoQ1iv%)(q*W?`-@FSF>cEFb3`Cx%rX3{`^Y@-lECR2i&9NesLa zJ*v56u*Nheg{+h4$9GC_<~IEyIiNU8V_SE-d2@^q$)6@q`W#* zRe^`#xIq;{tj1L9Wrz~mf+`_u7`S*Js*ue@T}8PGS5aARz*SUYI&?UULT_6k2BFuD zwcy5@aFt~yTxFR7CngZWs<){Oq9kdkgdpm5!7>w15F%vM3Gt9{L5Q?bC+1tPtAcPy z8iE!LL6Zjb7Zl^G8dpB35)T#SKq?;~R08X`ib0UHstWIjX(_`Ze+SDu;=f^CgrW;! zEGZYAW4!VKWickREJh{EV?shx%PXah0|=_BKcFmFBwvWKKqP?B0NN_WPxb)u(H{T= z`LW6nAiazRQi33OvVjl-A%$XM1jDVeKqTtNV8YNtl@K|Y9ig^CQ8t80YONF;ql76J zL%~2Wkw(d&9CVAfLZhYNNTsO|lV+5R{y~X=6S^Ss@PS z9I0>lEqy@n1`-Iw1B&vgj1D+@}-SK8JLLnuLK81u%x%*50R`AwS}-&x3*c zRc|Of-P(Q|Vz4jL3dk}n4usy-Tu;^WurC-gwR)Q&s}H4Oc-Hy9LADqy+TlyV`ywL6 zYOOwxZK|d3zTgugv@c>?sqlAoB!fXKwWuSN{s+c(Yn!z0%px8N-HW&kl*@x4r0gUW z%-sp~&eZpbRf>`t?!BB)&X3+T&9l zG2E-A&LHWk6q1}ueZPdOShcW%YqQoN{}SG_ki!i+>rN8F3!!ThIMjm88!{ECD$cmlocwCmwCsg$ z_4O)~wk5D+FLoWfOj4B;)wZjr-{sfaA1j==k;y(J zFHd%nY?gjAc@*e_eg;?|?k1rIO6OQr*r*cvA~dPHMs zPJoFbdFkyKwczDM=yS3L&D-nFmEUl^@hfgN)_=j$PlOpb(~N_QHLuLMi6*T|lKGhC z3UNenHkl;)3?9!!ns`EXOtZJB2DcB8Y2*Fba|df@-Un^m#XUk%I{;Itqj7*Gg`&c` h!hMCZLPg=S!p6)cgdR&_LBUq2Dm<7Wd4+<4`!}zIlWYJ0 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ApplicationDelegates$SetOnce.class deleted file mode 100644 index ab4fcfc583e0682a260a5befcd16ce4f3ad75046..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3186 zcmbtWTT>KA6#ja4nOTP0vfco1sB3@~Tp)C7_CFbC@+&@7#L+{P)-20QACP z7e20Ko~>YPIxxslb2%VGaWOv*pCA`_Mxd3I%=w+poQV+CTG@?8D-@O6(7G};3b)6 z8V-^2O{PHHNZGWC+|_V|K^-)0(;K2-wM!+fIHuz$jx#icu(riTLy|$GpiUAPhP~}u z;}qIki+9jggOg|{4MvGdqsY*;6>0_8mKeWeT&5N&oRYS5Qo^=Uv|6R1reT?%@nQ_8 zDGZ(yT&YDj+9Yca!@ixA_`u%PaTt9Jdp6xMz2G{Z%Ft`*XNYfN$lEc)aOO>9$oio2kb#e(TISSy3^ifkZ<4z; z43mY~$^7*2e#~X$BsK;xJ%si!M7r-6ZlD) z{}Xa`ouRQJW`cW0(eMlksj|Ehp{CE|5U1^|zlGdJ2*nbSiUjAcwTCHPX;SpHhyJ9* zgmRg6DRf$(!NyhaSg|@x1c#S;ij`ZsB+7>lIdb;Z_uYaZZjP+MK;|(oJcYJ5QUNs)` z#cW(?oT`tjbV0kl{zbhMK_I3Q#1&`{sZlb$di{Hq+MiPFCFs)(Co2wn-J?WK1a+h! z#kxw|6Q1Mpu0^A;BpjO|^A=C327{_Dd{0TqPU&}gi5{-%yg6?h@=2zmA9ac})luIp zEKL}tY1s}K8gi!1C(FyT+zly-oKrBY8N)RtM@URgm2J;l=2?5i6eiI(TKw?l14CJx zwQcT>T80puI*guo%5H&QGNq=y!DfulmgmRsdz>B(>4@e~@=PFii#Td_3KauErCE`M zOX;V`M}cVEU)TEQb*QJ*oFmGYi26y|-}$Xxoz^L2aGVxYZ2mZi3!%Y(`@n!qXz)NZ(q9$nSDT~ji1cd&;Nmx^ zOLaZL!Bq4KF8+v119bTNBh>hFv-4gedMG41nhlW zCT@bV;g!sWS2CejZXoTP?BvwzY;%e#?IpQ(xl#Q@} zf*&RC%CPJYI5!N?k=v3iSA1m}6|oEkwKeL2w3d03ri)RU>kmag{~A>+mpZkIYk?w} z4`g7>*QnA3l{CuB$HL2d=_+{?u@sB4Rosx*Ku%erQKu6HvnZe?gdBlIbOl8$)BJ6I zV)(kgO9AUw{f}Qgm2a)AF6pOQds=tne~X?{`8?NCIlbpZPiOD>fgU|IuEQoPmkGrb zA@fsX}p0$D-d0CKGh)CklG T3Lg7!G1n$;L>fRfxNa3&sj57U*V8b`X4l#o zN8$zL35lP;D^EOvkcdPjWR*95RK=OK6QHgjqLO!J&YACA=R5x6#jn2ssNgQcdKB+@ zQCEb#D|HkF%JTy$LhZ@$Y0Q<5d%o_)!rSb21L<=uqwo_Eh&`@_%7QTz_W2R_0v_&p z58L~~*IA?(vP$TOp)VNjlzaeyy;hL29F_^N}f!3~Uz`rWsP@g`}4y7ir8gIJHKz zwb|JEl#W%R|KJTKPf7YfXx`zPQx~kmqZCaJGYj?BY9}I$NTg>6r0T3P`2FK4*P6Cm ztI$7oEr$+9a5B#C-&oWAsZgfx2=Np`BEWODirNvdYY}UV!CME&#a`c zr=9+BAyaW3t6-Pt>V77HXP^II=S-*yqg*h5n&^K_6Km024(Y~lc|f4$uFy(Hu~^>c z{(*`@)1%ou-o(WmomL3=s?ooFpov;rQHQuNQJ0};^bXr1ZkdTN?1+3G?C@9`d8o`a zmycX^GXBd03bb^UK zCVwQ^!h5vZWJh;+pVl`9I202vMmvQ|bpJtu&f>!%-l6>?`m#hBMl|> vTuXk}apP2)t6?7RkQO(0!4%3^*oCWbQDIS`q>xcqQn;lsrC=*8E8PAQ>JYPm diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ClientError.class deleted file mode 100644 index 603a689cdcaebbd858e21f5b9e3f80ae8e0d3c73..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2831 zcmbtWTTdHD6#iztzAXlf0}VJ_oQ5REgxDt620{abByJ2zv5P82t+X~1ve@3WcGjqQ zsrVI@^4h09^r5X9CCWpE^4R~-zf$$gu1ywjsMSjL?ws+teCL~U&iK#2-~9n#9$O6a zmc5g;n%vZzhGSWEk*(GZZaP`Rd~WN)v0GKAW%KN+ySrxFmK_FT_-3(ur?{){>Djt& z?qr`-c6rrVSSt4DZne?r2t{_IRj=!nIwv6E9qz2SUWU^%C;h|_LO2QqeH6`kVF-rny^`SL zlmcmjqPN7Vwapn=fuWxwmwbDH^h_a!LBwUaGlc8~*SEP%5eGe7Eyt*5*Yzejdw6tb z(FeTb*oL{Y;8Q3X!s(*1_7SRZxZ40VX|0V*8d>k_axNHL7y6G_21 zLuk=34QGkrV%nEsyBG^Tf0C6MD)(>yU9StUS)Zp<$eP)TV1!|^W;u1k%Wue%O zUJ^BdOsU zZb(p58dcgY25LSRWM0a57=}6k*14l^>yA!MpfvUZG*_8?#7V5UBBU6gmafs(cAnv{ zgZ;Foj4Il}{^2W5YbnMf-fNnc1N2R4N+dFRu%A&Q2m5h0A4#YQL|;pi3qKONhKFbBxw~+4okgUG@&J2i(E9Ph*VIscqcd4Ecd+%tqh^L+WkjAw|Jj2)9ku1)h+^~UaC(J=W&t5M;0 zSAuD); zq%2tyzX)c2N9-3@{fVn2Hz)Cwo-t1W{TLw0AC5YJLb4N%hJPkS1s@zub#X*#B1w51 zM=^06MXHOjm)N;OG%_(7x|nJ^G$_1EdlPes^KWrE^Bd;gAeWhajaX*)$UKHh zQtj1?;+oYx15PjawSC`PHE%b|TD9|Fc+xCEjiV!qyrATR!N{NtqK+e`JPBwOAI~B)> z13!clS58PAP?RG-3NhYLxNrd^%QNrIJbOIjZ{NRs1+anp3{SN=jdfQj-jz=4)W%6F zg>tb}Cx%;RdWq{95mz&I=WQaoPHMGS)txR^5?4gXP5LAML@k+Q5tmR$} z-yM2}@`fJ^d4JRfqq|VC!bqMrgt0W1m$hw%*->X!y24qfjaX^%q;0igc=&IfFX9@* z*ss}>zhjIxcD3zjs#Sd~7$)jciTz%uDa;{nro>FubwY)4Dv$6_vRqS2m}<(c74#RP z7rJK>u`9h`{-CFv?1+Z6k`&LB(vJIYXR%Jh%TXUeHt=7HUVe*EOqSY!{DaRZeagbO zY4>5EggdmCM+q21l#L~i3&eQwBeDTmFE0OCJTpodiG3wI=n$0e!bCeVfei9>q%fKr;Yv~h!U$f;06EulQEovpd}yl3sM zqe_)f{taGv;(-?gC=y60>LY&?V)pEODD6WP>wG&iH~X8J-^~2`-(UX#SVNuRZmc?f z+!vDfLlei5_S;b?r13-fLUC=>plt?9`1QoP{jx3kCX8hcjG=nK54j(4+3}wZqzQZC z!uJ$|rwum)U61z#0}B|&I>PK;u%#9jgCa7>=HVdEkTySrn&DpKYDsM{WH&<@nuiQi z3yt&ac8v;UXCqi_GR!C72g0-z52g0Glrg15HEI9pAc}Y^5(G5)mivp%BF0eikj4Z< zt|zqS9V)H-W+;a3w*Uk|qZ^wjl>WhCj~F&WNgnx6#0x%%Or26l_>R>MS6!htY`&$- zW#lkr(-`-NvkC)on4~pn^_%3cg$jAp6iQP~&x0pK{WlqExBb0ha5t&JLyq$GxYy^B z+!(g5$oc#k29Y*#THcN@e4iUmHm7%(qR7m?N~E?D6;`DYVO=uquQIewjw+s0agzVZ zk>`}gz2tB`$IZA?m6M}e`88*S-Dml&n`O^+N=`LhVJoS!OLDsEtYlvQoOMdsXA@_d zOAytxn=84mf600_(i+3eg>GFQTgn#Cx2&^PHp{D1+67 zQ=Z;+3~a+c^RSN3iyg#~D45SpQ9&xP& z?X9;P4^&%x9ojh4Bgp0u@B$8QQ~GJ!f0XU=lT^hl-Y4eolkDIFOxr3+&R_yLxb$U% zG@njt5Hhtt;QgAoZqhrO7_)dla&hQ@0!g-&v?l~;F9&qmp)1suj!~}7{0Z+jQXO1| zxHWVeLC^(U$9oBEA<5RkL%NrD$aIYaJJe&CB+W+Iq|0{Ms9W7B;nX%^EH;rvSZBHiy$s;pSe_$OsVLquEw0k>i;?jd7A(L diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Informational.class deleted file mode 100644 index ab8af7092fd5ac457e9405a344f4d7498745a889..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2740 zcmbtW-%lGy5dQXjw$B#>hhsNDNJ2|~fC;h5ucm>}kOUGphNRd+m7-QU%!V93-&wb7 zl)O~@6_u*K^{EeiXsbqz`cNSr``ACI>g=5fHjvb6C2MzQZ}yvSW@l#o=ik5o0pKbs z4A=c&v*0(mXEz<``>rU|T!(wI;CRmiTgaeQldXUkO5SrnXxP&6J=;x!F?=~!ys!1gXXnd30xmQi!t5}y%0<)n1fQ!`XXj@b?*3n(By znGU`c893f1*%=QRZ*jRE*p4R(w&(eDh8z`z6<@BjT$i-^Ho2^HKxHQ;kAkI@{Fz*GKCt}%S|?|R1&o9aM%PZ%cG3?vxN)_v(ZUSVsyLFFQOK&3&2q7q9u zHIc-J45w-@c&+}_4(tXejgn}m6vL%XhVAM(>f7X68sj)`;v-xzkYl*kV_EE%Q}tDo zCow_!)0JTiH+s#?PNdm1@|a3t5|K-*ZYWY` zO-i?q83y+aE^}#b*wUsN(i+<_>Y7Xq7K!Vj2qng-LhH1(F~jiJ?#_8r8`8|(owt+K zA4--HP4wLwGd05)+TF?P#_o>At{NFVqdj6p?cTLa!itS(MLlB}niZ#2A~Qm(D6om+Wn!=>R%m<>>g+jSk~ST zi9zKV#f()M?)7@(?`-cBNl;lt*E8MZQb<4G(_40}E_{z+^qnWK)TxD^UTt~OY4DP_ z?FeVx!Z5vyt$CueUZAUrJ70KzTIWhF&{D7&DY^ag{*GsHcMh zQz9urvq5u4b@y&&=YK`|r%=62qXGm@VwuKt zq<}v3lhkRB(wMB8x!Ye!tI zRGc+sKs`BRG$M2kE3`KdqnN1cPu(X)?&S0&EzH=> z#2egP$xn?E$y*VtC#0xDOZA1ZRQ!_2lI0xjMiyguN;(=I;d7e5t1K@(HQ!ec=Hu`M zGV_(O{ne5=H8wN$-a|dUAYJc;nJ=3&<1?497jMs)`9%|}L~x6u@ChaG?PrLUFdP2n zaA#kdFX2<%rClsM0~5H1`_GUO=ofe(uqcoaSP~cr$6Pp)cvfIYU|3*KDCLx(ze0HU E4=Z@UZU6uP diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Redirection.class deleted file mode 100644 index 0fa433897dff4974540326682034a326e2511924..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2479 zcmbtW%}*Og6#vcoYrPmSh6H0ErGX}3AZrtnrkK+38C(pB0HLa=hs8`_@v>{}j8Su` z_$w;q+EWibv{56X9wNlCe^k}CyN22n5NaiR-n=*Odw%omKmYpUBY+9KWSDT=J>98t z+o+n-aV(*iEtA_)H|^K1A*5R?%bLseb-ru5yev(}j)5_JH@!JkIxvn5-7@Sw{pHR9 z9TsLvw{$mKHH%FF*14!Uw&2s7n}wMI!}I^^D26bDCZr*2V&2*146Mk|y2s^4gDf;W zQcNI1;gZR>u6{TB^}%6#x8fsL3_}fnlvqa)u__hi)P7mL-RJIYubB- z28EI-AC zR|IS@x*??m+R*Mb@D4+C+O$nM!_YZgY_Rr1j%+cME=#WnI@(}&L)4Ki6>SXnDvq>F zTR%8DB+N?g+J>bUZLg)mEQ=U=8M@2+yj*!@xW*wTjiRWxiQ(aJ5Udfz4U+oJjBF*) zk9!*W@Cn1?TSD_3(wlFpJcdshS{l&8@Z|Ow3!aAOr;xxPhT^!7&lsK!|0fq-HQjiq zA%bCsxyv_FD3-2j=>mUk)GRqqDD#Jc_S7xPj%5WyLU^zjD>8;r29+OH z-X#;zd^g0pgX6r!2Myd_EOj?cnl zL-e#OB-+h0ygNO(0M9`!P&9Uf4`n)siji zU4hf)gG93R?B^&!SlOMR5;o~BZhN2Cj!)_o2=Bplj90l7(sB9tfl;mq$7ble*78wB zGQ>B`J)0(`OXIS4y=F`EkQePEQSuZy?XtOL>!u_(flu#1hdcHLQbZgs6%*tuKhviBc~S$^MR(UudIXnO093 z=s}UzM4&*ll{l&#orK5B#&>_E!$#xG6~;k6T}}DWH6mSi_$_(xpq?H}Wj;#jZv1b_cA%qff3Kp?`di+-fWSPk@%)7&zZ8X`=)Afg6o( zJ;g8n_-NUZmLJTIP3ETZT6R&x8l`7YO;4zvr`re>@wxwbhA+;!sUixPCMmw$1{0XU jSKDY8Xcc%aFe?xhm=kF8SK81gEszrE6i@}?0`q?Z`16D# diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestConfig.class deleted file mode 100644 index 1763aca2dbe0a61403fdc6a971b423c7906449ea..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5445 zcmcgwTT>jz75;j5mmP)$W(QVWR+7QU7#8pX!pISbSQi8<1Cl|(QKTdumJvI!%;1?> zV&~$JIPs$&UDit;Qk6;`{E$=y>JdXY;0Ed1=#n=;*HJ6tZ5yG1AM% zdj-SwuG`i_b0Z4Ipl<5BdOELL8|m9?n?}})BE-WZIHwFfuZ?PC6XlR54g(2+aO!xF=`wk(4 z!aKT`W6&0k+_K_1rnNzRQ8M<9=x!%dYX-#7f>v&ZMniLkzHT^VNvl7w;F!mA@uCG~z?Z6Z&j=kuI}+URZiWc)!})+=?iq~~%P*L&S7)u6 zDQ>n*X20!&W}ex=lVD>w>zmv|T%9&8)0<&12cC~VweGIm{8W`VxXSRi7qnI#H`bar zQ)SVylTLEu;Hr!W!}%@S%bQkub9b8phG#gIo=;~i&U@F)x>58qbYyczcI%Gr=oA_Z zC*uZ(nBmodG7J3}64)oAN^pDzS7R8!pn_MClF=fgUB+34&;ajv8EFM!j52)og8W+L zv8l{Ly*=MB9_ocW508Gxw4FuW*)p6d{>eMUi4RSL(8+p(j&Ii9-mxtT%46lic)4(~T$rF}l(l#0F#hWQwk9|P8mK*+mG?jbYa~m55qrC>x}^Dl*K#j2U59adl0c9`51SKUuO&2XVM3xWq}mOFJCy5qBd= z6b#s)jBm#@|gC$QzvKsca7rRisa1SZxn0fBTC}* zJmnUNavv3UO14}OOgbj_qQpyI%NzV=)*WM(L!B7IOV}}NAjf04$q+AwP%>Cw*FBve zrS07i<)n-kDv4`C1Q#i*WLu)F~;Fdbp?1kGFZHw)oX6e$}H$atmpj zsOE!ZUdvBEmOBsk#-&kqZBA=YrEY07M0J?zh}JGkYD0I67S^~V%F(FSOQl^E4fubc$ z9ItEQ_}7?7knC2Q+Ch+=b#Fr)>FLtrKXYGP$)o zEH|mK<+yLwk+NBBA*HbJNZG2Y%Y9$txd1S(#-9GJ;T-?Ebf1CJNZZR94#fihmL1tK zJlC@wV`Nj$Zn?Ha)UJpDuWfk@$>oCOncGIj+BIF1IC}Ny%|K6u6?4PV`74I*MgO3+ zE|`|FRM=iKoV%RUJa4zNdVW=ROfCn?3)Q%#ET&?C<`s{Oql-J3rmWZnCu`g^IdHo# z+%VP(8?*0w1|>#(7hM7LYK_4dqrey@-iM*__X#=Wha~YjO0~ux3pF~*!)ex!s9(aF zs_~TYmio?B^tB=m89agiG0jX9Dt!Y)Qh!9#?*-IPsN@R+F?=XWF@U6IlFH4BLnW|U zptfqD<`aQB&`IaM+M;ANP)i*k-vM1!mYuH)*jo+QdMw~e6@ZNAW`Tvjq%B9t6&HuJ zSH8f|ur^HPh&DoHS6F+Es?=kQrH1y=lp5YgTWVw<$y8T(AH9E|X%dPa?n0ATe!_iWR(KbsSyErKu8^$|nmhojiHE^tsC?3;xubT%R*n>VgQ)91l{-lQ_?E z$UmIPc{)a%C;i9ri}pRZCGhZs+v zf_?1M8R4rea^!n|MdJa!|64@f38^pTNYz%Zde_$_>*#tbbe|I-!yc8Zke8y+ud=Tw z_OU2!Nuo0Q6?F#^^~8(qC@wu)4^3Z(5jcw1JO^4#4gCglLw|wv2-k)VA&ET=)4smI z<|Cx}c1UUyQZGqKl9EDdBdM39ULi%opNEdN&;aRQJbC8ii1JhVkQyQUj7kX~;OA6- zw6b{hj#7Q+DsPF0zmi(%DYkAZLp@_XH3LugFQEURQBn)aSl`(2*yQCgB{i$yBQoR@ zGH;8RnZJ)v2HWCi!7fTW8N3IFv~cf(x$sc9kMk~?UF^DuxM*D1-n2 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/RequestMethod.class deleted file mode 100644 index 682c76a806c3f9affc7d84c90e58d08bbd5d0dd0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1652 zcmbVNU31$+6g?~1(pphk#|`-?r5_N$PD!1Feo!1j+(d2My0M8I&v^3CQEW9;VoO0Q z=Q%UX@XCMSiASI_lz}PZ$s<3C>D9_G?f@^=X!p)Jx_kHDvv=)3|N89@0IRSWZU^CE zF*tF3=fsPGpeu^)uIKtu(es~&j)=m3JL-pSao7F2?~3TD8@&iRIvB%t^~gDOie1M) zELwiQw^kh|RB64$aN+GpI#LYkBdfu1cf6ns+Ll$d8Wuxp+bVA{=(T#IQrn@5)Ae#= zbDKWYYc}nm*7s=UYgD%HMe9W53r+H0XqKyc7Wv=XA3KM&VaS>Mh*owKdj4UlQfQjU z;gW$grYW1~g(nzh7hIC^neX)6XF*7B$Mc=;!ZJhd-y#0jeT9KlNP|YW zY_sbKQ5wl(sO)HJabr?q3-~D3`D2Eu>TwX!Q5UI`osJVZ)P73uRHggC;wek;KtjY& zB_)rE>X4*Q24|+B%qfPF%^C{N@bhok+~91L=TbRkd2qJO9_U;-|6WtF%8|lV8YvoS z8X66q2B(oZ|3Ne2kgJUL#B7q!(uo_1C9Y@rKn?Z+;_hQxa-JO2# zzzrMDL6?|ZHE28CrW1NG9+DZ`JM^9S=YhengMQd{A9}I({BGZmyq??igh%dW-wz@u z@&aFMtWYIs5|(ew$Atl8sU~Tu9BHW%X{iWlDSv4xbvmHSaZ6H!6s@~}izMMwLf;XJ zpKr4IYbdRj`a8|JyXq_4YrVvMyOol}=c$BPvs-CNe34FwFYT5li483w9@s5i5}SHL zSayp`;vr9nZM&6C)>N{?MNjOPxcZY!M2Rmq6q%ewy%cwozIgM>E4&jsDA=J{qwM3k zM)UQ=1v7D#^yrwyocyk19+zoFomhn`&fr~K8P+``JpkipT>S+f3~=p7xjI8V|KUGA ziu5va%Hprc51=GI>M){;uVmyZcFFFMZ-LHeaUW_0H|6^Ymi|V!Dkx%^Sgh=W3HlfL cbRQD}y1;FLO9Gkz7sv=0BIZqjNr5|W0H0WT`~Uy| diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseExtensionsKt.class deleted file mode 100644 index 71652625e7c3140ef3d737c263fb03fa1d1a4767..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1499 zcmbu8-EI>{6vzLwYkLs#HoaYWGkcq=}+Hdww8AXgnG2D6Wm_`lhRdw;^;V3blCf!iZ2y+Wul3Fos-{_qZ4E zaMycWZwjAOn_*n)YPb`rHaFzU1BQvETGZMzrgQTsR%Q7)!+b5iK~tEz;xg1855veL zr?j^one}cEROs}A*^_$VL{t|p!)z-ufegK7uT7UWLJ`iZhDK2|>1zjBhN8bG{MHk$ zcw3N1Rrez^EH2efCQunrHsdh6mF2BbjAAT{5uBxzPbT6Z$B^=)hG4LlmaC&E;9M4Y zoM$Kur_GR+dP6j%qHWtTkn2 zEjK+kkvrI*w$@nLTC?sv{P-r5nNGO}`#GDwq=r7E5>q7Mv z>XXldEv{tj(H9psx}lM6Q4M=iOVW=<=-z*0O6}Z?y2=+1WgNQHKeP4q#DF8N!$OKG z3VN52Muu#UET0N)(K=TyocSH&d3?$>%D-Xa=b5)~p1s4!%xgHQcSza4l9!D&dgo#P ziz!$R^3*8i++`FV6q3>7(w`eNu~an7ku^!{O?s%53=VBdC?3%pefoU4P>Sj7Wu9I8 zCVc6C@M8n`dAj5&`03N|KP33S^X%1k;S0y`GpFG%oQD4~#@m18+2`-V7mwj*hw&C} zQ41`r;wM^b)RK!d441ZHS236T=CN>SU9RE^7OPmo@-~=88CSRAYD{Zf)0ouAXrwiY J8W%KHz5vj1H?IHy diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/ResponseType.class deleted file mode 100644 index 93cb48a774a39821733b5672b41cad8d20bfa6a2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1580 zcmbVMQEwYX5dL;;-<>bl#xbQyN(u!6*eR)#l$3%)NNU_-Fht4~OI9SR%Xt&dIp0~g z=SaNei66ofk3c1gKp-oR{3yiio{Nlt7oTo-^nIS4o%wFYfBgB&?*O*&DZ|}3IjzM* z5qZNPjpI<({4fwvS_`6+#FJ?<^3zcwYKKA&<4B6fUk`-|#_*`!_s+dq=tZZsW;7b? zv}cG^->oxT{bwK(c?Q!R`M!{nVSA>y3|CswNt_J4G>9WFWSBb?y&w_3!h{;S%4U+p z2_aV`=OURPYlkF=f^?T5SE+U=nbppI`-`T_aPMfwY>b^r#OswQ-P|+@qSJb-+Hp|A zf{g;o4Egk{fC^t+6(sAE$Qy_!aYAn|ph8wR7|Q<+@xShy46MaqoO|I&P}KXC>TESQ zxQh8AI9@U_&rtBgI1&ukD%GiM4vzbzaNWVnc*Vv|+#>Px%?Bq8t^X*!I-{Q3)3F+% zCuMyqjft+)nW+|~yk5hqQuz&rh4xvT(s!>M=MXOK+B+I zUVdj-D%2LEyRew$u|5>3OyfkX_dWki#*qcXCb`QF446vzdloDQRtDa)P;^ktz>Wpm zft`U5EzCKX%fJJMmHlBrvoJNx&u970SxVj3h5<Bt}96S4>7`xePvIYO?5s(#mS`#E~M ig>~E^7PTWVi4ANXp(tTWY)LFg7!sCLj4d%IarZ9_sC&%- diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Serializer.class deleted file mode 100644 index a43232fb4d33396e295eb12519b78e2695bf35c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2066 zcmb7FUr!rH5dZCA?DNGK2T}s$A8kluL-Fw^rKF~5fsoe5m=+_e5f9b*ydh_w@2tBu zB7Nei{T_X&`q(B?5(TM3^sOJGAEfH+`CL$Cia7grcE&TaGryS~|M~a3-vP{Hn_>ut!kZ{ zB8EPO;kscqeAnrSHjP$`dkiy0({1X{$QkzznzkM)=`}+bRm-V`9y;ndhPy=>Q=N;d zXIPG}8;;`&Ls%~DORgxjZJV_2^f+tsj4DH4I#Xd7DK=bTTaI4eZ|a5pW?8y2$-&4T z7lmH&>gmj-B2J(m(Kr+gFhrLv#}bbc7(`q{1Sy7ycy9R&3qe+wLYjh9^QH36N@;DK zw#!r*>73zeH>XW53<)D?D$V^qDk_r;ovKs=7LujPum*{0a}3+Zhu1V^RMC{w@u8-u zw2_P&QUCZs89hFnS7zC2OjS;PiYh5(`(~M#QTtQMctnk+ zVkf^uRq1)2(b2fxfqJIJg)dx>&xAG72%J;`*Dx$$nq-*m-4RW<*0#AG7Hs`MaL1Qr z-=OyTP{N$ha35)gY;SuBg?Q28dcD?I(hIa~1|DOW(l9Myxp%%{(28CC8HVW#RL?ef z3_3&7<9n8D@{SXRO8TNc>S*RJ+i!E2*D#9(h6m>d*#W}$7UpL40^QaftI50ReXL|be;2#X}4>9GNdsqF=(Z&(swJX<@M4I!{Rx4{=c7G0-qum$3rYLjQL!2 zXH0O{gTrL?8TffPUf}<-us*`)64oyWmmb3}&9p)uIdySQ+Lu+r5e}$wxuoGvNG6Ch32tI=$O@?$J zlnzjqNn|K~1>caqf&wHSTjXVgV7Q?-<6r+>Jch-6AP&?}GWbgNa?leGL0} T-dhCS)CwG-;qTKrXm7Bn1~$iu$mafh;z=*3KF! zeW>y)D)qHbedt456{X5Ug?Q|bs(NO3fyF?IQpuW`bM{=m`R2?S|NYOqzW_|(YlbPu z-7=gex6P*IIZi_uwT8uQ&#>%G*A$-Hs(CG!8>`&i#k|p!Z2;y@l4MmAjWd5(JN+*>*f)LR%o9V(3kk{wWRi9z*V zS%Ts2MX87|OS#l_XXEurxFNT+8^ST~e?AE!G)SWxx&+ZfkOl3dB^I0w+B+*Vbdv9C zL>DWJm($4MvUKRD*sr*`!CeC09c-`VSq)>!Y!aqtCp9yt_a8B+Si(EQV%9&^;r9{l zc#`vw@5MtnnM1xKfXeNvdcaf{(nq}mzoUG$Db<4mVf z!tD+im|}QP_@EGSH+kGmA&z?tn^6YB<`7{ZNDM7UK6#$6Yer zI(Pl@(2pBtkS2)-639r3D)1pg<}la!+`U%O|(ZT3t9c!_{*=Z`D19!IhTnSv$OJ?^?p5S7h$^Wnt)8wYF?(&o1?5 zHE7Y@70c$!t(|r5R^_WBUjV0OHr7nnl5(ibx5quY&?gdfQm3!gsVRkSsa2=t*7#FP z2JR1IterxJ+f;^eDl8RQ`JfR46_OG(Ycyx&`*KQ0Pl*4G`Y3rX(OSW^Bfsmue+C_p zCB96OK@o^t#EX9*{i|>O+&7ZSJYLY44h+zVE|Q`UGRP2&(}8;11C9JgAUa$0QJQu{ z1HVv41;>a+&j`eD14DEJ+ntBoQH-7895D3J(Y7Q*^iKpMVZiSwy*z__znUHU6O+Z? zapx^QDNgJmUA(!6-r}`A3>5p-Jq-VL1Xi+}#4w#x!OwX&h!IjKi4D$EuH-2yGJ|~n z{YH|PuOOXzfNd0C(bt?xu;j4^qnrsUb)Y=%(^~F*m69ZBF683s_dh~o`}nkyi^pjl zXG^(wQZAI);>68s{pwpx2XI%&BaT>F(|nq{2tks9_7DSCF-lT^B1YlmQGAIi&AXIx zhTJ}TiC7u4{_k@ffo^}y`QxBJl5#{K WBajuiAuuG+A?VK&t_buAeDNYx15PkOMt4nCME%b|TD9|Fc+xCEjiV!qyrAR4AZHbV2K+e`Jn{4dJb|Q`u z2Yv`AuAGoKpeRRv6k>Km;lc%wEYG|*^X&1AzkUDm6~HF$Gd$JiEYw}8L^pO?CpL_d zSSlCB>eLA9OfPahBf~>!`qJ#ajbzuwS}j#|rz;eBMKFe-CHf*vggOgfG+Q!qMR*K_ z$FYjt69#X2rBOy61s^#S8FKDTY#Fxe|9kls!^U#Gtz8nUu+{HS)lM2El5j_!ieBQX zT8-bJ&Au>gX|`4xK6qNh%u@6___~ut8P@*pG=`~j!M=3jL^we;@lM~P2D5Yv2sSf_ z6jEDQo2ZiwhU#!I?elr=^I$mec`0=!{NbQ9dhg8-2b+AIZ5K;?^r655elQt$i+nxz zYV__XWhig-v5-%X+GKPW0xL}{l7=*v#`3bZ!!S4Q%xYIU>$H)pEfKY?RtyjSt@A}( zW0?3gd-8XU(Z;T|9Zj{WPb5R79xM60*J(;~B$^2^({&wDVS>sd{F5x#l#-^J2x}$% z1^-a@OeFW>RIqT+Q!ehvMr>nJJX127Sn{|)Oe%gvmXl4ziF;)Ch_6s?a15`8sccPS<{VwB;WB24#oRHN#XJ^{QLykW7H#TW$(*Y{0Mo1I AwI=n$0e!bCeVfei9>q%fKr;Yv~h!U$f;06EulQEovpd}yl3sM zEuK*R4PJTTffocQ5=bcO6XK6T%$}VOg+8EI=i8aN+273kX6EmIe*Y7|2I>s=W7YBF zzL2~hnmCTM-;P2djUUQaiff|=Z8K29-xq2q)b6)!(Klf%b6^bBBR=GQ#AU~SF_0$g ziA͌yXJ40Js{6bvk2nCJ+zf610wS`LcHAe)DSJVV-i6KaMBjq4?~#gN?&WoRBV z%q%r7vfDQ*l%1_$xyi7YfFB9dQaqH}=TgR$64j*r=YuHXtw<2i^c(IkH;b4+$wL}b z47r}rns=zQ@_$1y?7jgY2pZkkM4|MLhCO1~2qk&sKNGL`ATo7IA>lh#dt7ye+OqkU zu9lI*j7?+GBhD%e#9@-wwAF8uzZNRwQBx>QHN6a;5%phWsNM8qe=)e*)Zh_E`Fh;z zb4hLtJJ;lV@f?Fln>s6RPZ)m44JVt^8>Vb%`zn#zN>o^tMuc_AbhysYIz6s zm(Fe@L=}cQ9+KBsqgA9Hc8Xh#`3#8} z=TU8C?gX==pr4UX8crd19zIJb7O6T$nkF1uY`(@)S$2XsdlAIN-E)^pk|`Da2R6SZ zm;1lq!N@CxC*OSpOGj5PDt! diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/infrastructure/Success.class deleted file mode 100644 index 7cc9b5cc5355daa9d27d2bf8878f19804c8a28d3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2686 zcmbtWOK;mo5dM~WQH*5MjGc$;0o#t zm;GS7Ev>B{-kut<+Cx+BE zmrJ41c)l>mERipeVFpR0($J8hpz^sR7|O%u8qr3Z8A95!BkuWIoPkvtvb1}xM;FT% zsu`FVQ(KJ_y64>9;sNb8+Qrt9j$2x_+Z610g$*6Y7*02R={jC%XSYRNA$j20 zZmH@io`ut(mN?6Byz!hjnosP&ZgH}xiikUgivytdBoiH1VIza{xM1KME;3vlvH=bn zr~abNQz%f)MD@mSeb@@^jX|Y8gG*@?G0Si>|DQsrOwOQWAb~PNeL(ho=R@Z;h~Opu z%Ez z8&p;|8O9DaT;o_kLNoUF!keaR zhGy!aXwnmNg#Ocprl(Kr?-k?v{+`LM=vLg)9#{S{+^}lni4-VH zKHlBy@B`Bvd-G$`QmI{`9O-Rvci1C;?+hm@LG92zpV>B-Liz!p-LV@@;d=~I@AbUg zlnm*bv+dEG3}{GBu6I1?w0PCqb%e9&^2L8=6HVgoBpqFGJigXxZStUQlZ_hqe#3S* z?7&fSq&(Lj>uswZ3Yw*X+-OqaL~cgS?*t8g-%)|byTTIR>})T8Eje|+%IIVidgC3C zs8GEnR0Y9O?+_y9bCNXZB-5a$wWX#VX}bCoctpA+*`1_&f-KTdHM>GmiL}Hm62;$; z{h1aTR_UsYfh^YOn&}!~1fwK%LmnZWg`;%s4>Iu+8TAGk84!dahe^WU?|ix+!RP?z zE`q5;Nio%jQ9y^bj}wSfv)0G2kuUy=%db!=&b&mnIQ0?}#o3oQ{mWaFiisp8nIi5~ zy2Y+@lrDvdI94mguBJkV{Kg_OKEh+t9Z^lKs+35kRzE`@LS1&2DPW48oSBFxzWE*r z?e;`GMGGT#Bl#MitQBXbW?$jcE}|!77>Ab5hR2|=r3i^h)W@UUV)%k=G*q!p_it;f zi%*OXRlo5le9sug+VsKdzA-ahnf{>Dkgtm9#b6XyjLO-{rEBF|6{EOpphnPIl>aR% zx4EZ?RWTp_Ze!s<`mBmOSR^g(J_QrFhoz@DDljUrEO1{SDPRgb5I7cIX+ghffwZ8n Q9;5_v0+RxkP+kxJ0o97DTmS$7 diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/ApiResponse.class deleted file mode 100644 index 5a17f40b3b3190462914368be00629c352dd9c8b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3611 zcmbtW+fx%)82`@ZN)qDcW)Q2Q&`Lrufb^o^1@A#X3yMX0aS1CdB)jRJ4O3oPpX`6o z8DBf?v=2VCGZi{@rbBh65B;NRe`j|SmP@7B893+rzCGvn-M^E+{{HQEA{wA&MtQ?r zC>k|YS8AGN7!_VDS2R_(idAD?1vgUDCRJWDbgqVoF_M>*6{T2F^o8QBxh1u1g~-Rq zU&d)hsjf`<|-pY{g-5ynqfOteM_)bY~no)7AY*dR66>h2K z7u8B}NhvRLL-&NQI12u@3I9!N6+Q%3lu8|D`MPt{F>0f?BIKtdjI=j3qcpZ`SQSk# zF0E9H8WL*iN~L&3eW=tc$d%45vtG6gb6hc(k!oReVn+ppsAEgnI8KM?gfQ_?1TpOr z)GtZdX)yXKwvF#4{0 zKT14Ru%A*XdG0wKIkYd|V$?$g5&J$yVasr`!zjC%M@Mw2u2tq$GeoB&G$^Vn;Ta9x zqW{l@={*#`Qo}TvXVmLWje`Np{snd@Mjy}_fqZt`&8APUyE!awoU=VVrQS%tJH|e8p6+3LHi!cY*Q5q6r+MTXZ`@6Z9bh+~~e>)l%jaOF@N6)fFE` zHxr8tcFtx=uo%M(16`W$XKZ-mQAb2-lOmG5@hE~nNe(+(JR*hhFGsQa!!I6(+cq8z zNPX;5E*S~?WU1ZX#`=6V?YHTGO$QzN#kWC84vork+&OpSH z19GBW>VqPW3Y&IS*tDwx*O?8O98Jk7TuTpx<%|u+ZoK@)H`*c}gwzL`fzE;s2zoNp zFdnxf@G#Qu4~ONJ$&|clya)osQ8@;&s~pE&ajP7A@nf(}#1P|#Fi;I^Q8m#FPO^Jz zs>Lzx)LwTMGm3kf;MB6k=y(A}V_d1Z*pVrtZkE++n$Uh| zt0E6R^1QaGNYn2?~>VKg+mP#8|gD&PBzvOnXy*V8r|H*beG?RrZ18R3LkP$IYzZl%SK3ut%<`h*XmX~+Lz zj+0F?zDcHO0q0WUoXC-9#l*lv3yCoG9ux<$7czeTmrp3nHt6_R#vgF$&hd;t)SxHw zJ%!$NdfRbf5w`;5i$$Y$-r}$<1d~#91mGQj$4?JeN!HD3G|w25Lu{Q+3JgNzyPNgU ziNjm!0q;7Fysidv&D41>+cmKF<@~Of?Y!@O8LuS*CjxjKK@hDGeNNJh6CY7J4uq4| zXfv(RW?G}ov_{>uHp;sfxBqvFTj-SCV8X)7+fpq0t&w8TsYZ%HXYCZPQNQDYC&f&> zm~O*e#4a*5_?!l3*6H2k`)f2LP}k^u@}fhhuq7`!bXL$;u&mKF0leAD!dE69T&%*> zuTew-`HVoD`IB1KX!HjP-1EuD7KN!^(E~@8-6DHx0}8u`DL4_L<0I@9Mg@j|}mdpgte2T4z8uxEp$abaZv|G(1Y6FM#o1edb8 z6u2z7tjz`dPko!F`ANbfF4{9BN?x?5M4G)Sw1oXDNT*OLcV@{~qPzCrG~H`(AC+i^ z?n6qmv&1;Y%_p;Th*K-4PcaVcHEyqIF63cOEu4a!GMo~eWKP|ja-8yt0-LwyX M#_2kz0ZtG80e)!lZvX%Q diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Category.class deleted file mode 100644 index 630089b53ed2fe8e5c9966dd698684875ef7b912..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3046 zcmb7FTTk3Z6#mA0GiCwrZU}^gBu#)U3&cRuD@mJ#+?MW=6jD+`FENV)hFzQ5UQ}MH zJVojssFc@ARr`>KR%)PXq>3g|ANr%3o@1NE&|HXQ&zv(e=R0S-^1Vte3Et#%BzYn^PfC)Kn={19ZBe2t+WBS3R$m^s(ePEa0a6uZaXk*V=f#f;U zGQAH4dh-z^f0GeCH0+-d&`K4%rrpzB&v3q}RkdZkvf|oSgaB=V^qUTC!|~RcgEhTc zr%+@0{+Tompi@B{hXiiz!(*|uVtZB7(w5h1nrV?wORs8|jeB~%>WvfGo>Q-Qwo}%f z6~h_h09$wGDupAvavN+Vg`*rwyFx4+XX!9YCj=DQ-KuR-k&Hx@Q6juzudWM}_Yw7* zK}0T8u0SDt~PM8%U!Mrtiy#OY%_Xcnp*HKh(4HE*H?Nd@V zJbgj;bgCGswics%P;jG?I`6Asm990hLPHB9LZr6t=M||_QY3ZjzCxd*HU(X)BFW99 z(l7J0%)R{df!w)ue^eS4m%6ix98;yPc&8YS`EuNs6Hk9gN@{XKRnx)T^=A)a{+K+` zthNMecx<9iZS9hV2`&QU%OMag624*EL{3#{X=YSbvp#^h{_OkMM3b7M(E}t4lG{m6 zusqei9Tr(Dyrr(VoKoefoVpXDOxvVkMQwiibMhe5L5Cc4UD@7};ZO+&c^g_aJeO`5 zV<^1o1e&)?_wbtw+ z-#&yaw$NSbPK4sIa$#U_6K@59>9i~ksaf&q<102v^kr~_py&||0o#4|KvO}8q}aqs zHU=&0X(Z$%E!~w6@fz+j=xrn+YV0TB^~UrdP~g1VbJR2O$`eSl{?<5+0YbpD(%@NX z@T`P9Z`VbhY~GafCiJ5aQgmiF=UkQ{=OpHs^9>9Jf$eZkZ%KoLv&20Un12Fob`!(d z(G9%AFdKM3I~K?}>aypl*}zAPwNus{zTgKV3}=?YVYFUGnEe|~8yNoyiQ6&t*b)a6 z9lHC-H|DTTAU>Hw_eJrXj)+K6ND{Tjo)cE6ah5OR3e7P0*QjUiM+yT!VqoAeNDt9B zum!2ieh2CQ9UnhLj$M+L^R-0$QEbO0Ro{^CD>}v4T+tHd{q_zj)UVTMiSkySL#&8N z|GR;k+uA2ZOktWvacd63#iy8=;{(&;;x-){zisu~b{DdXCKpK;s*8+^9v8hX`dplH QaoJz*zH_vH|MUA_0G99-!<^$DYEGNm zM%(lq$MUp>WpdlsT27ObwCy&zo38kV-|=E#43G39qiblEVIOKmyVF|HM~JZeaG4=_ zF+dDqhIzf=w6v#&=X3X)mZcpTjbqQTHN&RXL69Tv*ImQ3y>rxi+Lq&Qbu5d#)QlK$3ZshOn;iCNAEobg-K@$c^=RKf?r^C9m4Cp{<;rz@nzNBdwN9^%nHu6W{E^~AK$deg(ShZzrwhcOT1 H9t!^gBIfhd diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Order.class deleted file mode 100644 index 4f0ee8cafa6bb73a1f79b4b0fe21e243db310fbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5914 zcmd5=>r))Z5%1Z19|zh6Avh2c(jmkh;L|Hk1Xg4{EO7{sEEH@>j^pKS1q*k(=bb%b z=i$hCC{E%e&P!GLnyOUt!5@;UAf@7}M3JlVA%9H%fmFr$&FtRYf({@06j89--81u> z?w;=HUjFspzy6JgPS9@{jo8jg-mV&!UNv3YF7te`Y#NrEuh=C6+*PM!I5A?3)HQuW z&zE&;C4Y5!%_zDt3Ncd55{BlQV{^8(G7a200la3o%Z_eZJg-}p?dq;+gI=hW%ldNJ zz_iGU;TC|(@HQjPe z_gzLkflUjRYpfU!R(D|4tBpCmTU4vhN>MlU2<`R(kguB6i@Iwt8t?#Jvts10-nqjK zSIBRG^>G&)Q}@?#TTM<;KcxlyenwFa$JJo|Lj)TBiGDMjwp@4nRiE z=kRsc@9g4dvM{hyUB~Pa95n}P^LKRa8qPbFa(+!Ou5;T81aN*9{51z*=(z8~`pAY} zuE95xyIXn5b}G6n*6~%nighQSW!=c4ScKKl#T(ZP3zr$is=5nZEgVj%G&w&%`7VBj zS68Phl_`#>35{i!Qk0`pNea^!82$bE@_Auy-FC~Sm0#PaS#k zUKY+BPa?9<3+ju4y2vOglE$`hl^zc=CxXn$Aag3n;GCKOFX93$+Ev_Fo6pzT?e0oJ zux4at?obVER}=)yN(m!JO5V{k`uEtb@_9Ot$p8N(5tBOD7BNp z81nIg#dizbbc$}#ZGrg4wv`Rzc2GpFd{eCa8tj=EmK7PQ=%}v~!}SsjK~W0oB@_Z& ziHV6}ujqk=53rzKf*>#%v22{yQ?y7o#0C{?u&VRb3usy7eOE}4O;vH z(p?=Vs8lvW=)#zIpes?9B};-uU&YoTDjjFap~rVmC6#_9si=?dCh@DNiKG%2d|a{^ z5>o%Ac3^N2gI!`${K>s||KqzSlw)j)WzWxdC*vVi83^~YVeG??@n;>c51VA&Xa%Q$i9RYOeL|i>0w`DV* z-VeOeT&rS5^;cPvnaya#ek?S|afFd*M6<-WGQ zybtqx)qU4{R9|z*#R)^)ucjgPjcAGo)WIizh~`9~psWx&3fo;Z9MK#29b=yt+LK5= zjv8uA`rQlyTHX#Xth_X@)t))iG8Sr;Wy854dUv$! zb9PZLFX@gccwczf$6E4`uIY|mLF4FbfgIVsVe4s~u%fs=uUCESRKcXUdy^cPF@@x*F|i38ZZY z8g2`;mwH=h)VCcd(-vre23r6PZ3h}_3p7lJS^#CX15LCA8l|HxfU?_x@@;^aXzXwy zi&Og$fFfQ-bC2l7-1sJSkImuvko-L5&8(gM+C62^>d#nS!i}KM|kHx<|pueqc;|Q?*YZxV>&(8 z8;jKG`QBK}r>7TsV`>~s0+Y^6g~6#lcXlcQZrJC}O+|C#6O-w1I+Bh)q6?l+e}P@% z6isz>bar;i#2J7;Vo01G8itoLuyBl~@SKsEhVLF<#{p<4QmiY-ZRA^UvCOyji?1|t zEVx+aSo_83bP?Gia@KL0BG$A|NVyq2Zjr1Wke4=EBW<)s+Gvfm(Hd!^HPS|Fq>bjM zP5mZa0QU2cLJ7J`*I=b^#KyK164jxeLZG#J3W4rxq!5^)W(tAJG*bv%Hkd*W>AL6B zttrGr7mZ6o=upC2g#PQF(9+FE^ji1LhxAq8bUdWDx|cm#6LiU=`viT*qlW~&>d_fN zuX%J<&}GmM$rAfF>zOzOCK`3m15CrUCw8xi9dG`V5)aAwJw;v%sRvgf(t@J5JXv20 z*-#5vriCoKMfR~&M!4q3lv;?<>2vHeQi;Xj5(UrGpFuaD!-!U=V>G?v$eA5S&h9vJ zE;xcMIl2DfypOl|I52bLzoX*#KS+5%Z;n4EWnTDe0)Ky@Z#>oBg#4RG)NkFUP=UTJf8V3;)VaF_dY`@vDShuYF;3s7AKa#KPMw_Yp`6KQ z7pHDX^m9scI>6~5rx7W^%u!B9IUV8n?<*xZ{z*!EIPK-s%c+Oc0H;At!<-Iry2R-+ frx{KKPP3e@aGK*Z&xv#TAt#&DqQv}w(~tfKX)f>E diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet$Status.class deleted file mode 100644 index 280b4167bab08ed0ed10f22b766c63fa92a5fbe6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2093 zcmb7ETXWk)6#iDe$*Su(qRp*=($;|OG?A0GK%2CUb1N>Y6Qaam!c34IHB}-@8Lgaw zx4iK`c;XQ#PzDCZlSh6O!&%8>l5rTC8ELiW?74jBJ4gH1-@p9{U6g_`e^A0T6 zJg@`LbGX)WY|9O_wzp%Ev}Of)BQS#wPk}K!)c4FoQ*%srS6g;F?K%Cm{bwJ|GGx!X zrx0hD)LUL#dv5Z;^1o_3+Me0k=bo#XuIo`|o3>9$Uh(|48BmM_e_r-?n=F`EwUQ)|n$ zrE2X7?TG&!+udb|8>{*feYofBFvxS%4A%}GF~kbRIvM8c6@7ErV7R??A;jvbz8Qf} zxd_y)FvOk}G=0-{`6_Nzo`SI;pO`k{05)nYw^w{Sy20yi0k^A?TbwrjSnZO^BNxHO%7`9Dvl8CaEI zhD{;7Q-$J1=*-|MhD6216o#m`Eyr`IpJ&-wZSGmEU^au>m{c%PDfaDOwMP|;q{bC{H=thj2Xe&9fm=D-wSBGv}aae?wEl|y_VXCF}fL;SaKvb zLlHuZ5oi0P+9C3`yGN=bjYx`=%PHL>`eYSJPRYmLu#xW3jI730soXs(vxNa!Qj7OmF)5yQCu0%rL@%;Rxg8ffew;^R3C=Xj6oS{27{4YW4QVMS5^vZG#=5tM;p2Xr}hJe z(e;iS*lnwBbDMtQ%E<*qGjy$YR&@{0IgKyUb;>ZH+pbmXw40W{5nTeR?zK#(Zu+*6 zd&;z7@49s7`s9+Sx~}Di9kwWqVt5_DWv$qbH9t-DCa5)u`B70m(X~O6_-5$6%#o!7 z;-UW_M+Zbm|ACqt6T?kmRPkGr!6xmK^c@k2Ama^OA*oJM6KPt3h2$TQ8jaZRw5kg+ zb@3IJ8!z$1Xv9O+M{%_psXjIuiBP2{)Mt@u)p&{04-|#rQ(Ch$Ygs(N4b0*$<_P2{ z#;8n@Pa_)|3M5KDVf=gANTG`W2i(VJw2Ha~%r~hvoPjQhQRxNRpd@i&U78qwg{4q5qA4a+6e|y7WF2LdsO`U zTZmQhLHK-#`~ON0s>JCWY4LCijN=g=Z{ZRb&pa2?LhE&oQI0VVg=2tYkfZVsL^$gD diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Pet.class deleted file mode 100644 index e16b319a5abfe1249d3f6da5f77c8a96da207858..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6141 zcmdT|>r)%o6+c(cl@NF(z#w6483P7MSeQK8+OcaJ$3Yl~iyx^=>ShsZSP&A~yCQL$ zCQcu2lD^WHTlev$GoAKBJ~T7M_B1mY*O}>ue(oR8|D!Wae`j|kEg)O|)@BCn-gE9b zzkAQ~-sKFC;3@K>P#(n&j0UX&_saTcEW(g{t3%ij8 z#jx~+hEVs&XcMs*bobqGOYt?l&a#^^AO z@Zwo4{+v-ZtdoL19Pvcd&E6)7;1RMz)@sXj_dbzZTA_K27`-AWKU1u%=dWwh(#_Y` zOZio;xF#!QPmSfLL0>RYCZ=_RlW$WiRdt1eg7&XftdddAuWqjAjWQ6*S}9*BbKOd# zD8n=%sHeE17uPOmCQ1_$1?g5S2ioHarxhIca9jtDUWw7u^h}hVqGuKA5ab_W));*u zN&z}1=wDu#&w$qpGtInqR==)QOV%WMnq^jtR>hpv%r)IS&Oz#EG)2ysFr9$+T9imF zYr^!!Fb$vsw2*J)MVQX8e~(0w-e(0xksuqDGCKKDFM-fDW}fmAPkV`Hyu`C;3&qL? z`q4i>V?k@#1K~c@MvSc+TykP5MBB&{RAZBz|9@^81y6~(Mf*g~iO~$ra!Osm!DLmO zLPdLMq_)F4Q#DFUx*4X6QM$zS9f4~{_;zqYA=E-h+rS+Ihu>I}6xx06yKp!yzD!pc z@hgZ@E?qy;0s3<7PExguQvS4QYB$iju5p9%2BL24&K(1Lo?eO4*GNNm%%zPbfEIUb z@R8cy4eGqX>o|dP>7sic18N1QV=m3dDTq}#B$sxMJCG$oVpO3rZz00k8}ROmCRZkL z>9TueAx0)i?v<9Hy-h8$MK;-h*J`e?uV+p`!gM1{d*FEe)vCsKpl+|@Yj(k{ie~E1 zvrNm@URR3IoAeg9_M3v@wZ1s3TiTLlX{aaP`lcWEOTiBnVXC-b8MNOX;n=-=yhIVx=lUktYT~KRR_H5)aCX;?vS&d zEq6^F#A>ig!PabJCORe1>?k7A34UBn%*UNgH-x*??)jv5 z|E@wW6!xk;z;C$Q#ZRiK`M&LOah3X^)Ti!y_@~eq=MxS#dV+5Q=h_;qSSz}T;;3CC zdz{04Y(uvs4sm_Vy-+~}eeB2@im-3KTDFXJy-?mXq=6g#>BjdA4oIhR_ske&eXhE` zsGFDg*3X|tm7-RD^;_opEGzf$?fZUmZPKS@c|TQh!XtC1z-NmrqIRkPViUIE*`#FJiNWO96lv> z@o?kc#luB>2d|Ujq!8cEe-5NPW)V^fX8uBLf5yN^zrd3>Ms$E~;~8@V@NNg?-EN#z zfb9nA+zB+$5~zoIn*gPD0u4O|h#eEBe%jvzD7_PCq$SWH8f*eIyb~zf5@?h%O@MMc zf$}YYaAeXEGvTGLcOjy-%OZB|eX5<{ll-WVfg-liQ-s%-9yCGReRer8CLk z77b^Tp)JaN2(3nlV{jLTc*;R@L(KoOaB`DJoRL0Wi@%-i!)1a$WbG`T;IB-`@+@as zh<=IjBxesN*0{u6eb~_$b~T25jp4z@@Gwjy8e$-}v-ac=17t=Twnb*{-72%2V~q z@haPu^EhRvS_<`Q@haQZ(pq`CULjs(yFywkpRZSiSJ|$L*2=gnBMKbv*U-z@iT&P6 z_=tR0y@BLXb3mO$@2@9%e?8Ir>xtf9PxStJqW9Mmz28lAZy)?$Bz=VD=tVc_H{GOv zxjP)-q~~5f(;W`F%pj_fX|^ul}7Pcd7bE3clo553GRI$*lYIy3KmU;ibG{ zE-&4LH{3)ww@vN?EG&o}^d80L!u0ji;!~WDA`Hj)@chQ7n06`5#B1X)oqXiXsYlM7 ze&o!gcLqzoLEm&k^fuo7abRS!f1qOaZ{)i}*Rl`DH_QIY;dh_jzC-8PRiF?pP$xj8 zK&5Od4=N2RZBqw94TD0!AlV5j2P$V%!N3RphD$=^`#0fc#9cki{gK;`pMH&J6x1Yk z_Wr3P{RXs;eoDW^`(yCGh4TFN0{IK{9sBRQbgM>vuR!n6yWrA$3nV0cpMJ1FM71k&Buz;wNSc;(Ueb)DSxIl$_&=6p+JkvX?@Rj0e*r9zRTBUJ diff --git a/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class b/samples/client/petstore/kotlin-jackson/build/classes/kotlin/main/org/openapitools/client/models/Tag.class deleted file mode 100644 index 7b2a6a300d7119002c713acd069c79884d48a57e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3011 zcmb7FTT>KQ5dO~WZ5S4q-4#KUXb^B&zyUN@G*R)wk_8PA43dk(GQz;_44Ijw;!EO_ zKOt4VrYe;@_>fdZNX4oY(W*S;N5yo{49h@NNY%_a-RJV1?yvjw`TL*W{{S$8C4ny6 zS=Q`z!_wDH&$cVBR<4+a?sH^&hu2pnvS-ZKoYLvYcVgiy$5Nc_6 zu4G%wqXOL}hFvwhMMpO+SJN%a_H@s*NuH`zD*9r@pk;|=!z&U(Hs7}&BaH--4UnJ+ z#Jv^M-2r{Qtppmk^r}Ia5yTnKF@3vIbl{XfePqv(;es@p(ZYvj1(Fv`%k(}F=*dTr zeE%YPxUp|eKr5B)s&-FzJ;V9BTG3YZ@|tT~5#O~5(r-EBf#cn0_c!!PjZBT@`{vR( zf_4RQ921y5#EHeyn(b9gOIzKjYNkbJT6#shYTVOn6>p4q_MBSTvznbHn4eb zm{K^gC#-=hDZIg^v?|2HDVC12)Fq&hck8xAsWBW?Mu_mTy?$R{{18_6`FU|*2v5H* zeQb|2i0Di6x!p^F%L3o#4+9>F-78{Qj4TOKee_Ufr_qZuOjf^u?AZaG0&Tmj2SZnC zW@X86QaGzX<8Y_wj^)jzi!zAWq`pps>*fj3^3twoFPrE8Ym6s{A#?ikk?N8rp$U?RTPfzudAQNayN2xN9{#H8WrOS-31 zib&Os7*#sKjY{gGuYy&oUSf@gmWG8$Z9m8>QoE!`>h=SLK1po|x@JX^8%d>K=4qLG z`PoCcefz%nOj<}ps<>{QdYobhU(y*d7KKm(olvv6UIS=9G==CZB$6??DlK4AT{kQ-aVd zz;6(du|OL4DeANQMC=<&BLf-yZhS^7G@2z2ktqC%#-B-$@Hw>%035>?)TV<4)Hjh9 zh0j1Gu>S((_5+x-_pIKSA=9XWsJ}h)OU8qzj*{%Y@@T( znFz&`lZF0)ExZ{Rrqi-Gq(;T3j|*#(=*!>)LD5?o0=D|c0}TZsl41*|c{6BPcRe7d zY3ZJThy%FGpr;;$=w?3%2XCflfDC7EFHq0KD^DTK`>t^q1B8HQrOvZb=UEAP-pPwR z?fJi)H=qxNkfL*YIp?$tIVUm4oNrhS|h> z+0j7GQJ1|)%_cr%tlhL`^98>Zp*izp4x{xj!u(%o*u>b6NZgL8Cs){@=+NEA{$@6- z3-PHGIxmYCbVWppOp>TQ`GT-QjiY=O*Jy^hzd=27KV0bl0sZ}dLVASW{%uH;eC`1K zzu}`t$nlY+<$Ns>e;nIAlCp15_!*sIY|dy2i++0tW$N$KXo=!Bxqw&^Q~q}ow|2CT zijz6+W}q*=0eqtk$qX5{Lz}EUZ=#D~gbn=x%`l$&!sj z*_M-7iJiM2T%`xUq$-s>=pm^JC>2+^B)KXN`7!wesfzNQp4pw*W#iRTN)$|=?@agC zeNK0O-NQfs^Y<@_XqrA%C|$0u=gSqNq*qL+7RX+3{sWz$%-!sJ)TXRhJZy!&pxTv|V+(8xUVZW`7~RX0l_ua`UD;wn!V&e8!*^JSM{qlK* zq8#&eq_~DeB|K5jmMml4s3I-hXvbmKYbBckuh)xFhQ>MaNrgf$nkCcvwnCp~JdARR zJ=jUv|HV@u<@l09`T5myF@F=8HmdIw3;9ibbxV{>p0$>r1HM|tim6(+c)4xsg&H#G z&x|j{=qOD`DL~&)=+Uzl-t7EV*(#W&{N{EsZ(;_qRtxzH#!bCeu+C!>S=HLARjw}R z)h)~|XQQWi4~FTRO?%d!q%eI;p}1SqNoSa5I34*Yru{{>jf5w_){uQ`s?JbY_Z~D`NcTOku`f375Z1^ zsn|XH>RH%%v!3zT2f?YQ%TkOk(=4y61xT1xwil#AeeP&t8^Wjq*riSK_+wF#bP(bNd5=gsTjRROHBBBOUp(KU)OS(TYeAHJUPTV%LfNW z^9H7La;R}S!1DuHrG6B^@g{~pIV6Q2XhpuRD?J-R-{+QU0h{Q9(rUGzkKY6wt8nL^oxGN3-btM)&ngK zLAyTtfDSdG!%b+g2@N%&BOat_!xF_B{q)b3wDbYrF$C-hRoYId(sn|XwiBwfolvFi zgeq+(RB1b*qDw`FHZqscM$zT-)2cQmhofBn>NEdbM9aX7p?#*n9)}%d`&vSCdO>Ry z6L%n>_GtUyb_V6THMo=Y>4H0oIZdE?TpbQWO=;B$88f{B7)=D(hktj(m`#OtD4k7(cW5k|Qg4h`$Tvd&x-P z{d=S;59!2wG7@y`lMBg6xNa{dBbo{jL8X&30U)h`fGmJUZ#2Ef>VYq-XscqX4gdlcA_o{u=^UK05IT+0?^=0Lll70GYwGy8k=!N z0WjAp3cIvuPfe>RDEy)294fa_@(!+iL9Z-7pliLa?$UR`*0oDFdcSYm2^76QwCz5& zb=w|bd)2lF**0uD&Gx!&kFjmqc8)o>VDD0qN9JBocuE!i#

          B6me4Us6OYBEdPTd zyY$u{Dfqfy8{B{^;dQ-f`}*4W2HN-r+xXILd}D2VxhCIzIcQGqm!vI*>BL#(2`*Vm z7%BDPdGZNja1h?a>-Mwo=9G7A7-p4(vmic4$=|FWWheeXA51(V-#vPF;vxAKcrGUK z_cywAkJfn_fD#fd1N8y*N%S(%0MLL$r-2561|`Y^rGe5C9RV5x8j~milmp616b#(= zyD1Kl@89&HB9H4ZA3A(o`{=jw`E&Xm${l#$h2s3^2Ki^{w)}mM-mjw%X6X)n2rvEk z1}OrX_R||QA*fr>N4QnUXODdD7t}B4pr9c^BZ4y0nHO|OP+U+_kSZu5C?qH)=!l?E uL0Q36KPuzlNJSxv5{k#nCU&(jYEEjnNW?4lflE zG)Uwk!5jTLFZP0yyKoNN`<#28b1&!qdY8kjEDF&UM{bdnHl(JdSVWcO9={cbj)tI(&m0)9x$O_oVa-oTsFVXPBAZ25_}6^(RnEONlX@WTe^?gr?!c;@_)g ech3np0Vm)DoPZN>0#3jQH~}Z%1f0M+5cmT(yir?p$K@b!~5idTIY3+)xS1$p3 zYD+u(@+DuAM|YT!vzsBGVF}DZ{EVX8W2zXM1|;ay5%D}H@R;40Ay(+d3FCwo?9q|l zLJETlBQglF%h04+zx8#%C@!I7eT{BTQinJ=0YA@rYG&^m2(f?fh^y6MLR5eKAL5iD z3opDZ^ppv5fI3_tZ_ee?0DnUzYBUE>De#pY;I=Z15NrKqw}(=spu{%@H13Eett~#8 z-wiOY8BxJ^epquKbE240Q}ARjoP9i9V3u8!8I>A>q1K|6ufX^AG#@b&XJx-Oz}{K5 zZHk|ceKvsn+p)#5PEzpgSZ{T=>(e2{X=o?vt${rBE5Hy0E8?Y6zZjritDdc;V8IN_ zqJ$)7c7r0NI{0ppRox%#>8|Z&*lp5^|7s6^wH1uc1!L~}&Ygicdef@>s}M8+ZwA2E deEZD++gM|zO~}f~?Nc!3vTHXR|JNTY@Bx`AznuU8 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.keystream.len deleted file mode 100644 index b92ca80caa0659b9a68734e5c7672abddf481663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00F*r007bey#N3J diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.len deleted file mode 100644 index 8fe89d82d540f0f9c8b866f249f77e7623cde7a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk?001fgA^-pY diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab.values.at deleted file mode 100644 index 4fa36e1334df1f2ec8e7b6dca4eca0953e92cdb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11858 zcmds7%T5$Q6s^SA$+%+cjzw>wqkk|NArLbTVNjN)=)Tia(ofT=)o}1W^e= zjR^_y6HMH>Fy85xlScO3T1+yJN==oh7%o$Y z1{&m0jK|v+ciqZGmf#|8 zEiNv9j3!*jNSU0QMQyM9Fp?; zs{4Sa4~LGs+#|8_V~(AX;-Z!9tNgedgZ`KCNoSQ7qOhkXn#-n|Ag{aMz z56$AU4tql?L=-KiX_vBTXV4lz%%0!VZpQH)c23HsT4@I@tGk6WB3|fB`>-l&etLx| zOkl+G%=PglijiJVNz`u+OnA?qV%igpgWQaSN8_=hfbElVr%EOCxPw%gJ%1eJ@D}r- zj`?$&y`*7KU9B?_7q=qn%;Ez9mvihp4FclwPRZ4zUy8H;6lJuAu-5@AW7bzcNNNe^ zOV3b+rICjB{Yf+z0sBUorMmyWw2OD)EVgVKVc0NN_@}BUnX(fx(N*Wej*vF_IPM_ihCB E7d8J4W&i*H diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i deleted file mode 100644 index dd1f4b65dd53913193b6ec9d909a4f4977a35db1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI%u`7ge9LMnog-mpm#Udt)46<0vN)p{An@u4ji@L>VFv!9r${_Wt_q9BAmvv@MnGXR11PBlyK!5-N0t5&UAV7dX%?WHqaba+B zD)sQY2pk+O45Z$v??+%gzWQe?BRmKYAV7cs0RjXFq$qG7QOzs+Hz~GhB0zuu0RjXF z)RRDKLzYdywT;))&2A+?fB*pk^&+qlhn`Iq7wYBSRPOwUkdvOip;UTw5FkK+009C7 z2oNAZfIz+i-SNBoSh=*E@2WKd`3k(nTw!AAGv8Hf1PBlyK!5-N0t5&UAV7csf&2va zV(RqasX4zzOMfYF5#vWQ2VZ~LV4DB|0t5&U_+5eRc-;Hq*3R!f)zgv{i2vy?S9j-< z?Gr|T0D*rla1i%Z*NTm)pV=Poi|XD>IrUC`wJGoz+3T0LtF>9Lng9U;1PBlyPBJke@ Fz5zm>FuVW& diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/inputs/source-to-output.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab deleted file mode 100644 index 9a71d23556cac4de8c63cc41ad133aea73b83225..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuKTASU7{~F)(k(1-2$G;7XzB&D1Pv}$L!-1tw1k6eLqm&;bKnvUO@cHvL@%Kr zq9LTQrOe9I?2mr^9qfWrYs>S%y`OXMxm-Bk^4fXQG_&Cr&D3zQ6EoY_5>0qB`i-_M zT+xKRrQe6q_tE}eUg`hy`d~(80!m2Uk3A^Ua>Y%_6^73;4zU0W)JcBhE9>}}zF zCX*+_42Ww*9!`53iJG8HW8tDo|3SSV-g|qvHB&}nq}0LI)N25z(AlPtbraSha%*DC zP$^n;ecbE{sDh?mJ4^0Th>j3Exq$J^LkXF(H3lJE3FA+0LOj(mb)}mNAv8i|8D#`t_6vNniI`G_ zv}V!}Eyw1lCt9TWsEKDAH_W2skSp+MPq8kf%BW)-_It8v{T=s5gvG|X9`qEOFUh_9 XWdqqjHjoWu1KB_}kPT!5|7YMErB5)* diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len deleted file mode 100644 index 55d7e48d140bf665ee6f630c52b8eb4041d3a716..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00GvC005%^mjD0& diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len deleted file mode 100644 index fa432244558c364281f5897ea3a81444683a68a6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G7f0043TY5)KL diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at deleted file mode 100644 index 173b53e8670138e83cdc4aae3e46b49d98a620ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5659 zcmeHLOHRWu5Vh2c^a9{BpaOygYSr>tkDMVjO+04oAi=5l3j_iLD_Fpln3NXrS+PLi zD!asTChyIA{>*5#f{-D%`)G)>_A+t1ha7B(=;8{5;Trf&C@LI8V#x7W9qElAGxQL7 z4>Mr4(G1Dy9#hUxmJqGHZ4r-x2ZKR(8C;IK>(LFUVuPCG5xkwt(IJBb)&WXi$Xruc z`LFgEgAAh{Q7o*R+W|8Q5;d^VC0I8Z*TnfWSR^Xmzn9=a_b@JaJ3or2>LeA+b(ZlB z^@%!81$AwRH_*50CIQgaZ8L<(m5G&@OrUqhz7ww`PvE7co|BYd^^+)l44zy-k)&bt zN4x0vWzuN$-%h$lqyK*!`GH1HE%lh-(i3KhnYfms zK|ie%ey`~Gvdm{B_YW;~pPupixLaX}9dg??7yl>CVh!VvGGTGoQn%@8F+jFZ*aKvt zaH%d5U{F$q(oK-U@IxJPuFled-jOpnC*GHor_o55q`b@0jY<{tkvdGrA<`a`JU5Vk WsRcRl^E%YWPa0j*3FNw<63nkn{G^@$ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i deleted file mode 100644 index a17670a8ff12ba23078adc25157efdd57ee3f00c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)PbhvIf+t)LJq@)16nO{KvR-Z^5>#V z?cm_(X36B}KrOZS%E>|7>gjp*+wZ;0+Ouch@Avb1+S70A=`kt{hrt5@1Q0*~0R$`+ zsLC>omV@SMOPkUR0R+-oU|psQIih`OJtV^+fPm5h1G4_`x|_U8htP2NMmcV=r|o0i zqB|vbm%lYvx7_4K00DgjTymZ}>O36MCoxG8K)`MRkDPa+ZTudv`#8`a0R;3Bc$26% z<>MiJ5|b1G1Q0*~0R#~E6*!Tn>?@xi4+Id%9D%SznVWVmr+cCY88CkNSeEW{G9Lm~ z2)s&@$<>t$D|*qx0s;AdztmR%${iN+5s$0thG|upl#zxWaV` zjLL`zAb>zh0{ybC?O3ZhPw7MKjKDtvyRyC8=NbIxZ8j$KM=omx{L(J8IpwsrE8SET__+|h z_+`Sa>ioLR{c|IUy_v6P-Exx`0Xqe*rFnhrLcX0dn9gxS1t|goWO0ZHe)1gDeEh0LWk*9` nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!n$PEDi_PYwp diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/constants.tab.keystream deleted file mode 100644 index c0e36ab9e46a26422cb0b690807dfcf4585bf523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIu(FwpH3;@w?l&(-ZiAXE~F%skcg>F%}`@O$+dOYG&N12xHeM#-6BgICGvNCqf f9V*wf`x^%#fB*srAbUEvZxFQ-@7ISG|CHDH1n*rD%~4wtuic zC7?&f0u2&s{6N^%>{bTfGv@RdHwGj@{d~qZebk62TcZ-gkh2R+-EE0mcN5GhP|;O3 zD3iFvlF_2aX*o)~P4GTYOA;)qIC3NSLR7>Z(}Z!+D-v2(q+4(S-<85^l=$*0|C#hI mXzK+USDw?JgxS1t|goWO0ZHe)1gDeEh0LWk*9` nGz3ONU^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!n$PEDi_PYwp diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab.keystream deleted file mode 100644 index c0e36ab9e46a26422cb0b690807dfcf4585bf523..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIu(FwpH3;@w?l&(-ZiAXE~F%skcg>F%}`@O$+dOYG&N12xHeM#-6BgICGvNCqf f9V*wf`x^%#fB*srAb9z!NtXE^K7Fb7cUn<-CP~}ANUveXNkL; zpx>QBtv1rZ9G82Sd++;kFEJ9)so1D117p*uV{CLRw#q6eg-dibI@INf&THv8WA#v8 zmcVC`Gl7MmLJ5O{t6+ywiW_X;fYBvJa2zFCh|z7xRm{DB#x-Y*obLidMm<(qWMQYU z*^qUFKC1--W~;~c>H698c#Yb|LE9DT!0Nsf*??@QNQkSsW~?(DIrYax$@#^fIqp37 zIdL@4yp}q!)B*X^&jf#$7(P2ALzAN^t-+BYmiPKUirT@?-XE%e_CP&sy)O3`-tT#1 go#1QY=zA|`^=I16ygi)tSN!Hw``fEeZ!34VA8|&E;Q#;t diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/inline-functions.tab_i deleted file mode 100644 index 28d0f1a654db9847fbf5e5eaf1f509e47abf970f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIuQ4s(T6h*;nRFgp-*(gQ`UvKs_IGdIp5ghzsdMcgK64>Q+XPHE;d7Ev${kRJgMBH zB@2%71ZxAoHwmeY_qS?8v+R=-Uoa=vKVeH2Kj29A$cSFP@D5#a{|&}vi%iPl zS18Km5=5)aGA}SD>t#yzKf|G%d4h1Y+1ev?%j^Rrq{&s;c@J4RT7;&s*-`<9}{)4{M#|wA?FW?2dfEVxrUcd`@0WaVMyuiN-d;^2?o38)> diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream deleted file mode 100644 index 3e846733e62108a00ec1617239cf84d000f4a455..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH|O-sW-5QhCF9&|-iuvSGx5iHSzl%h0#oY!QUE~LBb>_n=+-ffy{o3eH+cuOFs zyzflrnVH>9gIUX1(9$Y0CU>olwYf?pDWkizz4STB6=-UCxobTDb*#DyX_OwIbc97h z1%eN(qS7p0hM;@WTBS306mrjHSTOATYKX}o_)Nzv)k0wLtL4c7`nYY5Xd&!*$gzy4 z^Xh5IWP;vx>1kb~NMRt0oO=FM&oVC{GWs2m07W~!-MZlaM%CWPjI7kYh-iJQ zn9i9vK4He_gR>qRJbqX>WP0KvNx->Nruzk! z6W`Oy&0DelYu=jeCogyW`tVkOBfrZ7mHpAw0~(r?+u7M9+>Qyfo1R9&gReI4zDy-^ z^$EBi>f^|yP+l}@mS}f{H1e~R8T<$y(N)NMOaTv81S>@%CP{_cTA}qf+}>&lGuWfd eg7;}vz~q+MXr6{ZL!cqh5NHTA1R4VWN#G0A+xd?G diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len deleted file mode 100644 index 167eee53012f56c4480c8c5d9c0ead1d76efc0ad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00H*N005}~n*aa+ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len deleted file mode 100644 index b67c22714fc81ab1e8e714908a8527742ca907c9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G7g006oGvH$=8 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at deleted file mode 100644 index 7af9d581310d2bbff463ff0aa13722a403b8cd87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7371 zcmeHM&2G~`5MIeIk{4+A8KSgRIaG-fe$LbN)Y-<~U1rw^c&h#)5Qw4{ROq3+663^; zC^>N`bRyqu%U*x;eKWH&vs&#U^UU-_t00yHT61W2OFrb_Gnha{smk{hmfes0H zVI83gCBJJ*%m38@Q{=~}XFiqIZ5)D`MP4Nlm8na4jz7kiHO4gX?!Xr8|Dvtf!!-3dTk$ u%NVk?ln;qdPo#oAR!4F?gpWp;=MM4%9htTM{1lpGD7{~FE5Uh(LB1;%{Q9P=rEkcV5yeSH5UF?vul!bK?WkF;Qdx-K6h#~$# zN|p*Txz`N1fHnu_Nj+2{i#k>1oA5o(S7Ri&*mTbtx7cn z5U@d@Uhglbqp2PnX5DMXF*)>>@I0`W5y$KinAYo|VWoPrP$$l)@zI%heWCVG--Ru( zp!PrYzrSO8iZ;DYGeh4-P1hkG0TTjs`u%M>w%KhWn@sltCAuzKp^ahp39R%&phefA zqkW*%i>zESzG(5*p_?yq$zUx42q1s}0znr@=)QY4I$`90+ys4goBKPe>%M)xYRYDV zAkH4rb%_q&o(*De^n?Hc2q1s}0tg_000IagfPifR(;E25a@|GS=JtEuu)ZHz&kXft z`-p3Q@paSF>^|FI3#8QE+U2{UV0TG(2q1s}0$vNG75M1;WZ3Imw|OJ_{7_L7x$1Vk z>2<$VV5%>&YP!yT^ULHFYbidr-}5;S0R+qoyj6)aok{*~(LA*$72YZ3#)-KuPr?X6 z009ILKmY**JQP?~R%|VK(8EZgauDd&^Y^XPwaFYJSc-tP0%MxI`O3XUYXJ-mKA`ud o=U*=^8Hy(s0R#}RP9Uy{my*X<{2qKz@9%>}pEvyOBj5G^0@Pb#rT_o{ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab deleted file mode 100644 index 9d08a3624d7371fad9176044c5e824a3f553dd31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmbR3vzw0r2$(?x3A^zoiXg`t~Nih!9 z=4ml&TuZP@j`{MgjY%T0?7evOv&PwJM7(Tcmip~H$Ma_RBDWFH`VJERwG$2k5P$## VAOHafKmY;|fB*y_0D->>d;kTPI?ez9 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.keystream.len deleted file mode 100644 index 9a568e9309b6c9894e7c66f76936239e410ea0c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0D~z20Gt4o diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.len deleted file mode 100644 index a9f80ae0249093f1db8b14f71053acce35747e3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0D~C-0H6Sw diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab.values.at deleted file mode 100644 index 33c7d6ca799638d1815cc94c15997eb434b7d667..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 58 zcmdOA@JLNeNi9+cN=?o$N>OmjFH#6dEh^3|E=kQR@klJr@J%cTOUx-v4KB$qN=#2> IWMG6K07@GY3IG5A diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i deleted file mode 100644 index 94e43615882bac166535bc748a7451df99d21b80..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIup$&jA5CzanIv@!W!vYL}L^23tum*uCswuXbR=soo#Q({Q6e$|qRyv2}cp6lz zBtU=w0RjXF5FkK+009C72oNAZpc2?io~QGw-XZ}41PBlyK%l$8`Yn$6?mldg009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ Hzz+g1{dfpx diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/package-parts.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab deleted file mode 100644 index 25bef240969e4b5e4f87a124dfd74a3c4f5b4270..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuze@sf7{~F)ehooUL*N#H?nV6pL7M~ytql#9nM&ICDuD-%Vms#osQnFQpLs@--XPJA1c(>W`JuJw2753%0EX)2o80j%f-a8NzfE|xr-iwI#%wl)g)vPysEWU z_2dA(=&DX6^$3L{EK({Ee2ud6;vYpiE7SGpgl~+?2Cg?Xv|=;1Li=>*OzQxg^~J$( zYN5^aBt@Ena~Dkcy&f4Hm$MS;jA>4(7yrTAN`U%0g-d3P3ezM7JKIZc-z&D|rg8IDtT)ZOVq50ruHOLO z3vd)0J(Br`rU#%`lW`}z*o5wcK)d-jf6APSZ&L~-KLL;G9AlF~dHUoc(LsYW_PdoE zoYtPTDr6rsz~hEsrKpvVpu+7oX#LGSY?d&C4Mkpi;j0E_mwCJWW=Ki>?EfniY=vJS U5C{YUfj}S-2m}Iwz`rH%1#KL0fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.keystream.len deleted file mode 100644 index b1c61efb430c2edd7858c26c389d6ead81b91298..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00A}=002k;I{*Lx diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.len deleted file mode 100644 index b797c4d2ee86fd517925c6dfd186e4c359366499..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G7h005EziU0rr diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab.values.at deleted file mode 100644 index 5ac90143bf1f50fa9817523e2b42678109ec2d51..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18862 zcmd^HO>7)TcCO*f^z`)nusK6g6h&FIL`jrniLgqjBG}}xKmz2F7!xZZ}#xlXn`e$ql#FuC_h5?kzj* z{ku-{fm1tl?|F@uv*&(CB!m#drX{Qad%zOohAqYiDv2Xw0QE_cI&i9Wlumuv@M_ii z^``5!@k{smV`uxrcBB6DJZ_4__3u~%V*~u5j*8ZRi7V<**7H?X)ehksWol3L_!eVg z7K1JhmP`}B!UU3E7z1`{wP>etVaytK2H)oDn4MME7QS<{rkx*8jU_6{)pK@X+$^O^ zXjLiB=Iudsm8=x0D;o`lA`MEN4T^S|#=uzIH^v@TW6814+an!gkIJzzi$OJu^Y$sU z8Pk2>&S}5RIG4^G853Bsv*O}fqqR5FXu5T$S@jx?T6<=@R>dyO;JQ7t;d%?r>b#hZ zZC0)Cww$)tI^6aSTkZ^6-{RlT3-giFb~hYv9|Mg{uRV4?a%O5yeQ)NT*Q(a{=C3>u zhO@JSAG-@y6tA8-gf6j2`g3gs*So+yX$%mMsh@Im-;En zXR0=4sN4Bi8To~Qr4ZtW6^VJmdqhU0tW2Sf#gOE}CRs`LCl$%nl5LI`8T(28->PJR z-W-saSCUh}bx~ap()SVMT!!%1!6-JF8i9wp}@Z#Cn`A`_C*7^v{=K_DSk8+B?!< zR)4!=uAWvpD-Ru}HIzj6S!8|_ci+@@(hl28vZ86AZBp7v zMjh#f3DzGMVXTW0b7+ijLg*#Lj7t7|$`p11*ec4paReU?tt=lL7p7w1YNr82DcKEJXCqRQLDK; z@NKtNJwVSbVF#6DwH#06y+$y3jGWjKX_^Gt)#QQG6dy#4>iVO{=yU$Kne8>7EAl6Y zUbQwuGC*rl2u229L`58c|5wsK^QKgpfG?>>0&YsyD1xVnUZfuM5cTHhn3z08^zUZk z)MBAzg!$ifXf3N`l)&+pvla8a0Z3=Z5(;v;Sqm_h3^1|$sku7MO0yVh2Bo>2oh4Su z>Jp6@)vGt4Cb?6;t)`M??$nmFO|>6hwVC{l>VcP2n?rh@602$3I5NhtRHvVbvcdEb zX}jO5p^F&KMx19+H5vxcj`2E?X}Q05=(atv7^?-3v&NMOj|_+p09R1`L3Vbld*aQ0 zd)<`NkUxV6F~!WO&K8Mpj;u94-1ofZ>ock?)y|8|cB4+7ipUO5!@fP;{l@Vn4zIeJi?F4pUpVykS$B|xW^XkPnob?cC02HR zNeoOR{@^uVb|eub>B&QiF5(;NpWP%aO?mS(%?dLn)F+&!&7z%zN>4rfbPLy(z%}_y z;cKJgnwUWNzS(h2K34cXnT+6i0tSJ6uGGWN;93<~Q|Ijh%ndlo=2-}u9>rLv=8T7*r?_ueq%jCu$~?-Ca>7%(82j*le@r^o5JKK?2E_lUgEo#?ZG2s8vAiYyxlL#L6D@!HRW$M zDbM6I`Bw|u+isI6Nr7kXPe;XdfT_5dbs)8C=s&5CCg;luP z!Das80elfHA2|m@wcA^b58b*bLPyZh`ntQGD7K@mVib;c?Eq)$R{D8ETJx~QfO(h~ zd2mL!fEz7$xB9Ud^xLY6%%j6xsnP5v@eC9~t~n7B%8 zHzC(z8Psy|bubAi#yP<;r4$rL8X=zn+ZdO`(e&x0S;K(eqvC4dth8AYt`pm?KS;SZ_I7roitMZY}VMbMvNJL9zYS5j*Kdb(q$q@x%} zt=_M0lKWPP+`Ob@ZZXoE_4h7Yv843oSer9b)e?v;35j&aZ$cX?wK?mEP;E$?_r0MZ zv-iR_RJv17mD>~PbasuR0{9a2_b+60^_N#WkN^h)`nwYkq{R_oJtn&g5iAfc(u@m( zals+Z5+#YGjSuVeT!n+Kd7wi5M5BUK^`*Gqg!Ui$`#7YA>=I<32M#qY+rv5%)i+c^ zr09h~C365z0BJsGp*~RaR+tAU9emuVcTpI`44xfDq;Br2c}8KV?Lc5Gdh>*Tk{aj7 z(yjKf<+H~yZ=~p|38W>>OFq^Hz#SRD&4lT@Q>)j223v+9D+vl~ET=0ej<2UVS_lXr zK$#}S06&Wqoh5#|-{)FrHfz;w_I42uX6Lf)#}P8{4cF`2F4Dy+Xx(ffXWa6tZX2O9 zXXk?!g2EfJ4sIwQkyoK_j(UsV3d^)o>wb*->3wDHsj=gX`~OLm{tsc5F4r>&!OCG> zb^MClHW}^3@+zgS7nF0B?6M89a!=7>&Iww~^y(DlE9T(is-RPH)?yV5BMSyEgsMbRWkWoM^^Y90BG5`THN}uwOT$937v)XH0dY(<3QtQXN z(&zp`o+H~AiOlHjdw@(p8=V7Z>5u3z2T~eAFj(7e6S5{Tkn#4b?M-(VK?(&FF|Of+ zm<=T(X5I}j^xZCyiErL5B5DG)a%dqIPSo4+=YWoh!{5KANRY+vj7dqBVFCmNNa>SW zPjhY|D{~9k#WM^q1QY4N2=fK@*9m9_w70sD{yb7oM}~#Yb7HPv3@EPmF$Mk*0+|;R zp{LnAtb5f1cPY3VvdvKsY&5)L+UdeFbW?JD#F>A}i!@h?sym!85Kjpv|3C(lj|@_l zM*o3`jy32K8MP7isyej?bSkM)zrS)D1N@q7uwrPz7XAiqaK{=v=LUZ@NZ?HT`5Qhs zA-fSdMw%PaJPBzg7m;j=3;|N+@H2ReB;1SdfUohXF?`EN-!Mn|WFkT)w9}Ogd;6yH z4br~HnD*m;t64rhkzD>Vi6R{bOH*;gPg?k0QS}+*1f`$R(HGrZ=S&6+7be0};}TD9 zw(I0(DL5H3x#cett7UbxOdlyrEPqXt9LFTjEPtIqaf0XjbplBiLnT@K`D$N>f>j-v zOBtz(Xg~6FF2qencQs_=6wz61-z)uxvpN!kP%X%`?>BZ%+yjnc;b%xKHsvw55DiTu z1e@GBqc>+U0wxqqLZ z+}cL&u~A2o>02Tw&xXpchstk=)OMr!L>S1~IyDLjryJfrvNh(u)81E6BhzchrHED4 z|0eSjx5N2~>`C$yj}f-T2h>ZN-IFGpH6n15BgTFv-&xuc#_grGrL85AT3%YXEi&sH zTPy4D-4p4Jg{@o5BDJx8Z%ZUM?r+6D=>H`7$ZTEG3@9Y_EYs&lR*AoP4(l=~i~4BiY1*#|dhRd9ijJ0S*H1OZOtm z-70&Bx~N-@L)kXA4r1dQo`*brdM2g51~#*A$VV>$FmiKYhkhVy2xNSUwL6uFgPw%j-7wtZCe#aA!Sg;R@Awy5V3GJ$#Dn1D z^U_ZMz@$H+ybAIl&M43Y9>mSWmBqU;I7@Q9PBV~d%rLxgfBiCS)Pl^6D|wD zrnJ% zR8yXWxDZ<`ssE{Zn5+GS40Un})g$&O+B?H)^f|0@t2$rdD<2(CKW}6_zmk4?r;cBitSlUD}ZfXAeG<1O&xbWQw^_Q;Y5HAx`q_71e7r{K;L6?%gYj891+Twi# zw-YkzR4SsB@?Uif`v*Ag0t3ORk4hFfkR(zq7N6P85qaXfl3L*f5qKhqFuel3&%v=_ zm??SeFv*?+H8=$mCGAy4nWz#hm^4~hvS6dISD^t^qX{&+z-FO9jeeJn55>*Mzo9pr ziYSGifK8TkLNZ)dPcVDz3HYvh0%hDT!nlzgyA0zt9X4)PPpctJC;j@NqW7}x<{+x}@6 zIqdSzXh<@pk?f(;eVWSP8S3y`VOD|dS zHOYl!SvtzHj8Lo3>3ok}Mk&rnmpnw-WZXhUhh@k@UC3yKx{!eibs>qLx{#cYFKqQb zmX2DCt=7Tz;-eOHp2`nkb6Gtem(}BOSv?+?)#GtF8qJsj;k$_OE`jh}4immbC> zk6{KX{;u1O)5~fy=F#U%^IBwsH<0iu&~CNWmSI4%hHME31k*15;7cv^Hd7i5vQB?L zqwThopC`m0^&wy(s-{HlCDiDk0O%O`XG=W!?*17Or91u;pD1WS5r;LsLUa+l(M1=$ zKy)~VUgA<~bkcx^|Nd7%Z=R0=1^v7gqDgZq9PyKH+y?ei$Fx9CB|kw#BF@?VA^F&UbQXzCI^Igw+-@4S<CuVn`!- z?WAN9BAc=BSd929Hd9PpbKJvxXEWW$`ThUrGtIeorfF1~ic}gNGm=@>vgFkeO(X&c zdy24NFaa!0tg_000MRk^t?Av z@px``AJj(xf#3r1@;PE}A$vIZnVf+D0tg_0fIfjXxgL2FhY$2sAQ=G!5I_I{>jK$w zomzP)xVN6bNCXf-;0pm+Uy7Wb`Y(=#&F%(qXpH9bK-j$CO!Qj;hrA!M)>E#(J;~sM z8`4|vq$|_l7HRDt3k=EJE?Z9LbWbr=-lx8tc=m`M?5I_I{1Q0*~0R#|0009IL_zi(*`Mz?` z*VXh{t46kG_w(02w|PbY0R#|0009Jo36#tILqfWvHQ0G}9rsA#u_nj1UG)R&dSypn zX;f|Cezp-nz&?QmDP3IUHuiUmJ+jXFj}M>h6Edsvvb58mH(hO3S9F5_0tg_000Iao zH7*E!yY3h)%n->3wfB*srghs$6G4t-+_0XhQ SPbro4y))wK!g|8r9Qg*C%2)UR diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/proto.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab deleted file mode 100644 index 539c1455905e8f168b5784d09602e3235e9b259c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH@s|o@^6o!BAcQF`Di((M=0mN(;j5d=f;!9ZUf>AKpMXP3uut|J|&4TyK@n6;j z({|w;nE7VTnK{gS)5barM&6mc$hnJR02p#93@7t@h9x+|3#V53ZhrG#-H#UguXtca zc6hl)7J`8F7TJ+qavTD-FOg=Le2N$mp#BiC$>m*S9t9RRkzNewlV%(!lSlG!W&Z>) zAqPpIMV3;4LGH=TMP!r)+GI5Yn50df&hEec-mWz@pa#@{8c+jjKny3Y`64<4kYRXmTIX}TuaU1uj^d@8F5f}kLZc=4H>q_L=HF9YV3 zU6SSZee)-iwK+~m$*hnrFb5*Xb``vtQ78!N8raF|Bv6?mSWIS0;0rX_}#YoJA+Zw_1o7U6eM=H(Hpx^xYu8C_r|8NsyQt%Z(I-fM=(&1lyHa zl3aOIDPr6gy5N7P#6S2El{uy;!9bDou2IgmS?*(n1u%Ab^`KA5geXwQ{;ZFEj^_;~ z9tXd4g=z_h$g7Zxgg1>**i`c5lF_H3!#?TLu|RTAxho`z!@UCjI^-zxn|$8BHPbsi z;A82UMW9yf)-VVSc26nqGvr#2(J~{8$BKZDpljzE{y~PM=;mV~epQeYzlP(zmN6rO QHp?M$uVUx_`eO$^0otX%od5s; diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len deleted file mode 100644 index b92ca80caa0659b9a68734e5c7672abddf481663..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00F*r007bey#N3J diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.len deleted file mode 100644 index 8fe89d82d540f0f9c8b866f249f77e7623cde7a1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk?001fgA^-pY diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at deleted file mode 100644 index 4611327238bd07e1b3d51da0669532d540815aa2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2331 zcmbtW(QXql5VTZ@NB9F2fe`|v98D3RA|#?~QBf4N%C+!<1m|vzK?^IrG0G)FYn9A}mqw5L&HiWOmDC?*rl=JZ?Cx59t|XBsgm=ji_@R}L zBWn1&DQG&4mAZ0)%9P#P$S^-Vkj@~gYLimQ_(qNs2S`HOF-4nnez50l6jGNcoX0x% zH3GRWho9)H$mauaBY$#TATOX4wen;7$Y$uN(O&^QAm0ugKi^_6<8{(z;(ztqI`Z}Q z7UqGe>tb7pk|MLdhiDaFCvoshuKC{q|#AJ1zgL6+J%irkI;H|clIKh@$!Y*0|k}v z;NnBEj^!EnL!Co#po=Z`H1b4CCr@**^J^PxO#tJU5s%efj^nDj0qnPK;J_Y>jqC)z z)Zje5Fr}>imt_ooYKnkm6djLMzV=UP>$$}%8juZH>ysW_E3!%oCBFd%6uazUTR3P} zLbFKa>L>yB8N1(sO)1lr!LtDPv3*}HMGuko|Dz7}rif==_&VIZ@7bLWFzxsU-6j8K aA9S)Gi!eSr?f*HJJVFv!9r${aBi~hP1PBlyK!5-N0t5&UAV7csf&2v4 zW9s<+v5?=QrN0z7i}8cWz0bdFuuXsf0RjXF{I0-SJnnUVW9xUH>S?J8+(p>=^7c%s zeYyw`An@M>4&%W0m8tsF?>znP+<7ji-l?xT1uBufdVaH9o%N~-5FkK+009D3C=man z&^mB2n`-%Ogf))rU#8lpivR%v1kx7RjJ%_#u9vhc)e#_&r$9%%|CZYOJM!GLMc}^+ Fd;#pyFuVW& diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab deleted file mode 100644 index b9ad114a5e961e577ebc41e55426c167cca38762..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmbR3vzw0r2v|V`3003+N8dd-R diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream deleted file mode 100644 index 718f8d66e4678a6ab09c220c3273852eea8996a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuF$w}f3SrQ-ypI!rPdSWQ8>q z3A0>j$if;Vdht}l+Yrr}c18A|U^{=|@OPr;T1+diuIZjACmpG88ZvSB7`TL(E^iiD xlsawG`qvkKf9D}wspoV)xdb1-v*!W@0SG_<0uX=z1Rwwb2tWV=5P-lOffpYDN@D;3 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len deleted file mode 100644 index 47c1102697649603a57d748104b04c9ace30fce6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0E4{%0L1{l diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.len deleted file mode 100644 index ec8f944c8acd49bcace4e4c78d4306ebd9e28078..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz0D~0(0I&e5 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab.values.at deleted file mode 100644 index 96d372e9e9242d9ea6e6a3c14002e84144ab0daa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 793 zcma))!AiqG5QYQ3NI^YFVFeZMrB&*ov?S_%+5Alx(w%i?BKmYbncybGi;%j>VqEJJY|<=d z2VF#ed6MZ@AyF46sTTn!==-cNQ=AWbwxZlQ?HH!&oP)?+CjJ!m#7C>1f^Bayr4qGg zxL(Rtmcx4Cse~pP@bh0t9vfLu}SpJ?=g%2oNAZfB*pk1PBlyK!Cu3z#op-4dMU* diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/subtypes.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab deleted file mode 100644 index 826a296d7622d7bdfb51d3b580f2ac289576016c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIup$)=77>4011_$_B5+=ZO0TO~jlj??qV3Bp5psEJK2CZZV1d0JV1P1=T7r3OV z3-J9(`}FRb6K}P-O&l}zuQ0Rk#|v^EWBgA4pNO@8!uYe*Z_(cm=R@APf6fmTt}(+S zF7b*Bd|>-A8*}*u6HM`dF`n`HHfyoQc;sA(TRdTbdu(urT&Gb16;J^cPyrQC0ToaI N6;J^cP=UWG&;jO+LN5RS diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab.keystream deleted file mode 100644 index 3aeb44950ad90adce547f0fdfd6809374909ec2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH_!Ab)$5Qcph^&mnHD&9-=;6W-IeSnbtTLWn(&diFwz3H+&w&npQx4`#>$;Vt0 z?;KT>P?Hj6aWN+pb?q+h4Z5o7`Yhv>7>&9*OMM8qLHDPiRJI&Md5StQ+yJRm1n<8U zuG8^Tj1YO~#9zvmcpo%T3Hh#58ZahCJV?FDdhYqmOx&w@@Hco?)}4c`YRxImzj;E& zE-1u#=%z$GcD}Jp`V&zPAMDkZX^&cO{{deUL|>twG~S*XaZe-KQf_zzJFh_}x%r1} fOS_O4cC3IEumV=V3RnRvUp&gZ6K@rg zX|63R`ZCh|0z5`CcB5ahKf~w?W$KJOup(q k=SRtKb={pN?qv^u-~({$tIS3RTpVkRM#6(&zr3O83>V@BX#fBK diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i deleted file mode 100644 index 33f1fc37d8058ea99b64ae51b7355883c8c3a9b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)FG~Y)7zgmfSxhTpGKxW8fb2H8sZ5M7@@#Z%xWDrPDeP>C;|k=EYOSj2j^$cV~#OCCxMU1*=Y9va*7i} zfB*pk1PEjhXvf{1wcb*OM_eU9fIuk(exv2e#X|a8$RR+0009C72oNAZfB*pk1PBZz zkbW@My17~(>at4&2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5Fk)lflh2T_r2e! z?1B|rEd7zh-O=E)VryB4z(fl?M!V(3_RK_=RE_`v0worBjqcN(-R%;upgI8p1WGB; PkJk0(@oXu}XDIy-tPdtW diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/jvm/kotlin/supertypes.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab deleted file mode 100644 index 8efbaaa2df..0000000000 --- a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/counters.tab +++ /dev/null @@ -1,2 +0,0 @@ -19 -0 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab deleted file mode 100644 index 1b617c8bee657b3d7f04b4de48a4ab52d04ec5bb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIutqQ_W9ES1N?{5(-OM=x4(3=pv2N4tmlgVV!WDt`en3hbkV9{g}1d|tG_6GDh z=wQh%{10ruvz@cCJ)8EiEJoFx!cqB5yqGj)`eL{{(LF559pP|mt?xzjez^Y28}AR; zaKRoApV5m;C%obTmkDW)oustGT1xWqfm`&`(i;02X@!lfw7@6MG05>RILu2EtQVv) r-f@JpqBOu}N$TRS@3l26Uy3bH*4<4kYRXmTIX}TuaS!XArK9yAjK~NAuy!cE`+E^<10t3w{ zyClo+`{qw3D|eQWvs)rxV*$)T{F0)ZGL;NX0}^y~PF&>#9kVVqOT9v$f| zq%bHkB7+dS3{9%_SziZ?;u1>MZFCh$9pc~;e3kXo%-%H+V!!W*%iqI$Vt$^fz2k=+z!n1T{NS|OfyQQ9y+SYhtccZ2+406D}3Ll$nmv|11fKD^K+_^!;d z=E|!{5u60Ds zk#^0J_*U(W{Nun6_=R!n diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.keystream.len deleted file mode 100644 index bc1721ad72a1f49a7d7b438e2237f366381e833f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00G_?009aB_5c6? diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.len deleted file mode 100644 index 14f7c061cc4bef2fdb72d8ebd5cc8c9a23a22d1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk`001HY8UO$Q diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab.values.at deleted file mode 100644 index dbc6bf90fdef9c972ed7287004893d199a230471..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 163 zcmW;6TMB|e6o6q(%S%^X!R)|Yh%Z4D^nS>L3gN_=Y5&pxJ$zj%F;~ xT3ABVH4YNyt9+jF{^}!olS%XBk5k@o#yM|!#|4*Mam{-^@R3h^<_kC6{s7lI68iuE diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i deleted file mode 100644 index 3bee32461ba7012d1c138fd7f1420a942392a00c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeI)F-u!f7zW^LT|_z*9NZo1E`=@~1ec17IJ7v4(4lrq8W015ORS6FA}w_3){YSe z-Rw{rQ3OGRf(W4?C@zAFgM(jxz#Rff%(;E;c+biC-uJnXA&{F5W&N3};{wn6vh3rp z^H&`oWB>sI$p~CV($lvGGsy%NlmLNTfj_bGX}Msv)M-(m9{XpnKiszX zG200cXoJ9yIAiQ$YP}6dIf4KI0t5&UD5$_q^lCnTc~#JQY7rnnfB*pk1PBlyP#}SU z_`k}Vt(~I+RZ@ij0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+0D(jWRwDQI@Zjr2akejYR*dA0`P6#JOMn1@ WZVNPHVD0)iEdoxV{ diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/file-to-id.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab deleted file mode 100644 index 6843312afb2220972b906c00a787235613655d82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeH@%L&3j7=+jN`;8!;1WT|13lQwWn-?p{QETvG3El-u@RCk^Yt(UmVuB|NkQvx~ zlig(D|CXao)iEu5M5%|RlW@*s1!Ftk-|z@rahh!X&s((b#izf^j`!O?T{1~dUO(xH%`x4F^Rg;3AOkWW12P~3G9UvoAOkWW12XUz2Hp_bO9}u0 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream deleted file mode 100644 index 54555db390322005a3d6c3030f581ae72805c531..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4096 zcmeIuff0ZZ002NzAqwq3Yb*1`HT5V8DO@0|pHI GYv2R8Spcj6 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.keystream.len deleted file mode 100644 index 2b895e774deea3bb925caf1a5567bf65555bbe6b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 LcmZQz00UtF02=@l diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.len deleted file mode 100644 index 14f7c061cc4bef2fdb72d8ebd5cc8c9a23a22d1b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz00Bk`001HY8UO$Q diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab.values.at deleted file mode 100644 index 9acac0d4af7a0a3a7231b2734a204d8a6502d5a5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3654 zcmdUyT}~S@5XUX;MRI}EXNW=&eL#s4+CC57VPmrEF=KDla;oyts#Ou77R1K`T#4Bv zL~w+8TU*}Q-+#V#Y|RcriQJo_BQAT}#Jve}@+o7;JCNqP5I;lR;w%$Gg{S7keoAt} z&XK=j3CupbIR!gmsu-FEvX|8t;zf$!FxfFfsL+lhh8eZ&(2_ht^!*A0GKgWDpoz7d zb+wo8+K4&HHrfT{+K2ujxJ44HiJfi0hxNWCu3n90qI&cGAjaCeCCP_H*1;?eNp^yH z5WO&;n==J|UNU!?fh+1WbE<{9OX3yuZDDQ{Q2TJekTSO}w^A9xKG>HfxUSxkq|BAM zR4HS)ta%aeT$m@73O>FI%@k9Vh@dEXEX;#OMVs!qg*8@?vCFRu^H-mi5i@Z||GzN* z^x;qOsKu0r6b^i)UBxcuIhCT~zA$$hW3j61(Knfm(z@wh7v@Tzlo_&z+8-lJH2#?1 z3KTR{q6~QQ+k4Yrf0>_p(1+4TE8_3savgKh+T~-G3xYtOm>+taErYZ+T9{t|3I~zv diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i deleted file mode 100644 index 41018a93c6b30454cefa6b650cadc18598d5f17c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32768 zcmeIut4>2f6hP72Ck6WcY9tbgL{=h^NMvOtvJ%O@u3u2KPO@_*lSw97!*Q4mH}leY zQm-|ww;CV3*StPzQKwqgXFb$ct?IiT>!+UTT+el>b^X?+uC=Yd+ST~!zO`x}+WYo# zyf*|05FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U tAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAVA;_0{@WQ3>*Le diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/id-to-file.tab_i.len deleted file mode 100644 index 131e265740f37d77b7c4a3676d2a7704ca3e4a29..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8 McmZQz0D%Su009U9fdBvi diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab deleted file mode 100644 index 6a1c931aff7b65bd925f5b37369c83eb965476b5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16384 zcmeI$ai~-MUkC7$J=uCPTV}S*Y?;}zn~jUeLF6(-WQfQRk%L@hh{zC;AtFOWhKLLi z86q-FWQaT*L}ZA_Fp(kha1gO&X3NZ$nXQ}IGJm$ro?kB`i2m!J{`0{0;@rD?@Av)Q zIiGXx{$T4LE(~n{@l#)(|9dMi9|U!LdHmRh|Mi-mu>a-pWt;Eu<>!C&3qkPyoB#Rx ze|_`+@buX4PkG%frg?)Io@bV)nPZ)n6&z*A!z}P1i>$E3J&ZWZGIz4V606+88aJ`d z88#TQ$!WGY#Wq(lW|kc;WtWTD<3c7(vCnxN@beEp{_&9SIpSN6`Gyk?`K83?Oz|nx ze9R0JW_gD>-eR6N7&2yoS6F0=C7xr%Gc5BID?G+3kFdrn>)g)<_p-^|Y%yY+TNpEB zhpX6SmOU|z8SYwrkSmOcKxtk3}Y;rYQT*)?;yMPS|DelR~hQ=Uoqhe_W6th_BrH3j@aXvH#p%{2Ij?O zrdVZ~`V~$su z=VgX$vA}aI@(fEn#fWv5d6X3%W|jL`W0`eMv%x7gxr!}j*ybX}OtHiF6Z!d;J-%VW z0sDNy0UvS5?>SUoFvlkIJk5|NS>SONS!0QZ81Vqh z+{X&bta2A?+`&4xvB4sn+{hL;u+4RhnP-Qq+2u<1xSR>o>~kIm{QR%-^CL$bbIdtT z_?p2_n-@%Rz%-vQ!$-{Wd*;|@v$9moni3_Bo#e1|0I!2l@Gd zW6p8H*9^XO{4>P?(|p1V6J~jzIo@TSHyN_Y0*|uDGE3aWh&x#3Hda_s&#T<_@&m#<3Wr6!y)5pXBF=b-rSQPub*SwwSQZ z`;2*)9o}Y_9rk#Q39qux%N(%9ARm|>Y&?qZHRnCCWz z+{6NBSY*f&rx`KFGFPy|Wvp@$O=knojIqDKex38#V8A9nz0(8Vvd!m=nXtqA?D8&q zyupMq`@F&dFLB7T9I?(Z4|2i^zpP~sQ=Da*JDFjTS#D&G8<^)hhRn0T)hu!)OI*%~ z8J4+-6)s?v^I7BMALZwJHu!)|-eZehwt0;)ud>67?D8agJkEqQ_PL(}?&XlXIby^y zw{ya+419L7nJE^S=6YthmRYW0jydMJf+3f&z$Gj)%@V(5#LsW#=SNmJW|ecS@ipsw z&IX^d$;WIlVVn0Dv&#-|vdfq~USYyZ?DGN#Y;wpG9I?tVcXPss!6JPy#Z63eh8c#; za+*1=WS&bH@*5WT!#~K+2}^v>h;LcuOIA2wl}}jXBi8vn8|<;kJ8bb5+q}V;F+04% zE-$givrO1vpSw8V4i34EBNjO3dQO;U@QbcXOmQ*OT*wRqX8CDOetuw{?-+8#0$;Jn z7cB7^BlcP5Lss~JRo-KbUDkP%4PIxH-?7Cu+q}q_XV~E>c3EeSN15<2``pg~_j1VH z95LdU+c{y8!D8n(Q{2Ebr~I&m+`%5VF=3H?ZsdR)IOIBxnCF%&4v(_S!|ZV%6YgN28#&+x z4!Mpa<~ZgGPPmN0FPmpfF~u}Ly^)_IX8DRazF?lu7_!d-@3Y9eEb%rYc39>$R(O?F zUS^Fg)_IN%o?(-x*kYY+9%9S`>~Mx%hU{^g30Jbu!QBzUPFm8Dt#K zOmV<8pD@Em%<_BY*khh|81fbiyul)4mUx8`FR{!Etgy){PqW68tn&yPtg^}dY;iB! z+|8If*x@#IS!9nJnJ{FZ(;RS$L$2V6%Q)r|PMBu!E3Vf}@$+l>ImZkK%<>6ye8fEO zF=Uqo-ei&2S>k0zY_iPbtgyx^53$ArtaBe5jM(IMwz!pTZf48^J6z8$*RsboOqgSz zD>&dX4!MLQra0z2PWbe1rWWo~r+`<7jamX2t7;?;MPB_J2nLe3fmT4|!hKrfyLgtua zp7R*;^Iyx)k1TS`66YB4HOqX-3ZJsd$E-17o%h+`T{d}}Eq2)EHO9Qk4llFI7JEF$ zglE|2DGpfYkViSsjKd4UZ!+2kp_PB)!H?hwd4j6LCX^uF>F;{WI zEQ96VZ>G4IX)a`jDP}p3Iez{t`T3C{$1HG;MZRWcX z$Q(B?&vgu$XMw9(-_Xm5B$I;-?7CJ+kC~C zFWBKTcG+i-51H@*`@F{iyBzW+N4(B4zvF~$ep%B+rg)xdo@Is&W_f}+9%G(I7_!O& z_p`{oEO9p@Ml5qXE8NN|H?zh9>s-$U*RshqY%#|+S1{%>cDRIHrrG1SO!y7^{NXR< z=Y&JP=ZJ4P<{M5pWbhm2K2vDoeb~h-X;lQC7H@ zRqkeu5$oK}2Dh@wb!>4Z+g#3=8FsjcT`pjc^O$h*LVmvEfFln1iX*<@n9n$2pTP>} zB~$D&&6~_HW|kM2V}p5~V8|K^Jj5brS>i@U%(Ki@tT4?gfA|aeIboe|*kGSce$N(r zZ1WCd-eQM0*k#NfuQ1^y_IZH=HaX;Jj(Cz|9_NHL2ES?jOz{BI+{X-OndMIAxRrTs zX2=2yT+brcvcxrvm}8mCSz(4%E@F)fSm%5;7_iBY&*kTsZO$>~Yj*gOT@Kje6DEAb zKJReATO9HRM~pe<1y0yxuu?xv@g&nc#0>W`%iYW|VxHR>aw`km%pwacaXllhWtnSO z;YwDyoHeFd=MR4_KPPPRJzIRsHs3JjkR3i}mkE2k&4eBHd4&UB;*h5~;xUf7pA$w5 ze#`oqVu5K+GsBh4auIV}z&z(OWWWMH4dmwsmiUelhb;3sD}2f-AG5}Ub>3%#ciH4^ zw%B2t*BJ9EJG{&;TkP>16P{t8r#N7pLmuUbhdJg!PFP{E%6$-1oMoCjnPG`pZefm_ znCA>bhAeQJMNYBARg9QrnM+yWVph43HKthSJU00G&*bMvwm4>+bBy_#9lm6j1NQik z2_LY}dmOOKA#ZZTm}6exgiQv&?f77dCzK32AsbAw$$4z?^E3JRkuk^YaE@KRW{)qKaKJtva=-^1@*YR*a?G2Y z@H&H>`vIodW||k7;dy3xmN_<<=Lv>9#sZJ9$SOFlO*O<^@wc&os|6!#cA( z${Y_f&w~tEVS#&Cwz-rs7qi28?DF$d z`8mggui58I4%p|A_c`KSj(M9Cb{MQSUzp-mrg@newwUEP=6HsAo?^&43p~mq53|IB zj96irdsyKttK7*NORRGX8{EVuXV_xMHdiy|N_M!MU1r$hA|_nGKIe15fJ1)z6Z!dp zW4_~rFBtr;`yr;7FwOhS@Gi5w%^W+-^BO~5Wr3GjWQ!%9W5hEo^Aszrv&y5a@i6N= z$ObEHat~XaWt-a=v&arNvdazZaUB!p+2?8wxROII=ZG1Oxrh@kU@)aGrWi2IPfz6M z2WI(>IgXg;D~5c*0-v$SK1+Pah!0riZC2P}l~-8fdDeNB4K~>13AT8QZ60CF3On4x zE@#=}P9`j|&n+Bq6NjAPh#|+E=7duWe$V;F6thfoDKlKmEEh7z6!V@0`IWM>n!m*Mr^api>&ZGt31mZ z>#XxA8$8S=53d_33K^UmN(^z}E)8Ht@B9uMK={;A;b4 T8~ED5*9N{e@U?;e*9QI*St!Jp diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.keystream deleted file mode 100644 index f63557d8cf674d326eb75d17cceeb04fe9e4345d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmZwNdz_AS-oWvDa>_beRFdP+)H*cSacC-5#6GDf5o&rF$)bnB8qAssiH5awz*@A6 zOv;c$YK>GX3Zt}X)@enaJf00{wMj(J@BO={|DIm2UhmiMntSG+>$*PQ>%QFgXITZ{WrP8Dn#vuEa)w|1(M z*Q;H#;@{q$H^1|=F>lr{&FB7|7tU~Rxt!{JV0dvUJ#O&ctJixRJ&qnnkK=}h=ceSG z&1mECn>wsL;_>u&dOSUzHJS{(_ryKdkGT0C!}15@k1JZZeC55@e>yuq(PYGu=Vsjg z+eZiAaNFbO`Yr4>yVJ|;wDtH*=FVQ0R&r&F&W9`49LRFViU+X&(#*qb(P+mC-r3<| zJ2tM~;6>g&y3bAgwpNuI>_2|xM!wvtUI+R;==WlNIKFgz`Nhay_1OB(OLLh>>G&h} zAN+DQS3EUqG>5Ib@fqf2qOq$>Yfd3|K7-<>_7M4EqP$Z@&D#G zr}sq@i9}!PL|X5-KaX9}>v`*%2)9Y9#64m4RIaxLRob~Ruj}>!E`r!raKf2&_+@6#B9BcKhaUU1d>obyf ze4h3tk3C+P%|uG0J>~n2$WNqpUPAj3*J1ngtz(L8r|n#GXlhPLl@r$_8V~uXr0SD* z>Co2_DJi>IZs!x7s7ns3Q~t{M^~RMZP@mK%^+|nFpVTKu*SfxAnepf9)mpFg`%|~n zEpOF1`y;JYhJM~Vz z({*&p{>6h_M|p73=0$6ol&d-~W8 zFSs%_+j`ZCnjQGjt0hZW>+8A4`1z@NtLXgG`KS4=`ue#{^Gx$g^Gowf^Gowf^Gowe z^Gb6{b4qhcb4qhcb4v3_uQN10^YG>0^YG>0^YG>0^YG=DUAG=>W7Xy9e0{Lnmd|1YB+8Wa~BPBM{}247iQ7i(cID8 zQKvL_GWn&z>(Ci>Mx9Y-)ERX~ol$4h8FfaTQDWn(0&Zsl$j5?#v;`Y!Pbw-_0XVh8T9y+7Ws59z}I^)@o6IJW9ELpg$ zX;w?VR?w$K()*%SZyD0%V3W?_tZUgPkqyMl=`N=sc-6=`li0AZ|a-+roO3f>N~DO-_$qt zO?^|})Hn4_eN*4mH}y?@msv`EQ{U7#^-XYMte zzNv5OoBEF1L*LXl^-X*B_)Dd+=9Z^Tr5p_fzQAgAfbwnLeN7NB@L>*B_aUD9Mj;JH*h&rNE|>WDg`j;N!!J#-We9Z^Tgbzv5DL>*B_)Dd+=9Z^TrQQRInqK>E| z>WDgu+e1gx5p_fzQAgC#lmi**B_)Dd+=9Z^Tr5p_fzQAgAfbwnLe zN7NB@L>*B_)Dd+=9Z^Tr5p@*Tp(E;uI--uKBkG7cqK>E|>WDg`j>;^hj;JH*h&rN< zs3Yo#I*QvvN72v`b(CBeW>H7f5p_fzQAgAfbwnM-?V%&;h&rN)D?9_T~SwY9lD~fs4MDZ;6A>WaFeuBa>O zin^k%sH?a=bQKLOin@y1Ls!%lbwyoK zSNyEighuP<_UzBqJq{h1_F0?LXK&2;xZ}nTy71zZ1$hH%G$^?^we~{V?`XS8zi*n} zeYqYl?9FbjN9vJ!q#mh9>XCY+9;rv_kUFFesYB|JI;0M%L+X$^qzX1654yi-x zkUFFesl&Jq9a4wXA$3R{Qis$bbx0jjhtwf;SY|18NF7p#)FE|9=Yu+=4&(OFVKj6| z9VXX>S=1qQNF7p#)FE|99a4vJd+3llqzM(8(9a4wXA$3R{Qb&vKIebA!)Dd+= z9Z^Tr5p_fzQAgAfbwnLeN7NB@L>*B_)Dd+=9Z^Tr5p_fzQAgAfbwnLeM{ylGqK>E| z>WDg`j;JH*h&rNGexIJ_f4INQO$#r2CbwnLeN7NB@ zL>*B_)KT0XI--uKBkG7cirYg+)Dd+=9Z^TjUB2rdtM9-4Zk=#VueB@rU8R(Ube`$F za^+XU*YnIXd4oATZfGJUZ&}*(`DdMn=;HUIj<R*%4ga2{fA5xALO-v;8+X6Z{QbcVKl|B|53J8`?0#jl%qvbYJ!9t~j=OZZMf+d& zo&Wv%w(rvOM#J;c^F+h*(DA!C{$DfvoZ3y^z0Gm^Q?>b*{QRspmwYtpn;i{VA$;)}+c?pB&1nw1uj^sHF#b>n zJ~-?2n>^B{##Q`l`(uA#n_;78aOp47$MM34xAf-n+`qJ7zjZ4gX2+9>O5Ctx^4ov- zVfC?HrP;M;&IhI}uIqCGnj`9)iFOr=sb}geZV#Wo)UQ-?n(Gq1&qeQVaZb;Ti|Kkn z*9*E{(Di|jw0rGO^!)Vs1YIBKb2z#_@cwc2+R*ulUk~$2b4tHA%_Get%^!W9Me`L6 z^F(tLzaIAM#vNULGph9H19bhR{iOY5x6YFuru~iE!*QhjrTwM-rRyT?H|;N77iqs~ zziGc|zghIlujBLDZ)+V!Lx<5VkHp6vnp>$`T$kj;^}rGNab0&v-MByA|Mzw8|I_>Z z^nMb(pG5EPmwkOKy}v~7FVXw>^tm%#H|adk@u%ZY$3J@4+4wxpgSGPz4d;Q*1AV^t z#gCI#IR13}>A2HzXZbmQY)!|VjyoN9I_`Ab>A2Hzr{hk?osK&lch0yp>qR=QbUf)e z(s88YK>JVoP5T`U`%U}R`*^u+_KWt5x}yD~{iFS&{i6M%{i6M%{i6M%{i6M%{i6L! zt_Pi@o~Wm2=!xEcr1u|b|7rhe|7rhe|7rhe4(T}1afpWFK=(OU9lWWUUqtss^f@lQuTS?$be}}`M|6Kg z_eXS|l6GDa4e#sId86}2udj6fM6a`SKIweY`K0?NIHdk%FP&dHzjQxE=aufC z=>CcBpXmOH&NtmZ(d!W1H}O>S5tZrnyv+DKT{Hgk18etDbRR{pJ9IxquRnBOMXy7A z?5^yKbe~1n3%bvuZsPWEpA`-FS=3Q-U6@7J73zxauaaNi@(|ru(R~%&572!S-4Aeg zxZcp~FWom$muVB{Z__39NUsOfA@xW7QGfJzG}Iw=NF7p#)FJgneNkW0&=qw>T~Swb z-J{oU>Wn(0`#I{3dZYWgXy}f*qwc6X>WzA%-l#XauEce?u26r;^`Mi~A$3TvU(wJb z^+-KZhdkA?;4|ux@xC%?eE!YznO9k7w-x4VSUbjrHDPyiZLUpWo-}w)=dYUJvMVcKV#1jazq%`_nXW^LN%h zcTd_U>h(9d9ubeP&)t*jQE~0_cWa-!)93E=xjTLCPM^2a=j`-3JAKYhpR?2F>oliy zeWrP(d8K)!d8N6ed5r5YkI^uXG>0^Ybe)fe>pX9Na_isNZ)VnoF8XnoE8Y=91=;<}w=Qk>-)+ zkmitH4`}{q{%HPK?Y%RLY5r*b%8bur&aBNDeO^iPMDtT-{C<56-8A1c z-!$Je-!$Je-!$Je-!$KG9p*b4=9}i5=9}i5=9}i5=9uOzUcet`&i*p>;3fothoA_vGj8ay5~J=KcZnjlIvEP zv>&t|aeMgpKkW~zZ++=UdcR=XmRO|~E9(LS{wXZaavX>oh=rF=ny=Z|^U@#{~Xj5?my?px`+4jukddB-Ul z_CL99l}X2m_MhH&q4P=S^V_36|HJo3!+E3g_0#sN=3T1neA4sN*W>o^eG8v@;|k{| z8qN z3%gp=`jzL8owuf+d-dzD&a<6s7JWY_4P5l{rqsDN`#yR+ef_8H+3DTm-)Pd~3ePv(?&}Qm{{Q~>f3b%7 diff --git a/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at b/samples/client/petstore/kotlin-jackson/build/kotlin/compileKotlin/caches-jvm/lookups/lookups.tab.values.at deleted file mode 100644 index 79e307948f7c756df989b3a040787718564bcffb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12507 zcmeHN%WmXE6wRX_3F%Cd5epV9`U8;IvSfv3gM>h0-(p&Tgb3<{|EKOb_Di+aLG8JRUx7zk57vf7lr!MD)Zn~K7;C|xW|RtVh?PoxCN#@Zp1Hi2p5SGeS%Lbh z%>yf{*QgBTrLgOEX_{bVA?t-5GOxBOym5Z!Ip)UVs|1!7r+ag6I}J!Fjc+?76etE332{*l0=~~004g)r) zn|tc#Yskqof0HiqR&TjK#43%@vd?SJyH1j%6tww#!ga1UNgcunNNu|*S&gcxb77*_a%6jR7$IuC&L~kWMO%y z(G=M&8LE@Q5r23!FhA>E`N6?d2?H zl+F+?VqEoQeGebXG*;%seA}9)_Sfp)*S-UH80hRcGj}t(L-8a+{R-rCQB(5cDgx(krV10z{44=dxFBugCZNq8GX;P=(2~f!snCtltTG&%=JL79>vpZ zXJXY*4#vW&QgX=Xcv6{jygNbX2*QJwd*~_f@Tc|cGiMq)LmE(B>3`u7sf_;2GIvw> zOnn1*xSJM!Ejvr#lyUtWIiEba|IjZ*k8b%+=KpW+b2M9WCcPrxZs5szC!MoyxW6$^ zZsI8k`BTZs*8D4Sb(B4R>AJ6+-Ep@ zz)!(%;Uh+DWGr{2@~(f=QJF`rmGjf@z}YxlOs5&b#D07HX6C%4AP&Z(l?op7|5F$l zzv-Hsia(w6bj%BQ`K?D<`Z6i{*6zOx^DUh@+rMGPGivpFCEw<8C(!55n>u#jTKx6_ z(LU~IYwv9{D4g zQge({ai%7%MLnid z=ebwO?VvN`aQ>3W23~59=C8uU(HVu6Lj|5@|DawKt`R?aBhHYjtxRCt(b?0I@h?hSisOoHmF z@UY%I+y8GR;8}x9kPPwk;>S_9nk_@r{M5}6GzRB;uI8nLY!fZ=ooR_ zGIW8k9?zsNoPiec%-)>w6D2W5eCSqG`arn`Jt`6Ad=s}Rze2%ttDW+0v6=wFTEq^=h*3g~ zaFp1wqgIOYy!-3-if`|V_Bg-ic|F%3=gKuc>zbe3x%DuqxpFc9S1E=W6y)DN?Q

          hQJP`a4(}Mp<{L{gjO5L=2sYmazK>t)kHps& zV3;R)yGV)V3mK+RYNv3bojis)VH@0wXu>uw!`NzFeMK}I8_O`vL!Z*sIG8_tqW>yg zF@_Pe4uG}Nfma#ho8LQT%*`-2mM6v%UxjfYc}itkkK}~an0Hld@+hJSyI|jT>f}>y zx(dVee6z9x(QGX7Wte2mXaf&^TOAbv>!*XR0>gB9<~xN0|F!y9Wv9Lx!{jb;Zjhxs z!<;$t{h^^8!@Ol0_qD@6Uv>;QXoP>bYY)w&@&6V(3Nwtom)C}@=F!5RbtM%74A`Hf z?1KJmeJS=OSlj(CB`iN=NbES0OA0YeqfHxI5UmbknB~V4GTB{@DEAq)d_CzAc9dY4 zHS1jsIKXGW?CEY3FwB+MwQntD8D{dkX5OUd2}_~3-yXJ<FZsI zFU-d<-M6WltKo-t59*yJz6|>p7f6{!w4*q~B>G3_H1M~6>70Ya|6Qy^eDUhs%ruV) z_PAZ8mq?9$Z5-jsV?Z2Nl(gj;rQxp%7&)#)HZ{?ypm>k!dg)PYx`!&8VRtbsk& z9p4;6G#e|BZ~k}oA7k^Ch|_xUbI!8)MBB07=sAIN`H1uPr6YLKK!)iZaQrVd>{M&# zuoa~DyI6yKh<*S(SciHr`~6*a-61_S`ar>Ax7~Gx_$u&sziz7_ny?FT5P3qfSAhLAzBc12@jYQ% zE{5T3t+`&3n_=!bO1bxMLB8}^(0iw+aXk2~^P|K2*m5!INlNtV4{W{*_72^Ww4crA z@)^e5wlJ)m5je=limi%Ycc3nOui7Znd>OTWP*T(}@wf)AADr}0GVJ%+%BaI^KGAx_ z*_t{v-2Fh0y0mWCiC1RSm1(_WR*{|w^!R;=FEsE-&7Q`K#3#(n!7w|Yjc~`0H9zuo z{AqVyDo_{JFLnl65T6fkOlrwNURJ!*<*OZW7?D&VQ{7W@80JDr-_uE$8AKyZ!gF*$gi&Z(hVd zkniod&D&+I$sMnK7QH6aUSrNRzit(jmO+Li8px@j(5%QU6!eaPCGpB_?h(4qZ zUwq4fafddoTtsp<=0jh4by<5hUkCrp=e`=t=9{oz&MNLZCF(_^52DR7+@I<{A7nG5 zPS-xZE5?XA99BCiQ-0DsW}N4y|EC*7v#|{Ek~7-N9T%KR=vTZ0seGK{)SPkd`o|u} zrX}#}`nByZvH3*X@u9x=v#qu=4D&edel6mA!p4fQXUG*lE#h?TpkpIE=@H+8dN%TP zmr$ZJVZ_xc?q~P968PcmfSSuQ>9H6(&_5=z1v+%&!{!-ja4Q0O0Cp8!Bf3(5D zIz+Rvh|e(RCVv{oMcu3K8#jP0&n~S(KKgFE>Gl(QoCAN)3dCX9BC2)NdWpN)o zFt-bPoC5Xbh5o6I_&g!*fhD`hi56g8+4zLEL_5nt&aqYD1J4c_eM}Djyl&c1MshZ` zp-wcmrv@va_pIK~rViA*{!8nN*m|C59qMiA2dxnG*#igS@YM4QTs!<0xj}!J!MWeR z7ca>%OxnBziUnHyBH zwhQ-}a{+{q|AyXKwmGA6(#n>3ko%`DY-@kNd#AZLQd&(zQ>C=L?v{h(M&xVI zn{IXNu;hW_0q*z`!+*_RKA&yH`D#4->k}7!x%w6TWf9_Pa>M;CXgpyq;<4=Un=wQa zHex?>1{EJpG+`d<*Xlb(b`VY24tty)P)R|w1$ic|E}W>vKCX4F^NIL8toQQ$Yj`sw zSiv_Z57K1hf`|S85&pi33U&`Wmx!$TXTXI=x7ALx*kQRY4gT7~9<6}AW+*0}CcYi< z6I9JKm}oYZU>~gtFKMm==69LgR|dacjY=6L%L{(UkNxX#?sxxnZYA^*1_~lLs9Vv) z;$G>BGR(L?h6x0?7jOg0)Mu|_Lfx$Enh?(BvuPtLYn@B-gL>RYR-8#{!~^#BIq&u} z7ja#r_4&Wls0SYt8+5i|y~^j4+;K+p8NrvY`4O)?*y~)oo?SIK$5F2q{Yj5759esr zw(2*c*;tQz$c)<;(5^Ptwbp8h{$Iz46D8`H5_O^>H|#adZ$>-^ zoO$WXz;7KZ*SjM{oPXy9>q+hjYhVw{G-;;iou2gBd?D@uiGK{}%;u|MPxZP1>o?jV-v?&0u{n zpiUKgesiG;`{PIqlUU+RqyqhBwqQbEwm^z=$1FIBsLcpGRQPUO#$DgI(CBw?N}K?B z#V|R-TsUvn5`T54QD)Q&1#`gHg!@GDZpKD@HWub$7-zU^w*hf@ZPdzhY&p>;e}=hJ zzD*sX37b$)3Uu84ifBIk5K`|ps>{zofPD8;+$+bHs;e=~VJAn&=If!Uzb`$*<`Zp4 zT`ySV{#&9M^viY^iyyVXA1BBE{Xf=m%l}8mJ5H6* zyHZ6NOIjAh?dGYxZdDpn>ewcp=5yfu>k8yq#g=nn`HA@lU1al#b|6osSGH%pU-Y{h zl`4y99AP2sKYmmMx^?y-?P3uyGvri*+WNAcgEgE%Mdn-iwb{J9kG3E+gex7N3^J6 z)$pBcxhL8Rzqau@AEZJ(k2%OsQNd5={ygT7UFRz!0~u!BGC%PO}$q{#D*4GTpI(BD=)+Lp(Gdvuey@E95P!~59qf(7;VT;*}c zHSkx@*7v4ooXs<(L_giNxm6vZ7sD*dxv{w&b}Opxag9Afg8pP|Q@H>Ke%dGH9MvHH z{ZGVpVe9=Z!PLr>$ZVIh_6SzIPs=y3egPm-ac@CTQ|-6;PAnH zWK)=##dee2G-$xa@QG$)mjL&mA*aU(5wFR^`i*1D z<*>)RVSgM^B2I(Lgim72*|Y+72~a%^a=;Egt?zCoxfwTwBtudwq6u4Ze^s8Zlb3^g zURz6@7R2|2CCF1l%-I7f#OZ>VA$Qq&JjBa`z#W_Us58wz-*Ai5Ea1vFd! z&h#K=tgwVBvY$I{WqjOk*Iyh?`exXn&g=7Ah;~8$#iR=Pi6*Q=q@KTB6IS|XU=GH; zBFC34V$|J^M=$PYk2d38kzeumWH$eIX&K_`K(N#Q2Ar7fWdzVIJbB!J(LzM6Bic~x-x9g=5-O*p5a(%n|1XGGkD)a(u~r2`l7RA|`_odcXx zIrpq4K4Ga3&iQ^fs(w0X;2+J|me_4N$PwQ&-nVoTP1uBfJNoGhG0|+y%LV&~Ea4O1 zfqXsXt^b?otgsFGamfSJ4E*%HsyI^~IWR#;-|d<5UkCrp?0u*|dwwnKI(N;;kzB-W zl~*N`)WA7~dB0c?XNJPxcbVbunngoxeAKCasiQiw$Nw&E!p=iRRBJ-x#qd|@Z^uUn z_*idaggb6HsPkV3J@c_t#y!5o`4rOEL4Ru5-C;x%mLu<)wF!(gz~5)59BV`Ttgr#= z1hrU}oRuD1ZsX(mZJ)N!iEl20=LNOe^ds66Hlm+Y+9h|1QBV4%JS!oFe`e+A6bP3UHEJcP!?<@9__-fRn4ucavYl`E&hFse)YesOwpZn|2bjLqQMexJ)stdmn zon351e)$zW8X_0E6TC?o@gWXZNFRmf(f|V-JnoUdM?z#4h8n6h4(MPjJ#M7 zuF!Z=a-i<6F5CsXOb0&dK#SVDbVNH5@Ah4)L>2h08eB~vK4CHL1!3`W#)e8Ts5f^6 z@$JZ?>$j5*5^V!ry1;pNzm~%zQOW-6NbW*B`z^~+LIyvEckup7{H(A6_l{oeE{jRe z!NK>>sl{dy&BhAk?S--@eXQsghGx0k{f2{aore#7ZNxe1?c80L#!1jOl(wcZJlMN@ z=|7GVUzZ>Gbh=f98T`GglggW6hYj+P3rU_8mcXvH?j8P^m7WxO!8f1V1+dTgE2V6t zZ--xp?2VW}G+`q?c#Yn5g6OQU36Xg>e^nnXDtm0>QLs)rsQ7q~re6zKB^?}~&x~yz zPBaI0dD&0w$G zU)X%6DEh$l5JXw_K#RQg-&7A?N(XHY^nuO25l!i!LHwWGS?M0pp0Eje4c-ly=Sfa{ zYeCpOzH|qo*;rBl&&wxA$rXsGl1X=bh3MNe%D3)sLc|sMkh_2!ZHeo-ww>3I!cF*AyVW! zCx%@r44(1cg?-0XzS)`dJYhQ@-#P7o-?;=4E(tiXM;bwMflAyA%1#2suJf(kN8^HD^xxB z8quDx3-i7nJT=*q+!J4q^L!i0X-o370$BFu=CUI6Bb~X9yMK_JFdy-iBc|F;qIs~_ z$u&U|GyGQRY}-A=&o1WT9#Ob+o{6L{&x5|&vHJxs{Bt?P>8>}TK-81N^%ikaPv$F6 zoF#o8)=dfbODoSAfQLR(_36e~A?#hz5S>CogE!unO3pRFQ4RGVEZ_$5b%>W%qNX0> zm-PNER%2g5N9(Aiu$yt^#%ApKq}WHZ>0WP$uf~20zRTzCkHoj|aZkOqFo9?@;{Vd+ zt%sOOcrLIl`HUL(trh$B;`G@Afft@57L0Lu(iWjYc5X6E$f=C)qrrYdoUmWO%>(e# z?*Sk6;`|9qPA>NSw0pq^62#T>ybFd}5zia@#|YT7O3_!$r@F_o`JQNJE`0x+wRf5) zIh)VPf%>svZhjl$@kVIP^$h$Z-O+F_={b-u!%9}IL9`Ix3x?*-nd#mvhh0w9P7NhJ zIqVt|acCjY{}x+tuC2DmP95@8zJB-M77 zIk)|li1#|Z|44HB;5lyIC1%nSl}G<=)_F3~|65oIe?5BZ*Ug3R$>rj@_hZk?!+oH} zrkP`jZ-IV`qTlKgofS4APR7M=dn-hoJbKbRDl2_8;_LAqMJONV-7;~lz=}NGH?nBS ztj4kB8stabx;rxE2V2h*t;dQprw=T}M_ox-)=9+H)8RgrCsZ+?&1chkKJIzlYqli5 zwgT?Ey(>>8`ggG$@%7}^^CLE#bLoRzsS^0fcwlEP2K@Z*Ie*c-0@RNMJ@=(`-Cu$l z@s{6v=ZIe_L8yjZayus$;-k)OEY{?+4&w|d^IS5-anh9YC$bu!N$!jHrH{>g%ST*o z(Vso6g`JK>RZ6b{x?0ziElwX+hS&~BHD&})1z$8k3?(XSHI`Ui-;yH z@WXTAlEK@F_JmD==*LIPefA{x#FwM~94_7p-ugKRvG1*TpNTEip>DK$HFq_eudj^0 zckM=91Nzv^mN{U>j39@9Qm*=BdCyir@BR6Za~Vg&hL|^D{NqOk)VnTks?KMSpC$5F zyTH~X+E4(`>6LSy=nyBpd)N=?(6=UCmzhcK39FH*h3?9@7SxLhjt;B%W$<3YvW^b6 zz5sq}!<;vZFn@z(@&vVWe*g=s82HspEF?n`753AdN2Gt zfkl^*4L=77>e|vk?t!06(YtYJ&l(k|A*D_MpZ}$2kiA>%8>6w zd&1g+_?_N2*k*x3r=EXK5F-w)*Lue*@}OQ7Fu7=)0OzfEd3YhKxFNxRuoHEy>9*~`2H+0^OCDs284>EKaBIFydB)Zg1mRv8@OmekZ$N!( zU*^asCGukTm52dsIh!`aF0b!RkB}ihT~TAKY`F+=SH1o_H(LqMB;4h@&#QzV9&t}~ zGaw=wtuJty6#3u}s~X!=*Z{ zCX<|lb?y0!v~bgivv!GjR77VNOW^0;qy6e?5ND02%vdGleOJPK5X+pS+5 zBEB80GT z1S>e217R2RsEeUdS6Y!&k9r{&-%=AzSPnnsocnPl(OF@2CB%2H8L0m0poKlo4|(pU z4cM1`+h%mzbP&N$_SQ>V672~)xOk45gTF>r0Pp`d&*!!`>2u+){T&CKRO5WDSI>14 z-xF3qpQq}i_aqm>KH7I9XLynmUk$rOb)No6gLCKa{o~vuXJZHAYt+{o-T4^z;ZWTu zww#A}@TvNA74e0|@IKhtP7PJ?!=v&wW|@#Ly=!@YA~_p#pttpKbbI34VBe4 ztb-qd`gz|cny>)*_0+W$-8vmas6V~e=5&v@f!@_;>_n1#!Umkfd-}jmB$sh9&y?$# z>MzL+s24B0y*#Ez9bHqS-#Y^$W|r5mz9eU34f@5|cG0j-Iw(<>com@n_Xc$t3h}dxt?)zMp$`+CxCeZXD7D>y{aIhs98Keeh~rYPfBZXK8T_%Q z`WO+(Jz+Wawc>uzR3q-gUC!)46lDY_;&$cgHHF29&%Ld_X);Q)rp)Mz$&+dxAx#tV zr!JqrS&ldxe>2}yQw6+-6qphyfc?)@SybJM`{d0HW8&qgG_lpzp%>Sz8LX;e_x!~h)6T^o{ntJ2x9c5 zi;504iL1xCb3f)8iIyWz&e^^O6Rm(fy-$tEpqKQdeX0m?dar+u+oaEf+@`JEiGe*71Eo*os4u+b+?4|4 zXYQ6MpDoz;`-Qb3O$R&99X4b5I-&)*hxV#c{{qp3g_t)WpHyu?{vFbu{z7~k@@Yau zvE4jA`Zd>jM}!D!b2VSq{-g>1gE@$^3MKD{vDl0jb*90)D%e#z@ImLyIb5R1jo(Yl z_pQl=9f}{DW0qAz90ZurdyG6zh)#Fu0Lx%g8>D)1#&ZeVmem|>^z z3#)3&5l`WNzOSdpI&YpoyU)kGjX$T}BR#@q>}Y;7mA4Kv?CG}E#|8Zk{LA#6I>{pWA}wk-~3dH|$%h zMx8v6_mi3Up0ES^JwNVqe@}85;<|feBL4eputFU9WcPKwANqdqJ&*cQ__J2%z%=#$ z0ZkzM>l&6S!+uNoq#_zKf)xEUF;DlM#C0KGaxHjP)dj}J36hP(x1!(t{bhlZXeP~r zGt-_%rh@=>D&N-EOf+G8DSRK&3ODGnuL*un7ZX1#Z1#u0QfIpRqooq&G3{N>9;bz$ z-xnJ@g!pFM3(rj5sU}(iOBJ(LgV!>G81t1l*g7&J7w<|U-#hy){-1wonQ)}(Cbpc1 znY^nx*0A|R>yfXCMGMU&ng_cuZ}f##utTNw!Dos8yV!uZJh?pftsMJbI-;t-6z47W z-giuP=i?&&H4{Fr)FCeRzPZsxjtu>qJJFKWcr)_4#-lO?oVcGa*x&heR{Cr?2OZpd z_?_Mc_|^O3;{haBA}@tKL&AtQq8>Po)mveN-uJ%>cObqLe)QcmDuie@Ho?C0Ld{3n ze4>Te_q%J{i#o*N#$quSiT_Wr8g(p6zd0`t^ZDJ%<@ToodFlLP$qDv+hWz+@6Z$DF z9LS%XZ!cTrxYu}J=e8w1OA++fg+JcIBR*j(`e5F^{2F@n8_mf}yNJ(6T{%6;ew}Cr z^XBZ@wm;EMD6Gm`!;V{(pjqeA!?_VO^=Z!(p z!K9~wKV|be;FKA`jPpm8v29=wC!tHOXi2I@9DX}mw;j=9iMh#I-e+?GwGuO9fS^@6C9ojDK{%dXg_6dLIziGThdMd=l zjsAmb5KUN#eVqGCp(HvJMjsj%lyWQ+KMRHv`PCs;ugrGMVjPKOuy5qTY0ZdcV^cNM z;rrv|_PN7#z|IMZtd zte6fW=#6jpVX78+wB`Mf3+A$TzPh4EHerdHIzn>FdgL56xKFCWn8%xm-^sZek zRk#3DUc6ZRcAPyCVO4E)kz=8#5i zn)N|}I4-*2*<~B{(NL9d3ro!C_{i_4-$sa$|0#8Iw<5U_c0StYl9^~WHlqH-*e17N z^Vzf(>kfHe^ah)6!g)$9)RlC>{=p?aH72y8rf(c^n+s2z5FwM(*%^syN*qV?#dpblY)+!MH^& zhs>vO7Q}hP=0PJAu+!FNfwhUB6;`0a98I2v=>0iJkPp0S5BvOFir=`ZBCi@Pc8@o~ zZuK@z4RMwMf8zwJ5OrnHmce13#>?^jBu^P{M149aG2Zt@n8!Nf)v@8qmLU4Xp$5LL@U{On={_8Ztm>&{0mEG20b(@GADyR;#=#ixT2@f6kf zLKq+QeQeataYgZ{IJUNAiD)Ias&xoB8ek z={Pa+XxY26C;#a<(w89KnX|c7a>UEAw`p(nrh^FmE~(#1cfS_neEz8gWj5%a9$C_* z#642kbzdn5EZ07EVIK?p8C9k>pT=hwOEI7Kj$Av8n7@;#NFFol(zY=ve`PgZg`F0X z`J7|xxlpItPW$m59?8@GQbb7i*%gUqV?Fjiu4tr^%_rK7xLde;`3j;5>(la%pVXCT zCG^g$+30Z{(#tN^;GV3AOMCkuBk16tlWSY9BcTyVLP(MFQVv@9|W2Sqv`)AbpL8+miEK0sa96jt2JK@ts zHTvmYrcO=bv$05k_m7SZ?8}4yZBv>ql%lU)=|64}4|PGu$!&Aue38YXBG}`ImiQt5 zZWQRkL4U1YCqKNM5d`1_C#*4NQ~bHKmTyR!dLKKxd#1f zNOW^pCml4{_c?RVF+}sq;`gS7P2!0*z#bb)H-+qzfLA;iq z7g67nocLL`b}f$hvP(h!b-%?suo4hX>o5lwd+}D72>6ds-Kvx z??k_dOT5~E_%ifCbDmQ=G1e(}UOJligthR$*V*{*MC*O<_ij2B`2N>#Wd4vT54B$SU1vtrz@Lx$!R2DT@Bj5a(ho`c zC!;U^y;5UsCpMpGBkZx*5O4fj$`>`{VhO19`Y`m& zUx{%Kf+u*aGXmUydIvGRNZ%9I!vD|q7wn}%etFlN)`YERK>R1v|CFhp^H4W8?C|01 z(YO37mJGB(ujTYwcwpFD7|*u^x*0+E;P=%?OG> zJYU&YzD-8%4@wI=E}HbZA948bPp2JSx)7aRtcQJ4AA0_~s2t??)+>(?{9)6 zhY3HIX67nkC*K11d-0LEi^rUF*EOwQ+Iw4$nVCnVa|Gq^cOAa_o+%T~HS}YtOwT(R#BZTLcewAtM#NcsiQF4J&14M1@6<=1f3joTu{i}% z9e)m1oV!Th(RD~_MPJ=htKvZ^?0<0L8+Y83+!I!yKKt1|#afW3y9!MUVe3f|=ef^E z?$IKD!d`{d6r+CRZ}_!3Th9)^)#?%;BEA`Q=v&i{pSXzo>z`kow!_}Tqn2JFxf< zr>|}!nvL!7r{S~W0-MjKMOfGS;oojMu;oMxkZJL8gIf|UMjsn;kq z*gv)K`7G;z5Psa$^K&c*^O%BSZqRrh)@hRGVJ8LhyhUI2RpJxYAWmwx^UgzbR+wKH zzk@$5_(YFL__pY}OH(23-kJh$X9NN2ZPRGcWG>?3S)L?2Nd?%4BO%#scj6nc|G&#! zyv@VB``@fZwEa6UA*0ux9bdsv7QYwgcvD}Ab-SlJU(&2*tTV2)X{*d1`Tf*>Q-u4` z@MTkwZNCRP_^D4^)fOTz^l#ylbL?4!SU=CDay}?ww@SqRMEV&xe9s@*X%(xPX{GVs87DtmuSLT*vq+o zTqZw~oG>5fxH2J!*ok>7Utaov_@1zfk9=OWuenHwyl6B;OnM^R`zDl~-j|0ww9Ccl zG8sVu|BQdzWLZWo{!KC}WORM6!VK(fVm{sEqptFAjJm{w-3NZok5i|E2z6oU$|7qx zxF-s{FMqNj&i{Bg(S6^u;k*fjE{`C67czj?RJ(&{!d!2}Yf@O|I{F_4J>sjwj&Im) zIw(*g_w*=od3<2W?@`L$nn8N}9C2v>o}&yYw|s%g6KZfu~I*mlem~ z**P%08PWf*u^sWXz4Lg16@HAu|Nq2^{RUUbB~*iNRj$YsFP`=%LgcqPYrfBxyWm%? zxKSH6-xF;_T^%*8<8wzDJXib{mhJT|@KjvuyGd@qL%q%exeBr z3gErW2|wP$GxG88`=^GSCOKg~{69J|OesZ1bdxV{PJ9LI`C(D$2}8Yp}^noDg#UGQzz+-+wa?38=NquVsz z9*FmA)^187T7o|575g<<0>66Cj_OK$!gkcDk*$knI={0L-p@PsKtg(4Xw=j!1|-UbW|!J_bu+*6^X<{l|S=P#%5YYsz4f3!p!2 zey6Ki#C?D~`YZ9X!b;4mzHfgfL_ZFmG2KG?@?40|oI*R%{}gMH$I}WXwb$ePZ-%xT z!5*)H{TuAR)SQn#@@zufKDJzo{7_!#d0LCQKToTDNpd^%rq{qe@_^aQS0?UZ6M?I)r)Vo*#iLw?<;SuGKaKe-btUZ z$RBY=5*LS+&z8}h9kA#_1Go7C!!1v|2o6p$u@eAO4 z+r^ku#McDjep!FFyU!4xum<<9dzQxoL z&Sdk6mf-$SV$r&FMB8z`;K*j5b+BK2gKv){s6%b-?bec.main") - val inventory = StoreApi().getInventory() - println("Inventory : $inventory") - val pet = Pet(name = "Elliot", photoUrls = listOf("https://jameshooverstudios.com/wp-content/uploads/2015/04/Majestic-Dog-Photography-Elliot-Nov-5-2014.jpg", "https://express-images.franklymedia.com/6616/sites/981/2020/01/22105725/Elliott.jpg"), id = 123456453, category = Category(id = 13259476, name = "dog"), tags = listOf(Tag(id = 194093, name = "Elliot")), status = Pet.Status.AVAILABLE) - PetApi().addPet(pet) - val elliot = PetApi().getPetById(123456453) - println("Elliot : $elliot") - assert(pet == elliot) - println(".main") - -} diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 4d9d2e534d..2c33cebc9c 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.fasterxml.jackson.core.type.TypeReference @@ -247,7 +246,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index d939e3d5a4..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,494 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get all pets - * - * @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional) - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getAllPets(lastUpdated: java.time.OffsetDateTime?) : kotlin.collections.List { - val localVariableConfig = getAllPetsRequestConfig(lastUpdated = lastUpdated) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getAllPets - * - * @param lastUpdated When this endpoint was hit last to help indentify if the client already has the latest copy. (optional) - * @return RequestConfig - */ - fun getAllPetsRequestConfig(lastUpdated: java.time.OffsetDateTime?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - if (lastUpdated != null) { - put("lastUpdated", listOf(parseDateToQueryString(lastUpdated))) - } - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/getAll", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index e1d5bc9c41..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,245 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - return value.toString() - } -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6e..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index c344dff4af..2e95b6cbad 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -26,7 +26,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -254,7 +253,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES index d1f6eddcef..4bfcf9fb54 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/FILES @@ -21,7 +21,6 @@ src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt src/main/kotlin/org/openapitools/client/infrastructure/ApiResponse.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 78223583f6..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - suspend fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 4ab794d660..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 911bbee5b6..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index bcbb1cf862..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.gson.toJson(content, T::class.java).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.gson.fromJson(bodyContent, T::class.java) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.gson.toJson(value, T::class.java).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 6120b08192..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,33 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException - -class ByteArrayAdapter : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: ByteArray?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(String(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): ByteArray? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return out.nextString().toByteArray() - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac07..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index 30ef669718..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDate?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDate? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDate.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 3ad781c66c..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: LocalDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): LocalDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return LocalDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index e615135c9c..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,35 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: OffsetDateTime?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): OffsetDateTime? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return OffsetDateTime.parse(out.nextString(), formatter) - } - } - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index b80e0390de..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.Gson -import com.google.gson.GsonBuilder -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.OffsetDateTime -import java.util.UUID -import java.util.Date - -object Serializer { - @JvmStatic - val gsonBuilder: GsonBuilder = GsonBuilder() - .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) - .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) - .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) - .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) - - @JvmStatic - val gson: Gson by lazy { - gsonBuilder.create() - } -} diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fc89bf34e7..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @SerializedName("code") - val code: kotlin.Int? = null, - @SerializedName("type") - val type: kotlin.String? = null, - @SerializedName("message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index b483bee69b..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index d6bacf867c..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("petId") - val petId: kotlin.Long? = null, - @SerializedName("quantity") - val quantity: kotlin.Int? = null, - @SerializedName("shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @SerializedName("status") - val status: Order.Status? = null, - @SerializedName("complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "placed") placed("placed"), - @SerializedName(value = "approved") approved("approved"), - @SerializedName(value = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index afa65785d3..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @SerializedName("name") - val name: kotlin.String, - @SerializedName("photoUrls") - val photoUrls: kotlin.collections.List, - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("category") - val category: Category? = null, - @SerializedName("tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @SerializedName("status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @SerializedName(value = "available") available("available"), - @SerializedName(value = "pending") pending("pending"), - @SerializedName(value = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index a1a282cb38..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 59ba0254f6..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.google.gson.annotations.SerializedName -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @SerializedName("id") - val id: kotlin.Long? = null, - @SerializedName("username") - val username: kotlin.String? = null, - @SerializedName("firstName") - val firstName: kotlin.String? = null, - @SerializedName("lastName") - val lastName: kotlin.String? = null, - @SerializedName("email") - val email: kotlin.String? = null, - @SerializedName("password") - val password: kotlin.String? = null, - @SerializedName("phone") - val phone: kotlin.String? = null, - /* User Status */ - @SerializedName("userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 43f89e88cb..8ed9955f64 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import kotlin.coroutines.resume import kotlin.coroutines.resumeWithException @@ -261,7 +260,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index c5d330ac07..0000000000 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,37 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.google.gson.TypeAdapter -import com.google.gson.stream.JsonReader -import com.google.gson.stream.JsonWriter -import com.google.gson.stream.JsonToken.NULL -import java.io.IOException -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -class DateAdapter(val formatter: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault())) : TypeAdapter() { - @Throws(IOException::class) - override fun write(out: JsonWriter?, value: Date?) { - if (value == null) { - out?.nullValue() - } else { - out?.value(formatter.format(value)) - } - } - - @Throws(IOException::class) - override fun read(out: JsonReader?): Date? { - out ?: return null - - when (out.peek()) { - NULL -> { - out.nextNull() - return null - } - else -> { - return formatter.parse(out.nextString()) - } - } - } -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 25447c818e..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 18d2ce3dbb..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,33 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ -@JsonClass(generateAdapter = true) -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 8396fa4235..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A category for a pet - * @param id - * @param name - */ -@JsonClass(generateAdapter = true) -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index d7091dd4c0..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,55 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ -@JsonClass(generateAdapter = true) -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 8b4e6b44d4..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,57 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ -@JsonClass(generateAdapter = true) -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index e7cdab2bb5..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A tag for a pet - * @param id - * @param name - */ -@JsonClass(generateAdapter = true) -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 1bfad84490..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,49 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import com.squareup.moshi.JsonClass - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ -@JsonClass(generateAdapter = true) -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200..2abf02f23b 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index b6b38fa42f..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 19b7acdbd3..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 979bb1b81f..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index d26cda9091..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -internal typealias MultiValueMap = MutableMap> - -internal fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -internal val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -internal fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -internal fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index c4da8e3989..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -internal open class ApiClient(val baseUrl: String) { - internal companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index c618544573..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -internal enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -internal interface Response - -internal abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -internal class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -internal class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -internal class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -internal class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -internal class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index d7f9079c0d..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -internal object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index 86bcb51fba..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -internal class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index 204b69dcb0..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -internal open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - internal companion object { - private const val serialVersionUID: Long = 123L - } -} - -internal open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - internal companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index e86215d571..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -internal class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index fe7069904c..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -internal class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index be7703c103..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -internal class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 68f41c5497..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -internal data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index e0fbb1e652..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -internal enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 858d1b7339..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -internal val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -internal val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -internal val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -internal val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 7265f75914..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -internal object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index 02fa692b57..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -internal class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index a695278dfa..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -internal data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index 376994a9b2..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -internal data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a943b97c1e..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -internal data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - internal enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 544fab20f5..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -internal data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - internal enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index d9b84e93ea..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -internal data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index e0e821cd7e..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -internal data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 6ef92322fb..90c872b1e3 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ internal open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index d7f9079c0d..0000000000 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -internal object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 95f695cb9f..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List? { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet? { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse? { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index c442f86610..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map? { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order? { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order? { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 6e6c329144..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User? { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String or null - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String? { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String? - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 77066de4e5..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T?, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ed8f8b13a4..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 105f485f02..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a1..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5b..0000000000 --- a/samples/client/petstore/kotlin-nullable/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200..2abf02f23b 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 9d526273d7..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,249 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.MediaType -import okhttp3.FormBody -import okhttp3.HttpUrl -import okhttp3.ResponseBody -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> RequestBody.create( - MediaType.parse(mediaType), content - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.of( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = MediaType.parse(guessContentTypeFromFile(value)) - addPart(partHeaders, RequestBody.create(fileMediaType, value)) - } else { - val partHeaders = Headers.of( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - RequestBody.create(null, parameterToString(value)) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> RequestBody.create( - MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content) - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code(), - response.headers().toMultimap() - ) - response.isInformational -> return Informational( - response.message(), - response.code(), - response.headers().toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body(), accept), - response.code(), - response.headers().toMultimap() - ) - response.isClientError -> return ClientError( - response.message(), - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - else -> return ServerError( - response.message(), - response.body()?.string(), - response.code(), - response.headers().toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 037fedbd18..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code() in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code() in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code() in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code() in 500..999 diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6e..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 17646c1df1..08053e0e04 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -23,7 +23,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -245,7 +244,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES index 247ff9a723..fd9029f088 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/FILES @@ -30,7 +30,6 @@ src/main/kotlin/org/openapitools/client/infrastructure/BigDecimalAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/BigIntegerAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt deleted file mode 100644 index 0c8a4fa54d..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/DateAdapter.kt +++ /dev/null @@ -1,28 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlinx.serialization.KSerializer -import kotlinx.serialization.Serializer -import kotlinx.serialization.encoding.Decoder -import kotlinx.serialization.encoding.Encoder -import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor -import kotlinx.serialization.descriptors.PrimitiveKind -import kotlinx.serialization.descriptors.SerialDescriptor -import java.text.DateFormat -import java.text.SimpleDateFormat -import java.util.Date -import java.util.Locale - -@Serializer(forClass = Date::class) -object DateAdapter : KSerializer { - private val df: DateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault()) - - override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Date", PrimitiveKind.STRING) - - override fun serialize(encoder: Encoder, value: Date) { - encoder.encodeString(df.format(value)) - } - - override fun deserialize(decoder: Decoder): Date { - return df.parse(decoder.decodeString())!! - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index e769dec78e..bbb1363803 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,6 +1,5 @@ package org.openapitools.client.infrastructure -import java.util.Date import java.math.BigDecimal import java.math.BigInteger import java.time.LocalDate @@ -20,7 +19,6 @@ object Serializer { val kotlinSerializationAdapters = SerializersModule { contextual(BigDecimal::class, BigDecimalAdapter) contextual(BigInteger::class, BigIntegerAdapter) - contextual(Date::class, DateAdapter) contextual(LocalDate::class, LocalDateAdapter) contextual(LocalDateTime::class, LocalDateTimeAdapter) contextual(OffsetDateTime::class, OffsetDateTimeAdapter) diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 90e791f37a..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import okhttp3.MultipartBody - -interface PetApi { - /** - * Add a new pet to the store - * - * Responses: - * - 405: Invalid input - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @POST("pet") - fun addPet(@Body body: Pet): Completable - - /** - * Deletes a pet - * - * Responses: - * - 400: Invalid pet value - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return [Call]<[Unit]> - */ - @DELETE("pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Completable - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Responses: - * - 200: successful operation - * - 400: Invalid status value - * - * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.collections.List]> - */ - @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Single> - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Responses: - * - 200: successful operation - * - 400: Invalid tag value - * - * @param tags Tags to filter by - * @return [Call]<[kotlin.collections.List]> - */ - @Deprecated("This api was deprecated") - @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Single> - - /** - * Find pet by ID - * Returns a single pet - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - * @param petId ID of pet to return - * @return [Call]<[Pet]> - */ - @GET("pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Single - - /** - * Update an existing pet - * - * Responses: - * - 400: Invalid ID supplied - * - 404: Pet not found - * - 405: Validation exception - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @PUT("pet") - fun updatePet(@Body body: Pet): Completable - - /** - * Updates a pet in the store with form data - * - * Responses: - * - 405: Invalid input - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return [Call]<[Unit]> - */ - @FormUrlEncoded - @POST("pet/{petId}") - fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Completable - - /** - * uploads an image - * - * Responses: - * - 200: successful operation - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> - */ - @Multipart - @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Single - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 11acb2eb8b..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,63 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.Order - -interface StoreApi { - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Responses: - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("store/order/{orderId}") - fun deleteOrder(@Path("orderId") orderId: kotlin.String): Completable - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Responses: - * - 200: successful operation - * - * @return [Call]<[kotlin.collections.Map]> - */ - @GET("store/inventory") - fun getInventory(): Single> - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> - */ - @GET("store/order/{orderId}") - fun getOrderById(@Path("orderId") orderId: kotlin.Long): Single - - /** - * Place an order for a pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid Order - * - * @param body order placed for purchasing the pet - * @return [Call]<[Order]> - */ - @POST("store/order") - fun placeOrder(@Body body: Order): Single - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index d6fad78e88..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,114 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import okhttp3.RequestBody -import io.reactivex.rxjava3.core.Single; -import io.reactivex.rxjava3.core.Completable; - -import org.openapitools.client.models.User - -interface UserApi { - /** - * Create user - * This can only be done by the logged in user. - * Responses: - * - 0: successful operation - * - * @param body Created user object - * @return [Call]<[Unit]> - */ - @POST("user") - fun createUser(@Body body: User): Completable - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body body: kotlin.collections.List): Completable - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithList") - fun createUsersWithListInput(@Body body: kotlin.collections.List): Completable - - /** - * Delete user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Completable - - /** - * Get user by user name - * - * Responses: - * - 200: successful operation - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> - */ - @GET("user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Single - - /** - * Logs user into the system - * - * Responses: - * - 200: successful operation - * - 400: Invalid username/password supplied - * - * @param username The user name for login - * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> - */ - @GET("user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Single - - /** - * Logs out current logged in user session - * - * Responses: - * - 0: successful operation - * - * @return [Call]<[Unit]> - */ - @GET("user/logout") - fun logoutUser(): Completable - - /** - * Updated user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid user supplied - * - 404: User not found - * - * @param username name that need to be deleted - * @param body Updated user object - * @return [Call]<[Unit]> - */ - @PUT("user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body body: User): Completable - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt deleted file mode 100644 index 524d5190ef..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt +++ /dev/null @@ -1,50 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException -import java.net.URI -import java.net.URISyntaxException - -import okhttp3.Interceptor -import okhttp3.Response - -class ApiKeyAuth( - private val location: String = "", - private val paramName: String = "", - private var apiKey: String = "" -) : Interceptor { - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - var request = chain.request() - - if ("query" == location) { - var newQuery = request.url.toUri().query - val paramValue = "$paramName=$apiKey" - if (newQuery == null) { - newQuery = paramValue - } else { - newQuery += "&$paramValue" - } - - val newUri: URI - try { - val oldUri = request.url.toUri() - newUri = URI(oldUri.scheme, oldUri.authority, - oldUri.path, newQuery, oldUri.fragment) - } catch (e: URISyntaxException) { - throw IOException(e) - } - - request = request.newBuilder().url(newUri.toURL()).build() - } else if ("header" == location) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build() - } else if ("cookie" == location) { - request = request.newBuilder() - .addHeader("Cookie", "$paramName=$apiKey") - .build() - } - return chain.proceed(request) - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt deleted file mode 100644 index 311a8f4397..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuth.kt +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.client.auth - -import java.net.HttpURLConnection.HTTP_UNAUTHORIZED -import java.net.HttpURLConnection.HTTP_FORBIDDEN - -import java.io.IOException - -import org.apache.oltu.oauth2.client.OAuthClient -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException -import org.apache.oltu.oauth2.common.message.types.GrantType -import org.apache.oltu.oauth2.common.token.BasicOAuthToken - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import okhttp3.Response - -class OAuth( - client: OkHttpClient, - var tokenRequestBuilder: TokenRequestBuilder -) : Interceptor { - - interface AccessTokenListener { - fun notify(token: BasicOAuthToken) - } - - private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) - - @Volatile - private var accessToken: String? = null - var authenticationRequestBuilder: AuthenticationRequestBuilder? = null - private var accessTokenListener: AccessTokenListener? = null - - constructor( - requestBuilder: TokenRequestBuilder - ) : this( - OkHttpClient(), - requestBuilder - ) - - constructor( - flow: OAuthFlow, - authorizationUrl: String, - tokenUrl: String, - scopes: String - ) : this( - OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) - ) { - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - fun setFlow(flow: OAuthFlow) { - when (flow) { - OAuthFlow.accessCode, OAuthFlow.implicit -> - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) - OAuthFlow.password -> - tokenRequestBuilder.setGrantType(GrantType.PASSWORD) - OAuthFlow.application -> - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) - } - } - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - return retryingIntercept(chain, true) - } - - @Throws(IOException::class) - private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { - var request = chain.request() - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request) - } - - // If first time, get the token - val oAuthRequest: OAuthClientRequest - if (accessToken == null) { - updateAccessToken(null) - } - - if (accessToken != null) { - // Build the request - val rb = request.newBuilder() - - val requestAccessToken = accessToken - try { - oAuthRequest = OAuthBearerClientRequest(request.url.toString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage() - } catch (e: OAuthSystemException) { - throw IOException(e) - } - - oAuthRequest.headers.entries.forEach { header -> - rb.addHeader(header.key, header.value) - } - rb.url(oAuthRequest.locationUri) - - //Execute the request - val response = chain.proceed(rb.build()) - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body?.close() - return retryingIntercept(chain, false) - } - } catch (e: Exception) { - response.body?.close() - throw e - } - } - return response - } else { - return chain.proceed(chain.request()) - } - } - - /** - * Returns true if the access token has been updated - */ - @Throws(IOException::class) - @Synchronized - fun updateAccessToken(requestAccessToken: String?): Boolean { - if (accessToken == null || accessToken.equals(requestAccessToken)) { - return try { - val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) - if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { - accessToken = accessTokenResponse.accessToken - accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) - !accessToken.equals(requestAccessToken) - } else { - false - } - } catch (e: OAuthSystemException) { - throw IOException(e) - } catch (e: OAuthProblemException) { - throw IOException(e) - } - } - return true; - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt deleted file mode 100644 index bcada9b7a6..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthFlow.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.openapitools.client.auth - -enum class OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt deleted file mode 100644 index 93adbda3fc..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException - -import org.apache.oltu.oauth2.client.HttpClient -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.response.OAuthClientResponse -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException - -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.RequestBody - - -class OAuthOkHttpClient( - private var client: OkHttpClient -) : HttpClient { - - constructor() : this(OkHttpClient()) - - @Throws(OAuthSystemException::class, OAuthProblemException::class) - override fun execute( - request: OAuthClientRequest, - headers: Map?, - requestMethod: String, - responseClass: Class?): T { - - var mediaType = "application/json".toMediaTypeOrNull() - val requestBuilder = Request.Builder().url(request.locationUri) - - headers?.forEach { entry -> - if (entry.key.equals("Content-Type", true)) { - mediaType = entry.value.toMediaTypeOrNull() - } else { - requestBuilder.addHeader(entry.key, entry.value) - } - } - - val body: RequestBody? = if (request.body != null) RequestBody.create(mediaType, request.body) else null - requestBuilder.method(requestMethod, body) - - try { - val response = client.newCall(requestBuilder.build()).execute() - return OAuthClientResponseFactory.createCustomResponse( - response.body?.string(), - response.body?.contentType()?.toString(), - response.code, - responseClass) - } catch (e: IOException) { - throw OAuthSystemException(e) - } - } - - override fun shutdown() { - // Nothing to do here - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 30f649932f..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapitools.client.infrastructure - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.OAuth -import org.openapitools.client.auth.OAuth.AccessTokenListener -import org.openapitools.client.auth.OAuthFlow - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import retrofit2.Retrofit -import okhttp3.logging.HttpLoggingInterceptor -import retrofit2.converter.scalars.ScalarsConverterFactory -import retrofit2.adapter.rxjava3.RxJava3CallAdapterFactory -import com.squareup.moshi.Moshi -import retrofit2.converter.moshi.MoshiConverterFactory - -class ApiClient( - private var baseUrl: String = defaultBasePath, - private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val okHttpClient : OkHttpClient? = null -) { - private val apiAuthorizations = mutableMapOf() - var logger: ((String) -> Unit)? = null - - private val retrofitBuilder: Retrofit.Builder by lazy { - Retrofit.Builder() - .baseUrl(baseUrl) - .addConverterFactory(ScalarsConverterFactory.create()) - - .addCallAdapterFactory(RxJava3CallAdapterFactory.create()) - .addConverterFactory(MoshiConverterFactory.create(serializerBuilder.build())) - } - - private val clientBuilder: OkHttpClient.Builder by lazy { - okHttpClientBuilder ?: defaultClientBuilder - } - - private val defaultClientBuilder: OkHttpClient.Builder by lazy { - OkHttpClient() - .newBuilder() - .addInterceptor(HttpLoggingInterceptor(object : HttpLoggingInterceptor.Logger { - override fun log(message: String) { - logger?.invoke(message) - } - }).apply { - level = HttpLoggingInterceptor.Level.BODY - }) - } - - init { - normalizeBaseUrl() - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authNames: Array - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder) { - authNames.forEach { authName -> - val auth = when (authName) { - "api_key" -> ApiKeyAuth("header", "api_key")"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") - else -> throw RuntimeException("auth name $authName not found in available auth names") - } - addAuthorization(authName, auth); - } - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authName: String, - clientId: String, - secret: String, - username: String, - password: String - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { - getTokenEndPoint() - ?.setClientId(clientId) - ?.setClientSecret(secret) - ?.setUsername(username) - ?.setPassword(password) - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - fun getTokenEndPoint(): TokenRequestBuilder? { - var result: TokenRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = tokenRequestBuilder - } - return result - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { - var result: AuthenticationRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = authenticationRequestBuilder - } - return result - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ - fun setAccessToken(accessToken: String): ApiClient { - apiAuthorizations.values.runOnFirst { - setAccessToken(accessToken) - } - return this - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ - fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { - apiAuthorizations.values.runOnFirst { - tokenRequestBuilder - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI) - authenticationRequestBuilder - ?.setClientId(clientId) - ?.setRedirectURI(redirectURI) - } - return this; - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ - fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { - apiAuthorizations.values.runOnFirst { - registerAccessTokenListener(accessTokenListener) - } - return this; - } - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization interceptor - * @return ApiClient - */ - fun addAuthorization(authName: String, authorization: Interceptor): ApiClient { - if (apiAuthorizations.containsKey(authName)) { - throw RuntimeException("auth name $authName already in api authorizations") - } - apiAuthorizations[authName] = authorization - clientBuilder.addInterceptor(authorization) - return this - } - - fun setLogger(logger: (String) -> Unit): ApiClient { - this.logger = logger - return this - } - - fun createService(serviceClass: Class): S { - val usedClient = this.okHttpClient ?: clientBuilder.build() - return retrofitBuilder.client(usedClient).build().create(serviceClass) - } - - private fun normalizeBaseUrl() { - if (!baseUrl.endsWith("/")) { - baseUrl += "/" - } - } - - private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { - for (element in this) { - if (element is U) { - callback.invoke(element) - break - } - } - } - - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 001e99325d..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt deleted file mode 100644 index 1804d1ae2b..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.JsonDataException -import com.squareup.moshi.Moshi -import retrofit2.Response - -@Throws(JsonDataException::class) -inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? { - val serializer = serializerBuilder.build() - val parser = serializer.adapter(T::class.java) - val response = errorBody()?.string() - if(response != null) { - return parser.fromJson(response) - } - return null -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6e..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325..0000000000 --- a/samples/client/petstore/kotlin-retrofit2-rx3/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index e8b980bc87..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,124 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import okhttp3.MultipartBody - -interface PetApi { - /** - * Add a new pet to the store - * - * Responses: - * - 405: Invalid input - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @POST("pet") - fun addPet(@Body body: Pet): Call - - /** - * Deletes a pet - * - * Responses: - * - 400: Invalid pet value - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return [Call]<[Unit]> - */ - @DELETE("pet/{petId}") - fun deletePet(@Path("petId") petId: kotlin.Long, @Header("api_key") apiKey: kotlin.String): Call - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * Responses: - * - 200: successful operation - * - 400: Invalid status value - * - * @param status Status values that need to be considered for filter - * @return [Call]<[kotlin.collections.List]> - */ - @GET("pet/findByStatus") - fun findPetsByStatus(@Query("status") status: CSVParams): Call> - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * Responses: - * - 200: successful operation - * - 400: Invalid tag value - * - * @param tags Tags to filter by - * @return [Call]<[kotlin.collections.List]> - */ - @Deprecated("This api was deprecated") - @GET("pet/findByTags") - fun findPetsByTags(@Query("tags") tags: CSVParams): Call> - - /** - * Find pet by ID - * Returns a single pet - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Pet not found - * - * @param petId ID of pet to return - * @return [Call]<[Pet]> - */ - @GET("pet/{petId}") - fun getPetById(@Path("petId") petId: kotlin.Long): Call - - /** - * Update an existing pet - * - * Responses: - * - 400: Invalid ID supplied - * - 404: Pet not found - * - 405: Validation exception - * - * @param body Pet object that needs to be added to the store - * @return [Call]<[Unit]> - */ - @PUT("pet") - fun updatePet(@Body body: Pet): Call - - /** - * Updates a pet in the store with form data - * - * Responses: - * - 405: Invalid input - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return [Call]<[Unit]> - */ - @FormUrlEncoded - @POST("pet/{petId}") - fun updatePetWithForm(@Path("petId") petId: kotlin.Long, @Field("name") name: kotlin.String, @Field("status") status: kotlin.String): Call - - /** - * uploads an image - * - * Responses: - * - 200: successful operation - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return [Call]<[ApiResponse]> - */ - @Multipart - @POST("pet/{petId}/uploadImage") - fun uploadFile(@Path("petId") petId: kotlin.Long, @Part("additionalMetadata") additionalMetadata: kotlin.String, @Part file: MultipartBody.Part): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index be05f2bb69..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,62 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.Order - -interface StoreApi { - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * Responses: - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of the order that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("store/order/{orderId}") - fun deleteOrder(@Path("orderId") orderId: kotlin.String): Call - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * Responses: - * - 200: successful operation - * - * @return [Call]<[kotlin.collections.Map]> - */ - @GET("store/inventory") - fun getInventory(): Call> - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * Responses: - * - 200: successful operation - * - 400: Invalid ID supplied - * - 404: Order not found - * - * @param orderId ID of pet that needs to be fetched - * @return [Call]<[Order]> - */ - @GET("store/order/{orderId}") - fun getOrderById(@Path("orderId") orderId: kotlin.Long): Call - - /** - * Place an order for a pet - * - * Responses: - * - 200: successful operation - * - 400: Invalid Order - * - * @param body order placed for purchasing the pet - * @return [Call]<[Order]> - */ - @POST("store/order") - fun placeOrder(@Body body: Order): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 66c1e7fbd2..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,113 +0,0 @@ -package org.openapitools.client.apis - -import org.openapitools.client.infrastructure.CollectionFormats.* -import retrofit2.http.* -import retrofit2.Call -import okhttp3.RequestBody - -import org.openapitools.client.models.User - -interface UserApi { - /** - * Create user - * This can only be done by the logged in user. - * Responses: - * - 0: successful operation - * - * @param body Created user object - * @return [Call]<[Unit]> - */ - @POST("user") - fun createUser(@Body body: User): Call - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithArray") - fun createUsersWithArrayInput(@Body body: kotlin.collections.List): Call - - /** - * Creates list of users with given input array - * - * Responses: - * - 0: successful operation - * - * @param body List of user object - * @return [Call]<[Unit]> - */ - @POST("user/createWithList") - fun createUsersWithListInput(@Body body: kotlin.collections.List): Call - - /** - * Delete user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be deleted - * @return [Call]<[Unit]> - */ - @DELETE("user/{username}") - fun deleteUser(@Path("username") username: kotlin.String): Call - - /** - * Get user by user name - * - * Responses: - * - 200: successful operation - * - 400: Invalid username supplied - * - 404: User not found - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return [Call]<[User]> - */ - @GET("user/{username}") - fun getUserByName(@Path("username") username: kotlin.String): Call - - /** - * Logs user into the system - * - * Responses: - * - 200: successful operation - * - 400: Invalid username/password supplied - * - * @param username The user name for login - * @param password The password for login in clear text - * @return [Call]<[kotlin.String]> - */ - @GET("user/login") - fun loginUser(@Query("username") username: kotlin.String, @Query("password") password: kotlin.String): Call - - /** - * Logs out current logged in user session - * - * Responses: - * - 0: successful operation - * - * @return [Call]<[Unit]> - */ - @GET("user/logout") - fun logoutUser(): Call - - /** - * Updated user - * This can only be done by the logged in user. - * Responses: - * - 400: Invalid user supplied - * - 404: User not found - * - * @param username name that need to be deleted - * @param body Updated user object - * @return [Call]<[Unit]> - */ - @PUT("user/{username}") - fun updateUser(@Path("username") username: kotlin.String, @Body body: User): Call - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt deleted file mode 100644 index 524d5190ef..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/ApiKeyAuth.kt +++ /dev/null @@ -1,50 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException -import java.net.URI -import java.net.URISyntaxException - -import okhttp3.Interceptor -import okhttp3.Response - -class ApiKeyAuth( - private val location: String = "", - private val paramName: String = "", - private var apiKey: String = "" -) : Interceptor { - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - var request = chain.request() - - if ("query" == location) { - var newQuery = request.url.toUri().query - val paramValue = "$paramName=$apiKey" - if (newQuery == null) { - newQuery = paramValue - } else { - newQuery += "&$paramValue" - } - - val newUri: URI - try { - val oldUri = request.url.toUri() - newUri = URI(oldUri.scheme, oldUri.authority, - oldUri.path, newQuery, oldUri.fragment) - } catch (e: URISyntaxException) { - throw IOException(e) - } - - request = request.newBuilder().url(newUri.toURL()).build() - } else if ("header" == location) { - request = request.newBuilder() - .addHeader(paramName, apiKey) - .build() - } else if ("cookie" == location) { - request = request.newBuilder() - .addHeader("Cookie", "$paramName=$apiKey") - .build() - } - return chain.proceed(request) - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt deleted file mode 100644 index 311a8f4397..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuth.kt +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.client.auth - -import java.net.HttpURLConnection.HTTP_UNAUTHORIZED -import java.net.HttpURLConnection.HTTP_FORBIDDEN - -import java.io.IOException - -import org.apache.oltu.oauth2.client.OAuthClient -import org.apache.oltu.oauth2.client.request.OAuthBearerClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException -import org.apache.oltu.oauth2.common.message.types.GrantType -import org.apache.oltu.oauth2.common.token.BasicOAuthToken - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import okhttp3.Response - -class OAuth( - client: OkHttpClient, - var tokenRequestBuilder: TokenRequestBuilder -) : Interceptor { - - interface AccessTokenListener { - fun notify(token: BasicOAuthToken) - } - - private var oauthClient: OAuthClient = OAuthClient(OAuthOkHttpClient(client)) - - @Volatile - private var accessToken: String? = null - var authenticationRequestBuilder: AuthenticationRequestBuilder? = null - private var accessTokenListener: AccessTokenListener? = null - - constructor( - requestBuilder: TokenRequestBuilder - ) : this( - OkHttpClient(), - requestBuilder - ) - - constructor( - flow: OAuthFlow, - authorizationUrl: String, - tokenUrl: String, - scopes: String - ) : this( - OAuthClientRequest.tokenLocation(tokenUrl).setScope(scopes) - ) { - setFlow(flow); - authenticationRequestBuilder = OAuthClientRequest.authorizationLocation(authorizationUrl); - } - - fun setFlow(flow: OAuthFlow) { - when (flow) { - OAuthFlow.accessCode, OAuthFlow.implicit -> - tokenRequestBuilder.setGrantType(GrantType.AUTHORIZATION_CODE) - OAuthFlow.password -> - tokenRequestBuilder.setGrantType(GrantType.PASSWORD) - OAuthFlow.application -> - tokenRequestBuilder.setGrantType(GrantType.CLIENT_CREDENTIALS) - } - } - - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - return retryingIntercept(chain, true) - } - - @Throws(IOException::class) - private fun retryingIntercept(chain: Interceptor.Chain, updateTokenAndRetryOnAuthorizationFailure: Boolean): Response { - var request = chain.request() - - // If the request already have an authorization (eg. Basic auth), do nothing - if (request.header("Authorization") != null) { - return chain.proceed(request) - } - - // If first time, get the token - val oAuthRequest: OAuthClientRequest - if (accessToken == null) { - updateAccessToken(null) - } - - if (accessToken != null) { - // Build the request - val rb = request.newBuilder() - - val requestAccessToken = accessToken - try { - oAuthRequest = OAuthBearerClientRequest(request.url.toString()) - .setAccessToken(requestAccessToken) - .buildHeaderMessage() - } catch (e: OAuthSystemException) { - throw IOException(e) - } - - oAuthRequest.headers.entries.forEach { header -> - rb.addHeader(header.key, header.value) - } - rb.url(oAuthRequest.locationUri) - - //Execute the request - val response = chain.proceed(rb.build()) - - // 401/403 most likely indicates that access token has expired. Unless it happens two times in a row. - if ((response.code == HTTP_UNAUTHORIZED || response.code == HTTP_FORBIDDEN) && updateTokenAndRetryOnAuthorizationFailure) { - try { - if (updateAccessToken(requestAccessToken)) { - response.body?.close() - return retryingIntercept(chain, false) - } - } catch (e: Exception) { - response.body?.close() - throw e - } - } - return response - } else { - return chain.proceed(chain.request()) - } - } - - /** - * Returns true if the access token has been updated - */ - @Throws(IOException::class) - @Synchronized - fun updateAccessToken(requestAccessToken: String?): Boolean { - if (accessToken == null || accessToken.equals(requestAccessToken)) { - return try { - val accessTokenResponse = oauthClient.accessToken(this.tokenRequestBuilder.buildBodyMessage()) - if (accessTokenResponse != null && accessTokenResponse.accessToken != null) { - accessToken = accessTokenResponse.accessToken - accessTokenListener?.notify(accessTokenResponse.oAuthToken as BasicOAuthToken) - !accessToken.equals(requestAccessToken) - } else { - false - } - } catch (e: OAuthSystemException) { - throw IOException(e) - } catch (e: OAuthProblemException) { - throw IOException(e) - } - } - return true; - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt deleted file mode 100644 index bcada9b7a6..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthFlow.kt +++ /dev/null @@ -1,5 +0,0 @@ -package org.openapitools.client.auth - -enum class OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt deleted file mode 100644 index 93adbda3fc..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/auth/OAuthOkHttpClient.kt +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.client.auth - -import java.io.IOException - -import org.apache.oltu.oauth2.client.HttpClient -import org.apache.oltu.oauth2.client.request.OAuthClientRequest -import org.apache.oltu.oauth2.client.response.OAuthClientResponse -import org.apache.oltu.oauth2.client.response.OAuthClientResponseFactory -import org.apache.oltu.oauth2.common.exception.OAuthProblemException -import org.apache.oltu.oauth2.common.exception.OAuthSystemException - -import okhttp3.OkHttpClient -import okhttp3.Request -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.RequestBody - - -class OAuthOkHttpClient( - private var client: OkHttpClient -) : HttpClient { - - constructor() : this(OkHttpClient()) - - @Throws(OAuthSystemException::class, OAuthProblemException::class) - override fun execute( - request: OAuthClientRequest, - headers: Map?, - requestMethod: String, - responseClass: Class?): T { - - var mediaType = "application/json".toMediaTypeOrNull() - val requestBuilder = Request.Builder().url(request.locationUri) - - headers?.forEach { entry -> - if (entry.key.equals("Content-Type", true)) { - mediaType = entry.value.toMediaTypeOrNull() - } else { - requestBuilder.addHeader(entry.key, entry.value) - } - } - - val body: RequestBody? = if (request.body != null) RequestBody.create(mediaType, request.body) else null - requestBuilder.method(requestMethod, body) - - try { - val response = client.newCall(requestBuilder.build()).execute() - return OAuthClientResponseFactory.createCustomResponse( - response.body?.string(), - response.body?.contentType()?.toString(), - response.code, - responseClass) - } catch (e: IOException) { - throw OAuthSystemException(e) - } - } - - override fun shutdown() { - // Nothing to do here - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index f19c5861dd..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,200 +0,0 @@ -package org.openapitools.client.infrastructure - -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder -import org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder -import org.openapitools.client.auth.ApiKeyAuth -import org.openapitools.client.auth.OAuth -import org.openapitools.client.auth.OAuth.AccessTokenListener -import org.openapitools.client.auth.OAuthFlow - -import okhttp3.Interceptor -import okhttp3.OkHttpClient -import retrofit2.Retrofit -import okhttp3.logging.HttpLoggingInterceptor -import retrofit2.converter.scalars.ScalarsConverterFactory -import com.squareup.moshi.Moshi -import retrofit2.converter.moshi.MoshiConverterFactory - -class ApiClient( - private var baseUrl: String = defaultBasePath, - private val okHttpClientBuilder: OkHttpClient.Builder? = null, - private val serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - private val okHttpClient : OkHttpClient? = null -) { - private val apiAuthorizations = mutableMapOf() - var logger: ((String) -> Unit)? = null - - private val retrofitBuilder: Retrofit.Builder by lazy { - Retrofit.Builder() - .baseUrl(baseUrl) - .addConverterFactory(ScalarsConverterFactory.create()) - .addConverterFactory(MoshiConverterFactory.create(serializerBuilder.build())) - } - - private val clientBuilder: OkHttpClient.Builder by lazy { - okHttpClientBuilder ?: defaultClientBuilder - } - - private val defaultClientBuilder: OkHttpClient.Builder by lazy { - OkHttpClient() - .newBuilder() - .addInterceptor(HttpLoggingInterceptor(object : HttpLoggingInterceptor.Logger { - override fun log(message: String) { - logger?.invoke(message) - } - }).apply { - level = HttpLoggingInterceptor.Level.BODY - }) - } - - init { - normalizeBaseUrl() - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authNames: Array - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder) { - authNames.forEach { authName -> - val auth = when (authName) { - "api_key" -> ApiKeyAuth("header", "api_key")"petstore_auth" -> OAuth(OAuthFlow.implicit, "http://petstore.swagger.io/api/oauth/dialog", "", "write:pets, read:pets") - else -> throw RuntimeException("auth name $authName not found in available auth names") - } - addAuthorization(authName, auth); - } - } - - constructor( - baseUrl: String = defaultBasePath, - okHttpClientBuilder: OkHttpClient.Builder? = null, - serializerBuilder: Moshi.Builder = Serializer.moshiBuilder, - authName: String, - clientId: String, - secret: String, - username: String, - password: String - ) : this(baseUrl, okHttpClientBuilder, serializerBuilder, arrayOf(authName)) { - getTokenEndPoint() - ?.setClientId(clientId) - ?.setClientSecret(secret) - ?.setUsername(username) - ?.setPassword(password) - } - - /** - * Helper method to configure the token endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Token request builder - */ - fun getTokenEndPoint(): TokenRequestBuilder? { - var result: TokenRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = tokenRequestBuilder - } - return result - } - - /** - * Helper method to configure authorization endpoint of the first oauth found in the apiAuthorizations (there should be only one) - * @return Authentication request builder - */ - fun getAuthorizationEndPoint(): AuthenticationRequestBuilder? { - var result: AuthenticationRequestBuilder? = null - apiAuthorizations.values.runOnFirst { - result = authenticationRequestBuilder - } - return result - } - - /** - * Helper method to pre-set the oauth access token of the first oauth found in the apiAuthorizations (there should be only one) - * @param accessToken Access token - * @return ApiClient - */ - fun setAccessToken(accessToken: String): ApiClient { - apiAuthorizations.values.runOnFirst { - setAccessToken(accessToken) - } - return this - } - - /** - * Helper method to configure the oauth accessCode/implicit flow parameters - * @param clientId Client ID - * @param clientSecret Client secret - * @param redirectURI Redirect URI - * @return ApiClient - */ - fun configureAuthorizationFlow(clientId: String, clientSecret: String, redirectURI: String): ApiClient { - apiAuthorizations.values.runOnFirst { - tokenRequestBuilder - .setClientId(clientId) - .setClientSecret(clientSecret) - .setRedirectURI(redirectURI) - authenticationRequestBuilder - ?.setClientId(clientId) - ?.setRedirectURI(redirectURI) - } - return this; - } - - /** - * Configures a listener which is notified when a new access token is received. - * @param accessTokenListener Access token listener - * @return ApiClient - */ - fun registerAccessTokenListener(accessTokenListener: AccessTokenListener): ApiClient { - apiAuthorizations.values.runOnFirst { - registerAccessTokenListener(accessTokenListener) - } - return this; - } - - /** - * Adds an authorization to be used by the client - * @param authName Authentication name - * @param authorization Authorization interceptor - * @return ApiClient - */ - fun addAuthorization(authName: String, authorization: Interceptor): ApiClient { - if (apiAuthorizations.containsKey(authName)) { - throw RuntimeException("auth name $authName already in api authorizations") - } - apiAuthorizations[authName] = authorization - clientBuilder.addInterceptor(authorization) - return this - } - - fun setLogger(logger: (String) -> Unit): ApiClient { - this.logger = logger - return this - } - - fun createService(serviceClass: Class): S { - val usedClient = this.okHttpClient ?: clientBuilder.build() - return retrofitBuilder.client(usedClient).build().create(serviceClass) - } - - private fun normalizeBaseUrl() { - if (!baseUrl.endsWith("/")) { - baseUrl += "/" - } - } - - private inline fun Iterable.runOnFirst(callback: U.() -> Unit) { - for (element in this) { - if (element is U) { - callback.invoke(element) - break - } - } - } - - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt deleted file mode 100644 index 001e99325d..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/CollectionFormats.kt +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.client.infrastructure - -class CollectionFormats { - - open class CSVParams { - - var params: List - - constructor(params: List) { - this.params = params - } - - constructor(vararg params: String) { - this.params = listOf(*params) - } - - override fun toString(): String { - return params.joinToString(",") - } - } - - open class SSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString(" ") - } - } - - class TSVParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("\t") - } - } - - class PIPESParams : CSVParams { - - constructor(params: List) : super(params) - - constructor(vararg params: String) : super(*params) - - override fun toString(): String { - return params.joinToString("|") - } - } - - class SPACEParams : SSVParams() -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt deleted file mode 100644 index 1804d1ae2b..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/ResponseExt.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.JsonDataException -import com.squareup.moshi.Moshi -import retrofit2.Response - -@Throws(JsonDataException::class) -inline fun Response<*>.getErrorResponse(serializerBuilder: Moshi.Builder = Serializer.moshiBuilder): T? { - val serializer = serializerBuilder.build() - val parser = serializer.adapter(T::class.java) - val response = errorBody()?.string() - if(response != null) { - return parser.fromJson(response) - } - return null -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index a66c335904..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6e..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325..0000000000 --- a/samples/client/petstore/kotlin-retrofit2/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 4fbeccdbc0..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param apiKey (optional) - * @param petId Pet id to delete - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(apiKey: kotlin.String?, petId: kotlin.Long) : Unit { - val localVariableConfig = deletePetRequestConfig(apiKey = apiKey, petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param apiKey (optional) - * @param petId Pet id to delete - * @return RequestConfig - */ - fun deletePetRequestConfig(apiKey: kotlin.String?, petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ec768d1ace..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: kotlin.String? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 66667bf07c..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param id - * @param category - * @param name - * @param photoUrls - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a1..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5b..0000000000 --- a/samples/client/petstore/kotlin-string/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200..2abf02f23b 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 135bcdc790..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import org.threeten.bp.LocalDate -import org.threeten.bp.LocalDateTime -import org.threeten.bp.LocalTime -import org.threeten.bp.OffsetDateTime -import org.threeten.bp.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index ff5439aeb4..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.LocalDate -import org.threeten.bp.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index 710a9cc131..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.LocalDateTime -import org.threeten.bp.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 28b3eb3cd7..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import org.threeten.bp.OffsetDateTime -import org.threeten.bp.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index fafca8738f..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index a4c17c3b49..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index 300f94d854..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: org.threeten.bp.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index a3df06cb6e..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 6e619023a5..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,29 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index af1e270325..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,48 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 8ae5de40f5..8467a2ab7d 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -20,7 +20,6 @@ import java.io.File import java.io.FileWriter import java.io.IOException import java.net.URLConnection -import java.util.Date import java.util.Locale import org.threeten.bp.LocalDate import org.threeten.bp.LocalDateTime @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt deleted file mode 100644 index e504c876ce..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/apis/EnumApi.kt +++ /dev/null @@ -1,89 +0,0 @@ -/** -* OpenAPI Petstore -* Test for issue 4062 -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.PetEnum - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class EnumApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Get enums - * - * @return PetEnum - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getEnum() : PetEnum { - val localVariableConfig = getEnumRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as PetEnum - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getEnum - * - * @return RequestConfig - */ - fun getEnumRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/enum", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index c34e9e42d0..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,232 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt b/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt deleted file mode 100644 index a447bf9205..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/bin/main/org/openapitools/client/models/PetEnum.kt +++ /dev/null @@ -1,43 +0,0 @@ -/** -* OpenAPI Petstore -* Test for issue 4062 -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json - -/** -* An enum with complex-ish naming -* Values: MY_FIRST_VALUE,MY_SECOND_VALUE -*/ - -enum class PetEnum(val value: kotlin.String){ - - - @Json(name = "myFirstValue") - MY_FIRST_VALUE("myFirstValue"), - - - @Json(name = "MY_SECOND_VALUE") - MY_SECOND_VALUE("MY_SECOND_VALUE"); - - - - /** - This override toString avoids using the enum var name and uses the actual api value instead. - In cases the var name and value are different, the client would send incorrect enums to the server. - **/ - override fun toString(): String { - return value - } - -} - diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 09194ef927..dc423d8a17 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -229,7 +228,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index c8b93b33bf..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,492 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(body: Pet) : Unit { - val localVariableConfig = addPetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation addPet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun addPetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableConfig = deletePetRequestConfig(petId = petId, apiKey = apiKey) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deletePet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return RequestConfig - */ - fun deletePetRequestConfig(petId: kotlin.Long, apiKey: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - apiKey?.apply { localVariableHeaders["api_key"] = this.toString() } - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByStatusRequestConfig(status = status) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByStatus - * - * @param status Status values that need to be considered for filter - * @return RequestConfig - */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.collections.List - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.collections.List) : kotlin.collections.List { - val localVariableConfig = findPetsByTagsRequestConfig(tags = tags) - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.List - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation findPetsByTags - * - * @param tags Tags to filter by - * @return RequestConfig - */ - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableConfig = getPetByIdRequestConfig(petId = petId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getPetById - * - * @param petId ID of pet to return - * @return RequestConfig - */ - fun getPetByIdRequestConfig(petId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(body: Pet) : Unit { - val localVariableConfig = updatePetRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePet - * - * @param body Pet object that needs to be added to the store - * @return RequestConfig - */ - fun updatePetRequestConfig(body: Pet) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/pet", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableConfig = updatePetWithFormRequestConfig(petId = petId, name = name, status = status) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updatePetWithForm - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return RequestConfig - */ - fun updatePetWithFormRequestConfig(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableConfig = uploadFileRequestConfig(petId = petId, additionalMetadata = additionalMetadata, file = file) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation uploadFile - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return RequestConfig - */ - fun uploadFileRequestConfig(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : RequestConfig { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index 215ed63420..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,253 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableConfig = deleteOrderRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteOrder - * - * @param orderId ID of the order that needs to be deleted - * @return RequestConfig - */ - fun deleteOrderRequestConfig(orderId: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableConfig = getInventoryRequestConfig() - - val localVarResponse = request>( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getInventory - * - * @return RequestConfig - */ - fun getInventoryRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableConfig = getOrderByIdRequestConfig(orderId = orderId) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getOrderById - * - * @param orderId ID of pet that needs to be fetched - * @return RequestConfig - */ - fun getOrderByIdRequestConfig(orderId: kotlin.Long) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(body: Order) : Order { - val localVariableConfig = placeOrderRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation placeOrder - * - * @param body order placed for purchasing the pet - * @return RequestConfig - */ - fun placeOrderRequestConfig(body: Order) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/store/order", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 53748b9346..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,476 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(body: User) : Unit { - val localVariableConfig = createUserRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUser - * - * @param body Created user object - * @return RequestConfig - */ - fun createUserRequestConfig(body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithArrayInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithArrayInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithArrayInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Creates list of users with given input array - * - * @param body List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(body: kotlin.collections.List) : Unit { - val localVariableConfig = createUsersWithListInputRequestConfig(body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation createUsersWithListInput - * - * @param body List of user object - * @return RequestConfig - */ - fun createUsersWithListInputRequestConfig(body: kotlin.collections.List) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.POST, - path = "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableConfig = deleteUserRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation deleteUser - * - * @param username The name that needs to be deleted - * @return RequestConfig - */ - fun deleteUserRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.DELETE, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableConfig = getUserByNameRequestConfig(username = username) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation getUserByName - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return RequestConfig - */ - fun getUserByNameRequestConfig(username: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableConfig = loginUserRequestConfig(username = username, password = password) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation loginUser - * - * @param username The user name for login - * @param password The password for login in clear text - * @return RequestConfig - */ - fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/login", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableConfig = logoutUserRequestConfig() - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation logoutUser - * - * @return RequestConfig - */ - fun logoutUserRequestConfig() : RequestConfig { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.GET, - path = "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param body Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableConfig = updateUserRequestConfig(username = username, body = body) - - val localVarResponse = request( - localVariableConfig - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * To obtain the request config of the operation updateUser - * - * @param username name that need to be deleted - * @param body Updated user object - * @return RequestConfig - */ - fun updateUserRequestConfig(username: kotlin.String, body: User) : RequestConfig { - val localVariableBody: kotlin.Any? = body - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - - val localVariableConfig = RequestConfig( - method = RequestMethod.PUT, - path = "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders, - body = localVariableBody - ) - - return localVariableConfig - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 7a8dcc91cd..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(requestConfig.body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(requestConfig.body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(requestConfig.body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(requestConfig.body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbf..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f1..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db9481..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a3..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 0f2790f370..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,17 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf(), - val body: kotlin.Any? = null -) \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 9bd2790dc1..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -@Suppress("EXTENSION_SHADOWED_BY_MEMBER") -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 9a45b67d9b..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index 7d40c8efbc..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,38 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt deleted file mode 100644 index ceb0fbc8fe..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt deleted file mode 100644 index ed8f8b13a4..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,58 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 105f485f02..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,60 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String, - @Json(name = "photoUrls") - val photoUrls: kotlin.collections.List, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.collections.List? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt deleted file mode 100644 index 944b1cd0a1..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,35 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt deleted file mode 100644 index 9697f07d5b..0000000000 --- a/samples/client/petstore/kotlin/bin/main/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -import java.io.Serializable - -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) : Serializable { - companion object { - private const val serialVersionUID: Long = 123 - } - -} - diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt index 7282e53200..2abf02f23b 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -25,7 +25,6 @@ import java.time.LocalDateTime import java.time.LocalTime import java.time.OffsetDateTime import java.time.OffsetTime -import java.util.Date import java.util.Locale import com.squareup.moshi.adapter @@ -248,7 +247,7 @@ open class ApiClient(val baseUrl: String) { null -> "" is Array<*> -> toMultiValue(value, "csv").toString() is Iterable<*> -> toMultiValue(value, "csv").toString() - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> + is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime -> parseDateToQueryString(value) else -> value.toString() } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2..0000000000 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore b/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore index cabbe3494d..7484ee590a 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator-ignore @@ -1,3 +1,23 @@ # OpenAPI Generator Ignore -pom.xml +# Generated by openapi-generator https://github.com/openapitools/openapi-generator +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt deleted file mode 100644 index 257970fa6b..0000000000 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ /dev/null @@ -1,30 +0,0 @@ -package org.openapitools.model - -import java.util.Objects -import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size -import javax.validation.Valid -import io.swagger.annotations.ApiModelProperty - -/** - * - * @param name Updated name of the pet - * @param status Updated status of the pet - */ -data class InlineObject( - - @ApiModelProperty(example = "null", value = "Updated name of the pet") - @field:JsonProperty("name") val name: kotlin.String? = null, - - @ApiModelProperty(example = "null", value = "Updated status of the pet") - @field:JsonProperty("status") val status: kotlin.String? = null -) { - -} - diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt deleted file mode 100644 index 60e6e76df2..0000000000 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ /dev/null @@ -1,31 +0,0 @@ -package org.openapitools.model - -import java.util.Objects -import com.fasterxml.jackson.annotation.JsonProperty -import javax.validation.constraints.DecimalMax -import javax.validation.constraints.DecimalMin -import javax.validation.constraints.Max -import javax.validation.constraints.Min -import javax.validation.constraints.NotNull -import javax.validation.constraints.Pattern -import javax.validation.constraints.Size -import javax.validation.Valid -import io.swagger.annotations.ApiModelProperty - -/** - * - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ -data class InlineObject1( - - @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @field:JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, - - @field:Valid - @ApiModelProperty(example = "null", value = "file to upload") - @field:JsonProperty("file") val file: org.springframework.core.io.Resource? = null -) { - -} - diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES index 612ea14bbd..50a9d2bc75 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/FILES @@ -5,13 +5,13 @@ settings.gradle src/main/kotlin/org/openapitools/Application.kt src/main/kotlin/org/openapitools/api/ApiUtil.kt src/main/kotlin/org/openapitools/api/Exceptions.kt -src/main/kotlin/org/openapitools/api/PetApi.kt +src/main/kotlin/org/openapitools/api/PetApiController.kt src/main/kotlin/org/openapitools/api/PetApiService.kt src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt -src/main/kotlin/org/openapitools/api/StoreApi.kt +src/main/kotlin/org/openapitools/api/StoreApiController.kt src/main/kotlin/org/openapitools/api/StoreApiService.kt src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt -src/main/kotlin/org/openapitools/api/UserApi.kt +src/main/kotlin/org/openapitools/api/UserApiController.kt src/main/kotlin/org/openapitools/api/UserApiService.kt src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt src/main/kotlin/org/openapitools/model/Category.kt diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index 3fa3b389a5..4077803655 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts index 2b99799bd5..ea7f93398d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts +++ b/samples/server/petstore/kotlin-springboot-modelMutable/build.gradle.kts @@ -30,7 +30,7 @@ plugins { } dependencies { - val kotlinxCoroutinesVersion="1.2.0" + val kotlinxCoroutinesVersion="1.2.0" compile("org.jetbrains.kotlin:kotlin-stdlib-jdk8") compile("org.jetbrains.kotlin:kotlin-reflect") compile("org.springframework.boot:spring-boot-starter-web") @@ -46,7 +46,7 @@ dependencies { } repositories { - maven { url = uri("https://repo1.maven.org/maven2") } - maven { url = uri("https://repo.spring.io/snapshot") } - maven { url = uri("https://repo.spring.io/milestone") } + maven { url = uri("https://repo1.maven.org/maven2") } + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml index 1bfa3bec62..f7094ec0e1 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml +++ b/samples/server/petstore/kotlin-springboot-modelMutable/pom.xml @@ -7,7 +7,7 @@ 1.0.0 1.3.30 - 1.2.0 + 1.2.0 1.3.5 @@ -111,8 +111,8 @@ - javax.validation - validation-api + jakarta.validation + jakarta.validation-api jakarta.annotation @@ -127,34 +127,34 @@ test - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - - - - spring-snapshots - Spring Snapshots - https://repo.spring.io/snapshot - - true - - - - spring-milestones - Spring Milestones - https://repo.spring.io/milestone - - + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle b/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle index e9bd5d32d7..14844905cd 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle +++ b/samples/server/petstore/kotlin-springboot-modelMutable/settings.gradle @@ -1,15 +1,15 @@ pluginManagement { - repositories { - maven { url = uri("https://repo.spring.io/snapshot") } - maven { url = uri("https://repo.spring.io/milestone") } - gradlePluginPortal() - } - resolutionStrategy { - eachPlugin { - if (requested.id.id == "org.springframework.boot") { - useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") - } - } - } + repositories { + maven { url = uri("https://repo.spring.io/snapshot") } + maven { url = uri("https://repo.spring.io/milestone") } + gradlePluginPortal() + } + resolutionStrategy { + eachPlugin { + if (requested.id.id == "org.springframework.boot") { + useModule("org.springframework.boot:spring-boot-gradle-plugin:${requested.version}") + } + } + } } -rootProject.name = "openapi-spring" \ No newline at end of file +rootProject.name = "openapi-spring" diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt similarity index 95% rename from samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt rename to samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt index 9de503175a..a26504324d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiController.kt @@ -43,7 +43,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -59,7 +60,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid pet value")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/pet/{petId}"] ) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long @@ -77,7 +79,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByStatus"], produces = ["application/xml", "application/json"] ) @@ -95,7 +98,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/findByTags"], produces = ["application/xml", "application/json"] ) @@ -112,7 +116,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/pet/{petId}"], produces = ["application/xml", "application/json"] ) @@ -128,7 +133,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/pet"], consumes = ["application/json", "application/xml"] ) @@ -144,7 +150,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 405, message = "Invalid input")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}"], consumes = ["application/x-www-form-urlencoded"] ) @@ -163,7 +170,8 @@ class PetApiController(@Autowired(required = true) val service: PetApiService) { authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/pet/{petId}/uploadImage"], produces = ["application/json"], consumes = ["multipart/form-data"] diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt index f3f2fd68b6..ee0e3bef83 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -2,21 +2,93 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet + interface PetApiService { - fun addPet(body: Pet): Unit + /** + * POST /pet : Add a new pet to the store + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid input (status code 405) + * @see PetApi#addPet + */ + fun addPet(body: Pet): Unit - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit + /** + * DELETE /pet/{petId} : Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return Invalid pet value (status code 400) + * @see PetApi#deletePet + */ + fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: kotlin.collections.List): List + /** + * GET /pet/findByStatus : Finds Pets by status + * Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return successful operation (status code 200) + * or Invalid status value (status code 400) + * @see PetApi#findPetsByStatus + */ + fun findPetsByStatus(status: kotlin.collections.List): List - fun findPetsByTags(tags: kotlin.collections.List): List + /** + * GET /pet/findByTags : Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return successful operation (status code 200) + * or Invalid tag value (status code 400) + * @deprecated + * @see PetApi#findPetsByTags + */ + fun findPetsByTags(tags: kotlin.collections.List): List - fun getPetById(petId: kotlin.Long): Pet + /** + * GET /pet/{petId} : Find pet by ID + * Returns a single pet + * + * @param petId ID of pet to return (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * @see PetApi#getPetById + */ + fun getPetById(petId: kotlin.Long): Pet - fun updatePet(body: Pet): Unit + /** + * PUT /pet : Update an existing pet + * + * @param body Pet object that needs to be added to the store (required) + * @return Invalid ID supplied (status code 400) + * or Pet not found (status code 404) + * or Validation exception (status code 405) + * @see PetApi#updatePet + */ + fun updatePet(body: Pet): Unit - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit + /** + * POST /pet/{petId} : Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return Invalid input (status code 405) + * @see PetApi#updatePetWithForm + */ + fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse + /** + * POST /pet/{petId}/uploadImage : uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param file file to upload (optional) + * @return successful operation (status code 200) + * @see PetApi#uploadFile + */ + fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt similarity index 94% rename from samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt rename to samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt index 3b82141c4d..e2be73b4ec 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiController.kt @@ -41,7 +41,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/store/order/{orderId}"] ) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String @@ -58,7 +59,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic authorizations = [Authorization(value = "api_key")]) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/inventory"], produces = ["application/json"] ) @@ -73,7 +75,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/store/order/{orderId}"], produces = ["application/xml", "application/json"] ) @@ -89,7 +92,8 @@ class StoreApiController(@Autowired(required = true) val service: StoreApiServic response = Order::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/store/order"], produces = ["application/xml", "application/json"] ) diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt index d4a4ef9507..6de3e6cc1d 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -1,13 +1,48 @@ package org.openapitools.api import org.openapitools.model.Order + interface StoreApiService { - fun deleteOrder(orderId: kotlin.String): Unit + /** + * DELETE /store/order/{orderId} : Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#deleteOrder + */ + fun deleteOrder(orderId: kotlin.String): Unit - fun getInventory(): Map + /** + * GET /store/inventory : Returns pet inventories by status + * Returns a map of status codes to quantities + * + * @return successful operation (status code 200) + * @see StoreApi#getInventory + */ + fun getInventory(): Map - fun getOrderById(orderId: kotlin.Long): Order + /** + * GET /store/order/{orderId} : Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return successful operation (status code 200) + * or Invalid ID supplied (status code 400) + * or Order not found (status code 404) + * @see StoreApi#getOrderById + */ + fun getOrderById(orderId: kotlin.Long): Order - fun placeOrder(body: Order): Order + /** + * POST /store/order : Place an order for a pet + * + * @param body order placed for purchasing the pet (required) + * @return successful operation (status code 200) + * or Invalid Order (status code 400) + * @see StoreApi#placeOrder + */ + fun placeOrder(body: Order): Order } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt similarity index 92% rename from samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt rename to samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt index 7071afde11..f7c4144fbd 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiController.kt @@ -41,7 +41,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user"] ) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody body: User @@ -55,7 +56,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithArray"] ) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List @@ -69,7 +71,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @PostMapping( + @RequestMapping( + method = [RequestMethod.POST], value = ["/user/createWithList"] ) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody body: kotlin.collections.List @@ -83,7 +86,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @DeleteMapping( + @RequestMapping( + method = [RequestMethod.DELETE], value = ["/user/{username}"] ) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String @@ -98,7 +102,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = User::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/{username}"], produces = ["application/xml", "application/json"] ) @@ -114,7 +119,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) response = kotlin.String::class) @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/login"], produces = ["application/xml", "application/json"] ) @@ -130,7 +136,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "") @ApiResponses( value = [ApiResponse(code = 200, message = "successful operation")]) - @GetMapping( + @RequestMapping( + method = [RequestMethod.GET], value = ["/user/logout"] ) fun logoutUser(): ResponseEntity { @@ -143,7 +150,8 @@ class UserApiController(@Autowired(required = true) val service: UserApiService) notes = "This can only be done by the logged in user.") @ApiResponses( value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) - @PutMapping( + @RequestMapping( + method = [RequestMethod.PUT], value = ["/user/{username}"] ) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt index 491705c3b5..a1bcf6be23 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -1,21 +1,87 @@ package org.openapitools.api import org.openapitools.model.User + interface UserApiService { - fun createUser(body: User): Unit + /** + * POST /user : Create user + * This can only be done by the logged in user. + * + * @param body Created user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUser + */ + fun createUser(body: User): Unit - fun createUsersWithArrayInput(body: kotlin.collections.List): Unit + /** + * POST /user/createWithArray : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithArrayInput + */ + fun createUsersWithArrayInput(body: kotlin.collections.List): Unit - fun createUsersWithListInput(body: kotlin.collections.List): Unit + /** + * POST /user/createWithList : Creates list of users with given input array + * + * @param body List of user object (required) + * @return successful operation (status code 200) + * @see UserApi#createUsersWithListInput + */ + fun createUsersWithListInput(body: kotlin.collections.List): Unit - fun deleteUser(username: kotlin.String): Unit + /** + * DELETE /user/{username} : Delete user + * This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#deleteUser + */ + fun deleteUser(username: kotlin.String): Unit - fun getUserByName(username: kotlin.String): User + /** + * GET /user/{username} : Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return successful operation (status code 200) + * or Invalid username supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#getUserByName + */ + fun getUserByName(username: kotlin.String): User - fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String + /** + * GET /user/login : Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return successful operation (status code 200) + * or Invalid username/password supplied (status code 400) + * @see UserApi#loginUser + */ + fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String - fun logoutUser(): Unit + /** + * GET /user/logout : Logs out current logged in user session + * + * @return successful operation (status code 200) + * @see UserApi#logoutUser + */ + fun logoutUser(): Unit - fun updateUser(username: kotlin.String, body: User): Unit + /** + * PUT /user/{username} : Updated user + * This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param body Updated user object (required) + * @return Invalid user supplied (status code 400) + * or User not found (status code 404) + * @see UserApi#updateUser + */ + fun updateUser(username: kotlin.String, body: User): Unit } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt index d621c16696..0d3ccd3989 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -3,7 +3,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class PetApiTest { @@ -11,138 +10,121 @@ class PetApiTest { private val service: PetApiService = PetApiServiceImpl() private val api: PetApiController = PetApiController(service) - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.addPet + * + * @throws ApiException + * if the Api call fails + */ @Test fun addPetTest() { - val body:Pet? = null - val response: ResponseEntity = api.addPet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.addPet(body) // TODO: test validations } - + /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.deletePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun deletePetTest() { - val petId:kotlin.Long? = null - val apiKey:kotlin.String? = null - val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + val petId:kotlin.Long = TODO() + val apiKey:kotlin.String? = TODO() + val response: ResponseEntity = api.deletePet(petId, apiKey) // TODO: test validations } - + /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByStatus + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByStatusTest() { - val status:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByStatus(status!!) + val status:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByStatus(status) // TODO: test validations } - + /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByTags + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByTagsTest() { - val tags:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByTags(tags!!) + val tags:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByTags(tags) // TODO: test validations } - + /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.getPetById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getPetByIdTest() { - val petId:kotlin.Long? = null - val response: ResponseEntity = api.getPetById(petId!!) + val petId:kotlin.Long = TODO() + val response: ResponseEntity = api.getPetById(petId) // TODO: test validations } - + /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetTest() { - val body:Pet? = null - val response: ResponseEntity = api.updatePet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.updatePet(body) // TODO: test validations } - + /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePetWithForm + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetWithFormTest() { - val petId:kotlin.Long? = null - val name:kotlin.String? = null - val status:kotlin.String? = null - val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + val petId:kotlin.Long = TODO() + val name:kotlin.String? = TODO() + val status:kotlin.String? = TODO() + val response: ResponseEntity = api.updatePetWithForm(petId, name, status) // TODO: test validations } - + /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.uploadFile + * + * @throws ApiException + * if the Api call fails + */ @Test fun uploadFileTest() { - val petId:kotlin.Long? = null - val additionalMetadata:kotlin.String? = null - val file:org.springframework.core.io.Resource? = null - val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + val petId:kotlin.Long = TODO() + val additionalMetadata:kotlin.String? = TODO() + val file:org.springframework.core.io.Resource? = TODO() + val response: ResponseEntity = api.uploadFile(petId, additionalMetadata, file) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt index 82b91cd652..fcb00e99e9 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.Order import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class StoreApiTest { @@ -10,68 +9,59 @@ class StoreApiTest { private val service: StoreApiService = StoreApiServiceImpl() private val api: StoreApiController = StoreApiController(service) - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.deleteOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteOrderTest() { - val orderId:kotlin.String? = null - val response: ResponseEntity = api.deleteOrder(orderId!!) + val orderId:kotlin.String = TODO() + val response: ResponseEntity = api.deleteOrder(orderId) // TODO: test validations } - + /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getInventory + * + * @throws ApiException + * if the Api call fails + */ @Test fun getInventoryTest() { val response: ResponseEntity> = api.getInventory() // TODO: test validations } - + /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getOrderById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getOrderByIdTest() { - val orderId:kotlin.Long? = null - val response: ResponseEntity = api.getOrderById(orderId!!) + val orderId:kotlin.Long = TODO() + val response: ResponseEntity = api.getOrderById(orderId) // TODO: test validations } - + /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.placeOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun placeOrderTest() { - val body:Order? = null - val response: ResponseEntity = api.placeOrder(body!!) + val body:Order = TODO() + val response: ResponseEntity = api.placeOrder(body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt index 14917f70ae..c3f07290cf 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-modelMutable/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.User import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class UserApiTest { @@ -10,134 +9,117 @@ class UserApiTest { private val service: UserApiService = UserApiServiceImpl() private val api: UserApiController = UserApiController(service) - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUserTest() { - val body:User? = null - val response: ResponseEntity = api.createUser(body!!) + val body:User = TODO() + val response: ResponseEntity = api.createUser(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithArrayInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithArrayInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithArrayInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithArrayInput(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithListInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithListInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithListInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithListInput(body) // TODO: test validations } - + /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.deleteUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteUserTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.deleteUser(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.deleteUser(username) // TODO: test validations } - + /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.getUserByName + * + * @throws ApiException + * if the Api call fails + */ @Test fun getUserByNameTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.getUserByName(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.getUserByName(username) // TODO: test validations } - + /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.loginUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun loginUserTest() { - val username:kotlin.String? = null - val password:kotlin.String? = null - val response: ResponseEntity = api.loginUser(username!!, password!!) + val username:kotlin.String = TODO() + val password:kotlin.String = TODO() + val response: ResponseEntity = api.loginUser(username, password) // TODO: test validations } - + /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.logoutUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun logoutUserTest() { val response: ResponseEntity = api.logoutUser() // TODO: test validations } - + /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.updateUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun updateUserTest() { - val username:kotlin.String? = null - val body:User? = null - val response: ResponseEntity = api.updateUser(username!!, body!!) + val username:kotlin.String = TODO() + val body:User = TODO() + val response: ResponseEntity = api.updateUser(username, body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt index f43c6ecf7c..bbc9b118e2 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -3,7 +3,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet import org.junit.jupiter.api.Test - import kotlinx.coroutines.flow.Flow; import kotlinx.coroutines.test.runBlockingTest import org.springframework.http.ResponseEntity @@ -13,138 +12,121 @@ class PetApiTest { private val service: PetApiService = PetApiServiceImpl() private val api: PetApiController = PetApiController(service) - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.addPet + * + * @throws ApiException + * if the Api call fails + */ @Test fun addPetTest() = runBlockingTest { - val body:Pet? = null - val response: ResponseEntity = api.addPet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.addPet(body) // TODO: test validations } - + /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.deletePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun deletePetTest() = runBlockingTest { - val petId:kotlin.Long? = null - val apiKey:kotlin.String? = null - val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + val petId:kotlin.Long = TODO() + val apiKey:kotlin.String? = TODO() + val response: ResponseEntity = api.deletePet(petId, apiKey) // TODO: test validations } - + /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByStatus + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByStatusTest() = runBlockingTest { - val status:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByStatus(status!!) + val status:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByStatus(status) // TODO: test validations } - + /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByTags + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByTagsTest() = runBlockingTest { - val tags:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByTags(tags!!) + val tags:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByTags(tags) // TODO: test validations } - + /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.getPetById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getPetByIdTest() = runBlockingTest { - val petId:kotlin.Long? = null - val response: ResponseEntity = api.getPetById(petId!!) + val petId:kotlin.Long = TODO() + val response: ResponseEntity = api.getPetById(petId) // TODO: test validations } - + /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetTest() = runBlockingTest { - val body:Pet? = null - val response: ResponseEntity = api.updatePet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.updatePet(body) // TODO: test validations } - + /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePetWithForm + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetWithFormTest() = runBlockingTest { - val petId:kotlin.Long? = null - val name:kotlin.String? = null - val status:kotlin.String? = null - val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + val petId:kotlin.Long = TODO() + val name:kotlin.String? = TODO() + val status:kotlin.String? = TODO() + val response: ResponseEntity = api.updatePetWithForm(petId, name, status) // TODO: test validations } - + /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.uploadFile + * + * @throws ApiException + * if the Api call fails + */ @Test fun uploadFileTest() = runBlockingTest { - val petId:kotlin.Long? = null - val additionalMetadata:kotlin.String? = null - val file:org.springframework.core.io.Resource? = null - val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + val petId:kotlin.Long = TODO() + val additionalMetadata:kotlin.String? = TODO() + val file:org.springframework.core.io.Resource? = TODO() + val response: ResponseEntity = api.uploadFile(petId, additionalMetadata, file) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt index 31c0a2e071..1db01446d8 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.Order import org.junit.jupiter.api.Test - import kotlinx.coroutines.flow.Flow; import kotlinx.coroutines.test.runBlockingTest import org.springframework.http.ResponseEntity @@ -12,68 +11,59 @@ class StoreApiTest { private val service: StoreApiService = StoreApiServiceImpl() private val api: StoreApiController = StoreApiController(service) - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.deleteOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteOrderTest() = runBlockingTest { - val orderId:kotlin.String? = null - val response: ResponseEntity = api.deleteOrder(orderId!!) + val orderId:kotlin.String = TODO() + val response: ResponseEntity = api.deleteOrder(orderId) // TODO: test validations } - + /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getInventory + * + * @throws ApiException + * if the Api call fails + */ @Test fun getInventoryTest() = runBlockingTest { val response: ResponseEntity> = api.getInventory() // TODO: test validations } - + /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getOrderById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getOrderByIdTest() = runBlockingTest { - val orderId:kotlin.Long? = null - val response: ResponseEntity = api.getOrderById(orderId!!) + val orderId:kotlin.Long = TODO() + val response: ResponseEntity = api.getOrderById(orderId) // TODO: test validations } - + /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.placeOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun placeOrderTest() = runBlockingTest { - val body:Order? = null - val response: ResponseEntity = api.placeOrder(body!!) + val body:Order = TODO() + val response: ResponseEntity = api.placeOrder(body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt index 3d467deb14..126e0700f7 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt +++ b/samples/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.User import org.junit.jupiter.api.Test - import kotlinx.coroutines.flow.Flow; import kotlinx.coroutines.test.runBlockingTest import org.springframework.http.ResponseEntity @@ -12,134 +11,117 @@ class UserApiTest { private val service: UserApiService = UserApiServiceImpl() private val api: UserApiController = UserApiController(service) - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUserTest() = runBlockingTest { - val body:User? = null - val response: ResponseEntity = api.createUser(body!!) + val body:User = TODO() + val response: ResponseEntity = api.createUser(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithArrayInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithArrayInputTest() = runBlockingTest { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithArrayInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithArrayInput(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithListInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithListInputTest() = runBlockingTest { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithListInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithListInput(body) // TODO: test validations } - + /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.deleteUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteUserTest() = runBlockingTest { - val username:kotlin.String? = null - val response: ResponseEntity = api.deleteUser(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.deleteUser(username) // TODO: test validations } - + /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.getUserByName + * + * @throws ApiException + * if the Api call fails + */ @Test fun getUserByNameTest() = runBlockingTest { - val username:kotlin.String? = null - val response: ResponseEntity = api.getUserByName(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.getUserByName(username) // TODO: test validations } - + /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.loginUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun loginUserTest() = runBlockingTest { - val username:kotlin.String? = null - val password:kotlin.String? = null - val response: ResponseEntity = api.loginUser(username!!, password!!) + val username:kotlin.String = TODO() + val password:kotlin.String = TODO() + val response: ResponseEntity = api.loginUser(username, password) // TODO: test validations } - + /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.logoutUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun logoutUserTest() = runBlockingTest { val response: ResponseEntity = api.logoutUser() // TODO: test validations } - + /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.updateUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun updateUserTest() = runBlockingTest { - val username:kotlin.String? = null - val body:User? = null - val response: ResponseEntity = api.updateUser(username!!, body!!) + val username:kotlin.String = TODO() + val body:User = TODO() + val response: ResponseEntity = api.updateUser(username, body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt index d621c16696..0d3ccd3989 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -3,7 +3,6 @@ package org.openapitools.api import org.openapitools.model.ModelApiResponse import org.openapitools.model.Pet import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class PetApiTest { @@ -11,138 +10,121 @@ class PetApiTest { private val service: PetApiService = PetApiServiceImpl() private val api: PetApiController = PetApiController(service) - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.addPet + * + * @throws ApiException + * if the Api call fails + */ @Test fun addPetTest() { - val body:Pet? = null - val response: ResponseEntity = api.addPet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.addPet(body) // TODO: test validations } - + /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.deletePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun deletePetTest() { - val petId:kotlin.Long? = null - val apiKey:kotlin.String? = null - val response: ResponseEntity = api.deletePet(petId!!, apiKey!!) + val petId:kotlin.Long = TODO() + val apiKey:kotlin.String? = TODO() + val response: ResponseEntity = api.deletePet(petId, apiKey) // TODO: test validations } - + /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByStatus + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByStatusTest() { - val status:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByStatus(status!!) + val status:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByStatus(status) // TODO: test validations } - + /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.findPetsByTags + * + * @throws ApiException + * if the Api call fails + */ @Test fun findPetsByTagsTest() { - val tags:kotlin.collections.List? = null - val response: ResponseEntity> = api.findPetsByTags(tags!!) + val tags:kotlin.collections.List = TODO() + val response: ResponseEntity> = api.findPetsByTags(tags) // TODO: test validations } - + /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.getPetById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getPetByIdTest() { - val petId:kotlin.Long? = null - val response: ResponseEntity = api.getPetById(petId!!) + val petId:kotlin.Long = TODO() + val response: ResponseEntity = api.getPetById(petId) // TODO: test validations } - + /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePet + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetTest() { - val body:Pet? = null - val response: ResponseEntity = api.updatePet(body!!) + val body:Pet = TODO() + val response: ResponseEntity = api.updatePet(body) // TODO: test validations } - + /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.updatePetWithForm + * + * @throws ApiException + * if the Api call fails + */ @Test fun updatePetWithFormTest() { - val petId:kotlin.Long? = null - val name:kotlin.String? = null - val status:kotlin.String? = null - val response: ResponseEntity = api.updatePetWithForm(petId!!, name!!, status!!) + val petId:kotlin.Long = TODO() + val name:kotlin.String? = TODO() + val status:kotlin.String? = TODO() + val response: ResponseEntity = api.updatePetWithForm(petId, name, status) // TODO: test validations } - + /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test PetApiController.uploadFile + * + * @throws ApiException + * if the Api call fails + */ @Test fun uploadFileTest() { - val petId:kotlin.Long? = null - val additionalMetadata:kotlin.String? = null - val file:org.springframework.core.io.Resource? = null - val response: ResponseEntity = api.uploadFile(petId!!, additionalMetadata!!, file!!) + val petId:kotlin.Long = TODO() + val additionalMetadata:kotlin.String? = TODO() + val file:org.springframework.core.io.Resource? = TODO() + val response: ResponseEntity = api.uploadFile(petId, additionalMetadata, file) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt index 82b91cd652..fcb00e99e9 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.Order import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class StoreApiTest { @@ -10,68 +9,59 @@ class StoreApiTest { private val service: StoreApiService = StoreApiServiceImpl() private val api: StoreApiController = StoreApiController(service) - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.deleteOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteOrderTest() { - val orderId:kotlin.String? = null - val response: ResponseEntity = api.deleteOrder(orderId!!) + val orderId:kotlin.String = TODO() + val response: ResponseEntity = api.deleteOrder(orderId) // TODO: test validations } - + /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getInventory + * + * @throws ApiException + * if the Api call fails + */ @Test fun getInventoryTest() { val response: ResponseEntity> = api.getInventory() // TODO: test validations } - + /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.getOrderById + * + * @throws ApiException + * if the Api call fails + */ @Test fun getOrderByIdTest() { - val orderId:kotlin.Long? = null - val response: ResponseEntity = api.getOrderById(orderId!!) + val orderId:kotlin.Long = TODO() + val response: ResponseEntity = api.getOrderById(orderId) // TODO: test validations } - + /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test StoreApiController.placeOrder + * + * @throws ApiException + * if the Api call fails + */ @Test fun placeOrderTest() { - val body:Order? = null - val response: ResponseEntity = api.placeOrder(body!!) + val body:Order = TODO() + val response: ResponseEntity = api.placeOrder(body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt index 14917f70ae..c3f07290cf 100644 --- a/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt +++ b/samples/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -2,7 +2,6 @@ package org.openapitools.api import org.openapitools.model.User import org.junit.jupiter.api.Test - import org.springframework.http.ResponseEntity class UserApiTest { @@ -10,134 +9,117 @@ class UserApiTest { private val service: UserApiService = UserApiServiceImpl() private val api: UserApiController = UserApiController(service) - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUserTest() { - val body:User? = null - val response: ResponseEntity = api.createUser(body!!) + val body:User = TODO() + val response: ResponseEntity = api.createUser(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithArrayInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithArrayInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithArrayInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithArrayInput(body) // TODO: test validations } - + /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.createUsersWithListInput + * + * @throws ApiException + * if the Api call fails + */ @Test fun createUsersWithListInputTest() { - val body:kotlin.collections.List? = null - val response: ResponseEntity = api.createUsersWithListInput(body!!) + val body:kotlin.collections.List = TODO() + val response: ResponseEntity = api.createUsersWithListInput(body) // TODO: test validations } - + /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.deleteUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun deleteUserTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.deleteUser(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.deleteUser(username) // TODO: test validations } - + /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.getUserByName + * + * @throws ApiException + * if the Api call fails + */ @Test fun getUserByNameTest() { - val username:kotlin.String? = null - val response: ResponseEntity = api.getUserByName(username!!) + val username:kotlin.String = TODO() + val response: ResponseEntity = api.getUserByName(username) // TODO: test validations } - + /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.loginUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun loginUserTest() { - val username:kotlin.String? = null - val password:kotlin.String? = null - val response: ResponseEntity = api.loginUser(username!!, password!!) + val username:kotlin.String = TODO() + val password:kotlin.String = TODO() + val response: ResponseEntity = api.loginUser(username, password) // TODO: test validations } - + /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.logoutUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun logoutUserTest() { val response: ResponseEntity = api.logoutUser() // TODO: test validations } - + /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ + * To test UserApiController.updateUser + * + * @throws ApiException + * if the Api call fails + */ @Test fun updateUserTest() { - val username:kotlin.String? = null - val body:User? = null - val response: ResponseEntity = api.updateUser(username!!, body!!) + val username:kotlin.String = TODO() + val body:User = TODO() + val response: ResponseEntity = api.updateUser(username, body) // TODO: test validations } - + } diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index 3fa3b389a5..4077803655 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.0.1-SNAPSHOT \ No newline at end of file +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/pom.xml b/samples/server/petstore/kotlin/vertx/pom.xml index 9d15163697..f7dce917e4 100644 --- a/samples/server/petstore/kotlin/vertx/pom.xml +++ b/samples/server/petstore/kotlin/vertx/pom.xml @@ -1,14 +1,14 @@ 4.0.0 - + org.openapitools openapi-kotlin-vertx-server 1.0.0-SNAPSHOT jar - + OpenAPI Petstore - + UTF-8 1.8 diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt index f3dfdd42e3..a25f7e74bc 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/Order.kt @@ -34,7 +34,7 @@ data class Order ( var shipDate: java.time.OffsetDateTime? = null, /* Order Status */ var status: Order.Status? = null, - var complete: kotlin.Boolean? = null + var complete: kotlin.Boolean? = false ) { /** From 8fbd11073a57e08e3413f59a292e2bcaaa7511a9 Mon Sep 17 00:00:00 2001 From: basyskom-dege <72982549+basyskom-dege@users.noreply.github.com> Date: Tue, 14 Dec 2021 11:23:18 +0100 Subject: [PATCH 17/54] [QT][C++]fixed integration test for Oauth (#10921) * fixed missing package, fixed namespace issues * using older function to check if token is valid * using time.h to check if token is valid --- .../resources/cpp-qt-client/CMakeLists.txt.mustache | 7 ++++--- .../main/resources/cpp-qt-client/oauth.cpp.mustache | 9 ++++++--- .../src/main/resources/cpp-qt-client/oauth.h.mustache | 11 +++++------ samples/client/petstore/cpp-qt/CMakeLists.txt | 3 ++- samples/client/petstore/cpp-qt/client/CMakeLists.txt | 5 +++-- samples/client/petstore/cpp-qt/client/PFXOauth.cpp | 5 ++--- samples/client/petstore/cpp-qt/client/PFXOauth.h | 11 +++++------ 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache index b78e15fb97..86b1d5affe 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/CMakeLists.txt.mustache @@ -12,7 +12,8 @@ else () endif () find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED){{#contentCompression}} +find_package(Qt5Network REQUIRED){{#authMethods}}{{#isOAuth}} +find_package(Qt5Gui REQUIRED){{/isOAuth}}{{/authMethods}}{{#contentCompression}} find_package(ZLIB REQUIRED){{/contentCompression}} add_library(${PROJECT_NAME} @@ -31,9 +32,9 @@ add_library(${PROJECT_NAME} {{prefix}}Helpers.cpp {{prefix}}HttpRequest.cpp {{prefix}}HttpFileElement.cpp + {{prefix}}Oauth.cpp ) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network {{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}}) - +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network{{#authMethods}}{{#isOAuth}} Qt5::Gui{{/isOAuth}}{{/authMethods}}{{#contentCompression}} ${ZLIB_LIBRARIES}{{/contentCompression}}) if(NOT APPLE) target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto) endif() diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache index ebe5365485..7d4ec2b44f 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.cpp.mustache @@ -1,6 +1,8 @@ #include "{{prefix}}Oauth.h" -namespace OpenAPI { +{{#cppNamespaceDeclarations}} +namespace {{this}} { +{{/cppNamespaceDeclarations}} /* * Base class to perform oauth2 flows @@ -343,5 +345,6 @@ void ReplyServer::read() emit dataReceived(queryParams); } - -} \ No newline at end of file +{{#cppNamespaceDeclarations}} +} // namespace {{this}} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache index 03aa0dde90..91aae71a1b 100644 --- a/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache +++ b/modules/openapi-generator/src/main/resources/cpp-qt-client/oauth.h.mustache @@ -21,8 +21,7 @@ #include #include #include - - +#include {{#cppNamespaceDeclarations}} namespace {{this}} { @@ -32,19 +31,19 @@ class oauthToken { public: oauthToken(QString token, int expiresIn, QString scope, QString tokenType) : m_token(token), m_scope(scope), m_type(tokenType){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() + expiresIn); + m_validUntil = time(0) + expiresIn; } oauthToken(){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() -1); + m_validUntil = time(0) - 1; } QString getToken(){return m_token;}; QString getScope(){return m_scope;}; QString getType(){return m_type;}; - bool isValid(){return QDateTime::currentDateTime() < m_validUntil;}; + bool isValid(){return time(0) < m_validUntil;}; private: QString m_token; - QDateTime m_validUntil; + time_t m_validUntil; QString m_scope; QString m_type; }; diff --git a/samples/client/petstore/cpp-qt/CMakeLists.txt b/samples/client/petstore/cpp-qt/CMakeLists.txt index 5d408c92e7..6938aca899 100644 --- a/samples/client/petstore/cpp-qt/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt/CMakeLists.txt @@ -10,6 +10,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") find_package(Qt5Core REQUIRED) find_package(Qt5Network REQUIRED) find_package(Qt5Test REQUIRED) +find_package(Qt5Gui REQUIRED) include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/client @@ -23,7 +24,7 @@ add_executable(${PROJECT_NAME} PetStore/UserApiTests.cpp ) target_link_libraries(${PROJECT_NAME} PRIVATE client) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Test) +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Test Qt5::Gui) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF) diff --git a/samples/client/petstore/cpp-qt/client/CMakeLists.txt b/samples/client/petstore/cpp-qt/client/CMakeLists.txt index 414d1c0863..29b96a13aa 100644 --- a/samples/client/petstore/cpp-qt/client/CMakeLists.txt +++ b/samples/client/petstore/cpp-qt/client/CMakeLists.txt @@ -13,6 +13,7 @@ endif () find_package(Qt5Core REQUIRED) find_package(Qt5Network REQUIRED) +find_package(Qt5Gui REQUIRED) add_library(${PROJECT_NAME} PFXApiResponse.cpp @@ -27,9 +28,9 @@ add_library(${PROJECT_NAME} PFXHelpers.cpp PFXHttpRequest.cpp PFXHttpFileElement.cpp + PFXOauth.cpp ) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network ) - +target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Gui) if(NOT APPLE) target_link_libraries(${PROJECT_NAME} PRIVATE ssl crypto) endif() diff --git a/samples/client/petstore/cpp-qt/client/PFXOauth.cpp b/samples/client/petstore/cpp-qt/client/PFXOauth.cpp index a5cc0da260..f5617124bb 100644 --- a/samples/client/petstore/cpp-qt/client/PFXOauth.cpp +++ b/samples/client/petstore/cpp-qt/client/PFXOauth.cpp @@ -1,6 +1,6 @@ #include "PFXOauth.h" -namespace OpenAPI { +namespace test_namespace { /* * Base class to perform oauth2 flows @@ -343,5 +343,4 @@ void ReplyServer::read() emit dataReceived(queryParams); } - -} \ No newline at end of file +} // namespace test_namespace diff --git a/samples/client/petstore/cpp-qt/client/PFXOauth.h b/samples/client/petstore/cpp-qt/client/PFXOauth.h index f86a29e944..df282d47ce 100644 --- a/samples/client/petstore/cpp-qt/client/PFXOauth.h +++ b/samples/client/petstore/cpp-qt/client/PFXOauth.h @@ -31,8 +31,7 @@ #include #include #include - - +#include namespace test_namespace { @@ -40,19 +39,19 @@ class oauthToken { public: oauthToken(QString token, int expiresIn, QString scope, QString tokenType) : m_token(token), m_scope(scope), m_type(tokenType){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() + expiresIn); + m_validUntil = time(0) + expiresIn; } oauthToken(){ - m_validUntil = QDateTime::fromSecsSinceEpoch(QDateTime::currentSecsSinceEpoch() -1); + m_validUntil = time(0) - 1; } QString getToken(){return m_token;}; QString getScope(){return m_scope;}; QString getType(){return m_type;}; - bool isValid(){return QDateTime::currentDateTime() < m_validUntil;}; + bool isValid(){return time(0) < m_validUntil;}; private: QString m_token; - QDateTime m_validUntil; + time_t m_validUntil; QString m_scope; QString m_type; }; From 8ef49bbaa2363e24573b25ecdfa1a70022d95d8e Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 14 Dec 2021 18:24:21 +0800 Subject: [PATCH 18/54] re-enable cpp-qt test in travis ci --- pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pom.xml b/pom.xml index d55abd2e50..999440c675 100644 --- a/pom.xml +++ b/pom.xml @@ -1148,9 +1148,7 @@ - samples/client/petstore/rust samples/client/petstore/rust/reqwest/petstore samples/client/petstore/rust/reqwest/petstore-async From e5d58a35a2ff1adc0e1667b162627ac428ba782f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 14 Dec 2021 18:32:37 +0800 Subject: [PATCH 19/54] update dependencies to newer versions (java) (#11116) --- .../src/main/resources/Java/build.gradle.mustache | 6 +++--- .../libraries/google-api-client/build.gradle.mustache | 8 ++++---- .../Java/libraries/google-api-client/pom.mustache | 6 +++--- .../Java/libraries/resteasy/build.gradle.mustache | 4 ++-- .../main/resources/Java/libraries/resteasy/pom.mustache | 6 ++++-- .../Java/libraries/retrofit2/build.gradle.mustache | 2 +- .../main/resources/Java/libraries/retrofit2/pom.mustache | 8 ++++---- .../Java/libraries/webclient/build.gradle.mustache | 8 ++++---- .../main/resources/Java/libraries/webclient/pom.mustache | 6 +++--- .../src/main/resources/Java/pom.mustache | 4 ++-- .../client/petstore/java/google-api-client/build.gradle | 8 ++++---- samples/client/petstore/java/google-api-client/pom.xml | 6 +++--- samples/client/petstore/java/jersey1/build.gradle | 6 +++--- samples/client/petstore/java/jersey1/pom.xml | 4 ++-- samples/client/petstore/java/resteasy/build.gradle | 4 ++-- samples/client/petstore/java/resteasy/pom.xml | 4 ++-- .../client/petstore/java/retrofit2-play26/build.gradle | 2 +- samples/client/petstore/java/retrofit2-play26/pom.xml | 6 +++--- samples/client/petstore/java/retrofit2/pom.xml | 2 +- samples/client/petstore/java/retrofit2rx2/pom.xml | 2 +- samples/client/petstore/java/retrofit2rx3/pom.xml | 4 ++-- .../petstore/java/webclient-nulable-arrays/build.gradle | 8 ++++---- .../client/petstore/java/webclient-nulable-arrays/pom.xml | 6 +++--- samples/client/petstore/java/webclient/build.gradle | 8 ++++---- samples/client/petstore/java/webclient/pom.xml | 6 +++--- 25 files changed, 68 insertions(+), 66 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 2a8fa65cc5..d9718c1e5f 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -125,11 +125,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index b705c38ff8..6341f02717 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -109,14 +109,14 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" - google_api_client_version = "1.23.0" + google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" junit_version = "4.13.1" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache index bcd5b7d3bf..81e0ee4652 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -315,12 +315,12 @@ UTF-8 1.5.22 - 1.30.2 + 1.32.2 2.25.1 2.12.1 - 2.10.4 + 2.10.5.1 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index d43c2b7874..0a801b9ff8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -97,11 +97,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" + swagger_annotations_version = "1.6.3" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache index 4f7c83977d..cf39a160cf 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -272,11 +272,13 @@ UTF-8 - 1.5.22 + 1.6.3 4.5.11.Final 2.10.5 2.10.5.1 - 0.2.1 + {{#openApiNullable}} + 0.2.2 + {{/openApiNullable}} 1.3.5 2.9.10 1.0.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index bb1ca7c917..35a63779f6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -115,7 +115,7 @@ ext { jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#play24}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache index 66609e17c2..39da1fd02e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -407,7 +407,7 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 {{#usePlayWS}} 2.12.1 {{#play24}} @@ -420,7 +420,7 @@ 2.6.7 {{/play26}} {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{/usePlayWS}} 2.5.0 @@ -431,7 +431,7 @@ 2.1.1 {{/useRxJava2}} {{#useRxJava3}} - 3.0.4 + 3.0.4 {{/useRxJava3}} {{#joda}} 2.9.9 @@ -441,7 +441,7 @@ {{/threetenbp}} 1.3.5 {{#useBeanValidation}} - 2.0.2 + 2.0.2 {{/useBeanValidation}} 1.0.1 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache index 08917cfd90..8481b945bc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/build.gradle.mustache @@ -124,12 +124,12 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.2" + swagger_annotations_version = "1.6.3" spring_web_version = "2.4.3" - jackson_version = "2.11.3" - jackson_databind_version = "2.11.3" + jackson_version = "2.11.4" + jackson_databind_version = "2.11.4" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache index 3e8e1d6da3..b5e01dff5e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/webclient/pom.mustache @@ -148,12 +148,12 @@ UTF-8 - 1.6.2 + 1.6.3 2.4.3 2.11.3 - 2.11.3 + 2.11.4 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} 1.3.5 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index ccb784c095..5705ea7df6 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -360,9 +360,9 @@ UTF-8 - 1.5.21 + 1.6.3 1.19.4 - 2.12.1 + 2.12.5 {{#threetenbp}} 2.9.10 {{/threetenbp}} diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index 6b3f54f816..d4334f128b 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -97,12 +97,12 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" - google_api_client_version = "1.23.0" + google_api_client_version = "1.32.2" jersey_common_version = "2.25.1" jodatime_version = "2.9.9" junit_version = "4.13.1" diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index 7614163bc4..b301645000 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -266,11 +266,11 @@ UTF-8 1.5.22 - 1.30.2 + 1.32.2 2.25.1 2.12.1 - 2.10.4 - 0.2.1 + 2.10.5.1 + 0.2.2 2.9.10 1.3.5 1.0.0 diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index fdcf9b78ae..36ce7cd1fd 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -113,10 +113,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" - jackson_version = "2.12.1" + swagger_annotations_version = "1.6.3" + jackson_version = "2.12.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jackson_threetenbp_version = "2.9.10" jersey_version = "1.19.4" diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 04222d5791..76365cd391 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -288,9 +288,9 @@ UTF-8 - 1.5.21 + 1.6.3 1.19.4 - 2.12.1 + 2.12.5 2.9.10 1.3.5 1.0.0 diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index c794b8613b..0515f918a1 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -97,10 +97,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.22" + swagger_annotations_version = "1.6.3" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" threetenbp_version = "2.9.10" resteasy_version = "4.5.11.Final" diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index 6fbca0739e..6e8a8cd96f 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -253,11 +253,11 @@ UTF-8 - 1.5.22 + 1.6.3 4.5.11.Final 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/retrofit2-play26/build.gradle b/samples/client/petstore/java/retrofit2-play26/build.gradle index a34a427184..0ea8f2fe7a 100644 --- a/samples/client/petstore/java/retrofit2-play26/build.gradle +++ b/samples/client/petstore/java/retrofit2-play26/build.gradle @@ -101,7 +101,7 @@ ext { retrofit_version = "2.3.0" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" play_version = "2.6.7" swagger_annotations_version = "1.5.22" diff --git a/samples/client/petstore/java/retrofit2-play26/pom.xml b/samples/client/petstore/java/retrofit2-play26/pom.xml index baf6f9835f..b6c323b641 100644 --- a/samples/client/petstore/java/retrofit2-play26/pom.xml +++ b/samples/client/petstore/java/retrofit2-play26/pom.xml @@ -307,14 +307,14 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.12.1 2.6.7 - 0.2.1 + 0.2.2 2.5.0 1.4.0 1.3.5 - 2.0.2 + 2.0.2 1.0.1 4.13.1 diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index e184e4db6c..aa4e1008af 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -266,7 +266,7 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.5.0 1.4.0 1.3.5 diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index c841514837..ef8ef477ff 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -276,7 +276,7 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.5.0 2.1.1 1.4.0 diff --git a/samples/client/petstore/java/retrofit2rx3/pom.xml b/samples/client/petstore/java/retrofit2rx3/pom.xml index adb7eb9927..2eefb13988 100644 --- a/samples/client/petstore/java/retrofit2rx3/pom.xml +++ b/samples/client/petstore/java/retrofit2rx3/pom.xml @@ -276,9 +276,9 @@ ${java.version} ${java.version} 1.8.3 - 1.5.22 + 1.6.3 2.5.0 - 3.0.4 + 3.0.4 1.4.0 1.3.5 1.0.1 diff --git a/samples/client/petstore/java/webclient-nulable-arrays/build.gradle b/samples/client/petstore/java/webclient-nulable-arrays/build.gradle index 6cbf60d744..1c32235d40 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/build.gradle +++ b/samples/client/petstore/java/webclient-nulable-arrays/build.gradle @@ -112,11 +112,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.2" + swagger_annotations_version = "1.6.3" spring_web_version = "2.4.3" - jackson_version = "2.11.3" - jackson_databind_version = "2.11.3" - jackson_databind_nullable_version = "0.2.1" + jackson_version = "2.11.4" + jackson_databind_version = "2.11.4" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "0.7.15.RELEASE" diff --git a/samples/client/petstore/java/webclient-nulable-arrays/pom.xml b/samples/client/petstore/java/webclient-nulable-arrays/pom.xml index 6a4e433806..45b15e6002 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/pom.xml +++ b/samples/client/petstore/java/webclient-nulable-arrays/pom.xml @@ -125,11 +125,11 @@ UTF-8 - 1.6.2 + 1.6.3 2.4.3 2.11.3 - 2.11.3 - 0.2.1 + 2.11.4 + 0.2.2 1.3.5 4.13.1 3.4.3 diff --git a/samples/client/petstore/java/webclient/build.gradle b/samples/client/petstore/java/webclient/build.gradle index 4d1f7d9b7f..6b7058e6a9 100644 --- a/samples/client/petstore/java/webclient/build.gradle +++ b/samples/client/petstore/java/webclient/build.gradle @@ -112,11 +112,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.6.2" + swagger_annotations_version = "1.6.3" spring_web_version = "2.4.3" - jackson_version = "2.11.3" - jackson_databind_version = "2.11.3" - jackson_databind_nullable_version = "0.2.1" + jackson_version = "2.11.4" + jackson_databind_version = "2.11.4" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" reactor_version = "3.4.3" reactor_netty_version = "0.7.15.RELEASE" diff --git a/samples/client/petstore/java/webclient/pom.xml b/samples/client/petstore/java/webclient/pom.xml index fa73267d00..ff3255b237 100644 --- a/samples/client/petstore/java/webclient/pom.xml +++ b/samples/client/petstore/java/webclient/pom.xml @@ -125,11 +125,11 @@ UTF-8 - 1.6.2 + 1.6.3 2.4.3 2.11.3 - 2.11.3 - 0.2.1 + 2.11.4 + 0.2.2 1.3.5 4.13.1 3.4.3 From 3eb0465ec450ddfe1eb7cb872553afefb32bbb71 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Wed, 15 Dec 2021 04:38:10 +0100 Subject: [PATCH 20/54] Update samples (#11119) --- .../kotlin/vertx/.openapi-generator/FILES | 2 +- .../server/petstore/kotlin/vertx/README.md | 2 +- .../server/api/model/ModelApiResponse.kt | 34 +++++++++++++++++++ .../server/api/verticle/PetApi.kt | 4 +-- .../api/verticle/PetApiVertxProxyHandler.kt | 2 +- 5 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES b/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES index cf01966a4d..bfa6fd2a60 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/FILES @@ -1,7 +1,7 @@ README.md pom.xml -src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt src/main/kotlin/org/openapitools/server/api/model/Category.kt +src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt src/main/kotlin/org/openapitools/server/api/model/Order.kt src/main/kotlin/org/openapitools/server/api/model/Pet.kt src/main/kotlin/org/openapitools/server/api/model/Tag.kt diff --git a/samples/server/petstore/kotlin/vertx/README.md b/samples/server/petstore/kotlin/vertx/README.md index 4e9992d66c..47e035f66d 100644 --- a/samples/server/petstore/kotlin/vertx/README.md +++ b/samples/server/petstore/kotlin/vertx/README.md @@ -51,8 +51,8 @@ This runs all tests and packages the library. ## Documentation for Models - - [org.openapitools.server.api.model.ApiResponse](docs/ApiResponse.md) - [org.openapitools.server.api.model.Category](docs/Category.md) + - [org.openapitools.server.api.model.ModelApiResponse](docs/ModelApiResponse.md) - [org.openapitools.server.api.model.Order](docs/Order.md) - [org.openapitools.server.api.model.Pet](docs/Pet.md) - [org.openapitools.server.api.model.Tag](docs/Tag.md) diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt new file mode 100644 index 0000000000..ce83269603 --- /dev/null +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ModelApiResponse.kt @@ -0,0 +1,34 @@ +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.server.api.model + + + +import com.google.gson.annotations.SerializedName +import com.fasterxml.jackson.annotation.JsonIgnoreProperties +import com.fasterxml.jackson.annotation.JsonInclude +/** + * Describes the result of uploading an image resource + * @param code + * @param type + * @param message + */ +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonIgnoreProperties(ignoreUnknown = true) +data class ModelApiResponse ( + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null +) { + +} + diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt index 07f9247177..5968aa12ca 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApi.kt @@ -1,6 +1,6 @@ package org.openapitools.server.api.verticle -import org.openapitools.server.api.model.ApiResponse +import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet import io.vertx.core.Vertx import io.vertx.core.json.JsonObject @@ -41,7 +41,7 @@ interface PetApi { suspend fun updatePetWithForm(petId:kotlin.Long?,name:kotlin.String?,status:kotlin.String?,context:OperationRequest):Response /* uploadFile * uploads an image */ - suspend fun uploadFile(petId:kotlin.Long?,additionalMetadata:kotlin.String?,file:kotlin.collections.List?,context:OperationRequest):Response + suspend fun uploadFile(petId:kotlin.Long?,additionalMetadata:kotlin.String?,file:kotlin.collections.List?,context:OperationRequest):Response companion object { const val address = "PetApi-service" suspend fun createRouterFactory(vertx: Vertx,path:String): io.vertx.ext.web.api.contract.openapi3.OpenAPI3RouterFactory { diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt index 6d4fcafa98..644fc1cee8 100644 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt +++ b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/verticle/PetApiVertxProxyHandler.kt @@ -16,7 +16,7 @@ import io.vertx.core.json.Json import io.vertx.core.json.JsonArray import com.google.gson.reflect.TypeToken import com.google.gson.Gson -import org.openapitools.server.api.model.ApiResponse +import org.openapitools.server.api.model.ModelApiResponse import org.openapitools.server.api.model.Pet class PetApiVertxProxyHandler(private val vertx: Vertx, private val service: PetApi, topLevel: Boolean, private val timeoutSeconds: Long) : ProxyHandler() { From b2daa5a836fcea8be2e64542b9a57abfd799b204 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 15 Dec 2021 11:41:16 +0800 Subject: [PATCH 21/54] update jackson-databind-nullable to 0.2.2 (#11121) --- .../Java/libraries/apache-httpclient/build.gradle.mustache | 2 +- .../main/resources/Java/libraries/feign/build.gradle.mustache | 2 +- .../src/main/resources/Java/libraries/feign/pom.mustache | 2 +- .../main/resources/Java/libraries/jersey2/build.gradle.mustache | 2 +- .../main/resources/Java/libraries/jersey2/build.sbt.mustache | 2 +- .../src/main/resources/Java/libraries/jersey2/pom.mustache | 2 +- .../src/main/resources/Java/libraries/native/pom.mustache | 2 +- .../Java/libraries/okhttp-gson-nextgen/build.sbt.mustache | 2 +- .../resources/Java/libraries/okhttp-gson-nextgen/pom.mustache | 2 +- .../resources/Java/libraries/okhttp-gson/build.sbt.mustache | 2 +- .../src/main/resources/Java/libraries/okhttp-gson/pom.mustache | 2 +- .../resources/Java/libraries/rest-assured/build.gradle.mustache | 2 +- .../resources/Java/libraries/rest-assured/build.sbt.mustache | 2 +- .../src/main/resources/Java/libraries/rest-assured/pom.mustache | 2 +- .../resources/Java/libraries/resttemplate/build.gradle.mustache | 2 +- .../src/main/resources/Java/libraries/resttemplate/pom.mustache | 2 +- .../main/resources/Java/libraries/vertx/build.gradle.mustache | 2 +- .../src/main/resources/Java/libraries/vertx/pom.mustache | 2 +- .../main/resources/JavaSpring/libraries/spring-mvc/pom.mustache | 2 +- samples/client/others/java/okhttp-gson-streaming/build.sbt | 2 +- samples/client/others/java/okhttp-gson-streaming/pom.xml | 2 +- samples/client/petstore/java/apache-httpclient/build.gradle | 2 +- samples/client/petstore/java/feign/build.gradle | 2 +- samples/client/petstore/java/feign/pom.xml | 2 +- .../petstore/java/jersey2-java8-localdatetime/build.gradle | 2 +- .../client/petstore/java/jersey2-java8-localdatetime/build.sbt | 2 +- .../client/petstore/java/jersey2-java8-localdatetime/pom.xml | 2 +- samples/client/petstore/java/jersey2-java8/build.gradle | 2 +- samples/client/petstore/java/jersey2-java8/build.sbt | 2 +- samples/client/petstore/java/jersey2-java8/pom.xml | 2 +- samples/client/petstore/java/native-async/pom.xml | 2 +- samples/client/petstore/java/native/pom.xml | 2 +- .../petstore/java/okhttp-gson-dynamicOperations/build.sbt | 2 +- .../client/petstore/java/okhttp-gson-dynamicOperations/pom.xml | 2 +- samples/client/petstore/java/okhttp-gson-nextgen/build.sbt | 2 +- samples/client/petstore/java/okhttp-gson-nextgen/pom.xml | 2 +- .../client/petstore/java/okhttp-gson-parcelableModel/build.sbt | 2 +- .../client/petstore/java/okhttp-gson-parcelableModel/pom.xml | 2 +- samples/client/petstore/java/okhttp-gson/build.sbt | 2 +- samples/client/petstore/java/okhttp-gson/pom.xml | 2 +- samples/client/petstore/java/rest-assured-jackson/build.gradle | 2 +- samples/client/petstore/java/rest-assured-jackson/build.sbt | 2 +- samples/client/petstore/java/rest-assured-jackson/pom.xml | 2 +- samples/client/petstore/java/resttemplate-withXml/build.gradle | 2 +- samples/client/petstore/java/resttemplate-withXml/pom.xml | 2 +- samples/client/petstore/java/resttemplate/build.gradle | 2 +- samples/client/petstore/java/resttemplate/pom.xml | 2 +- samples/client/petstore/java/vertx-no-nullable/pom.xml | 2 +- samples/client/petstore/java/vertx/build.gradle | 2 +- samples/client/petstore/java/vertx/pom.xml | 2 +- .../extensions/x-auth-id-alias/java/jersey2-java8/build.gradle | 2 +- .../extensions/x-auth-id-alias/java/jersey2-java8/build.sbt | 2 +- .../extensions/x-auth-id-alias/java/jersey2-java8/pom.xml | 2 +- .../petstore/java/jersey2-java8-special-characters/build.gradle | 2 +- .../petstore/java/jersey2-java8-special-characters/build.sbt | 2 +- .../petstore/java/jersey2-java8-special-characters/pom.xml | 2 +- .../openapi3/client/petstore/java/jersey2-java8/build.gradle | 2 +- samples/openapi3/client/petstore/java/jersey2-java8/build.sbt | 2 +- samples/openapi3/client/petstore/java/jersey2-java8/pom.xml | 2 +- samples/server/petstore/spring-mvc-j8-async/pom.xml | 2 +- samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml | 2 +- samples/server/petstore/spring-mvc-spring-pageable/pom.xml | 2 +- samples/server/petstore/spring-mvc/pom.xml | 2 +- 63 files changed, 63 insertions(+), 63 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache index 2c1de17903..5ae33f37e6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/apache-httpclient/build.gradle.mustache @@ -129,7 +129,7 @@ ext { jackson_version = "2.12.1" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 3ce02e7a06..c9bf7c357c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -105,7 +105,7 @@ ext { jackson_version = "2.10.3" jackson_databind_version = "2.10.3" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 5f87e95f56..f57614c584 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -365,7 +365,7 @@ 3.8.0 2.10.3 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} 2.10.3 {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index bb3a427f26..1dc7b62fa4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -114,7 +114,7 @@ ext { jackson_version = "2.13.0" jackson_databind_version = "2.13.0" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" jersey_version = "2.35" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index 3b16db6106..a1375400af 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -29,7 +29,7 @@ lazy val root = (project in file(".")). "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", {{/threetenbp}} {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", {{/openApiNullable}} {{#hasOAuthMethods}} "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache index 11857cbbcd..243be3921b 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -391,7 +391,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 {{#threetenbp}} 2.9.10 {{/threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index d81feac5e7..c0c151cda0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -229,7 +229,7 @@ 11 11 2.10.4 - 0.2.1 + 0.2.2 1.3.5 {{#threetenbp}} 2.9.10 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache index 907e8a916e..5e0c74c55c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/build.sbt.mustache @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", {{/openApiNullable}} {{#hasOAuthMethods}} "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache index 5d33c6ce25..10dfc15ab7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pom.mustache @@ -398,7 +398,7 @@ 2.8.8 3.12.0 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{#joda}} 2.10.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index 907e8a916e..5e0c74c55c 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -15,7 +15,7 @@ lazy val root = (project in file(".")). "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", {{/openApiNullable}} {{#hasOAuthMethods}} "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index cae6437881..94c057b142 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -388,7 +388,7 @@ 2.8.8 3.12.0 {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} {{#joda}} 2.10.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 2294f8808f..e80ea1813d 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -104,7 +104,7 @@ ext { jackson_version = "2.10.3" jackson_databind_version = "2.10.3" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 22390e12e0..6a048b92f8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -18,7 +18,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3", {{#openApiNullable}} - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", {{/openApiNullable}} {{#withXml}} "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.3", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache index 7a26d17a1d..c6e924ecb8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -358,7 +358,7 @@ {{/threetenbp}} {{#jackson}} 2.10.3 - 0.2.1 + 0.2.2 {{#threetenbp}} 2.10.0 {{/threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index c915f08bb2..75b4478ea8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -113,7 +113,7 @@ ext { jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" spring_web_version = "5.2.5.RELEASE" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache index ae3ceab245..6bd56372de 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -319,7 +319,7 @@ 5.2.5.RELEASE 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 {{#joda}} 2.9.9 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache index bd45198caa..bc33a07743 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -35,7 +35,7 @@ ext { vertx_version = "3.4.2" junit_version = "4.13.1" {{#openApiNullable}} - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" {{/openApiNullable}} jakarta_annotation_version = "1.3.5" {{#threetenbp}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache index cd17acbc20..2306edbfe8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/vertx/pom.mustache @@ -308,7 +308,7 @@ 1.5.22 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index 909113d701..9230b32c9d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -302,7 +302,7 @@ {{/useBeanValidation}} 4.3.20.RELEASE {{#openApiNullable}} - 0.2.1 + 0.2.2 {{/openApiNullable}} 2.9.8 diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index 903c7739e5..f37a72fb4b 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index be9a75c0b5..2b89ca0c1c 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -324,7 +324,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/apache-httpclient/build.gradle b/samples/client/petstore/java/apache-httpclient/build.gradle index 8aec91e0bc..bc0d421409 100644 --- a/samples/client/petstore/java/apache-httpclient/build.gradle +++ b/samples/client/petstore/java/apache-httpclient/build.gradle @@ -116,7 +116,7 @@ ext { swagger_annotations_version = "1.5.22" jackson_version = "2.12.1" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jackson_threetenbp_version = "2.9.10" httpclient_version = "4.5.13" diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 8cbc10e5c1..aa0a64e08f 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -104,7 +104,7 @@ ext { swagger_annotations_version = "1.5.24" jackson_version = "2.10.3" jackson_databind_version = "2.10.3" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jackson_threetenbp_version = "2.9.10" feign_version = "10.11" diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index b6ab732f2d..1f08498e79 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -331,7 +331,7 @@ 10.11 3.8.0 2.10.3 - 0.2.1 + 0.2.2 2.10.3 2.9.10 1.3.5 diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle index 7618c2e444..e1a7e57a0b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt index a5e716d7c1..c8adbf8c48 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml index b850beee9e..e4b20a617b 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/pom.xml @@ -342,7 +342,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 8.3.1 diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index 57f7cc9b70..44c89afeab 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index 424fe3d458..5a45537b12 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 2fc62928ae..30b4ba4016 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -342,7 +342,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 8.3.1 diff --git a/samples/client/petstore/java/native-async/pom.xml b/samples/client/petstore/java/native-async/pom.xml index eb1bf8a993..97c223f676 100644 --- a/samples/client/petstore/java/native-async/pom.xml +++ b/samples/client/petstore/java/native-async/pom.xml @@ -215,7 +215,7 @@ 11 11 2.10.4 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index eb1bf8a993..97c223f676 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -215,7 +215,7 @@ 11 11 2.10.4 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index 2957b77a9e..7de5adcd58 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.swagger.parser.v3" % "swagger-parser-v3" "2.0.23" % "compile" diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 9c060a66c6..9e8777894c 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -334,7 +334,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt b/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt index 6aebfa8e21..504c16ccb0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-nextgen/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml b/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml index 931f95599d..e9f84b263e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/pom.xml @@ -339,7 +339,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index e566d0fb4f..a90f98e215 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 098e028ec8..08ffdd44ec 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -336,7 +336,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index a791297fd3..95fad49a33 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -14,7 +14,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "logging-interceptor" % "4.9.1", "com.google.code.gson" % "gson" % "2.8.6", "org.apache.commons" % "commons-lang3" % "3.10", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1", "org.threeten" % "threetenbp" % "1.4.3" % "compile", "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index da2dbbe58e..43e3d9f548 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -329,7 +329,7 @@ 4.9.2 2.8.8 3.12.0 - 0.2.1 + 0.2.2 1.5.0 1.3.5 4.13.2 diff --git a/samples/client/petstore/java/rest-assured-jackson/build.gradle b/samples/client/petstore/java/rest-assured-jackson/build.gradle index e99cf39b11..eefeb332bd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.gradle +++ b/samples/client/petstore/java/rest-assured-jackson/build.gradle @@ -102,7 +102,7 @@ ext { junit_version = "4.13.1" jackson_version = "2.10.3" jackson_databind_version = "2.10.3" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" okio_version = "1.17.5" } diff --git a/samples/client/petstore/java/rest-assured-jackson/build.sbt b/samples/client/petstore/java/rest-assured-jackson/build.sbt index 4422008b63..78811a4180 100644 --- a/samples/client/petstore/java/rest-assured-jackson/build.sbt +++ b/samples/client/petstore/java/rest-assured-jackson/build.sbt @@ -16,7 +16,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-core" % "2.10.3", "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.3", "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.3", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.3", "com.squareup.okio" % "okio" % "1.17.5" % "compile", "jakarta.validation" % "jakarta.validation-api" % "2.0.2" % "compile", diff --git a/samples/client/petstore/java/rest-assured-jackson/pom.xml b/samples/client/petstore/java/rest-assured-jackson/pom.xml index 0c2e6e4bc4..43201004cb 100644 --- a/samples/client/petstore/java/rest-assured-jackson/pom.xml +++ b/samples/client/petstore/java/rest-assured-jackson/pom.xml @@ -287,7 +287,7 @@ 2.8.6 1.8.4 2.10.3 - 0.2.1 + 0.2.2 1.3.5 2.0.2 1.17.5 diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index f07930b7b5..96a7e7dd41 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -100,7 +100,7 @@ ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" spring_web_version = "5.2.5.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index 8c6793c1c4..a63c67fcf2 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -288,7 +288,7 @@ 5.2.5.RELEASE 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index a5719c67de..b70d21521b 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -100,7 +100,7 @@ ext { swagger_annotations_version = "1.5.22" jackson_version = "2.10.5" jackson_databind_version = "2.10.5.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" spring_web_version = "5.2.5.RELEASE" jodatime_version = "2.9.9" diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index 9921e8011e..7421690cdc 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -280,7 +280,7 @@ 5.2.5.RELEASE 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 2.9.10 1.0.0 diff --git a/samples/client/petstore/java/vertx-no-nullable/pom.xml b/samples/client/petstore/java/vertx-no-nullable/pom.xml index c0c0281f9e..c7c3a930c9 100644 --- a/samples/client/petstore/java/vertx-no-nullable/pom.xml +++ b/samples/client/petstore/java/vertx-no-nullable/pom.xml @@ -278,7 +278,7 @@ 1.5.22 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index c067ccdc2a..0f060495d9 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -34,7 +34,7 @@ ext { jackson_databind_version = "2.10.5.1" vertx_version = "3.4.2" junit_version = "4.13.1" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" } diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index e751a57d09..5c152ae84f 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -278,7 +278,7 @@ 1.5.22 2.10.5 2.10.5.1 - 0.2.1 + 0.2.2 1.3.5 4.13.1 diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle index b33e0d6418..58eba25952 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt index e5074a14e3..90ede61e7a 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.12.5" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.brsanthu" % "migbase64" % "2.2", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml index dbeb9684fd..bee91f7719 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/pom.xml @@ -342,7 +342,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 2.9.10 1.3.5 4.13.2 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle index c39ff494aa..459364339f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt index 423d4e3b58..6cc3961e30 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", "junit" % "junit" % "4.13.2" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml index 8feb1611f5..9828623b30 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/pom.xml @@ -337,7 +337,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 2.17.3 diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index 6ffa4c5ad7..841a3c55eb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -101,7 +101,7 @@ ext { swagger_annotations_version = "1.6.3" jackson_version = "2.13.0" jackson_databind_version = "2.13.0" - jackson_databind_nullable_version = "0.2.1" + jackson_databind_nullable_version = "0.2.2" jakarta_annotation_version = "1.3.5" jersey_version = "2.35" junit_version = "4.13.2" diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt index a427b720eb..a420957d37 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -20,7 +20,7 @@ lazy val root = (project in file(".")). "com.fasterxml.jackson.core" % "jackson-annotations" % "2.13.0" % "compile", "com.fasterxml.jackson.core" % "jackson-databind" % "2.13.0" % "compile", "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.13.0" % "compile", - "org.openapitools" % "jackson-databind-nullable" % "0.2.1" % "compile", + "org.openapitools" % "jackson-databind-nullable" % "0.2.2" % "compile", "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml index 0a3a077b03..d088ea0a7a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/openapi3/client/petstore/java/jersey2-java8/pom.xml @@ -347,7 +347,7 @@ 2.35 2.13.0 2.13.0 - 0.2.1 + 0.2.2 1.3.5 4.13.2 1.7 diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml index 8d2528b1b2..75642d4fca 100644 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml index 6155fc3e51..869d354af9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 diff --git a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml b/samples/server/petstore/spring-mvc-spring-pageable/pom.xml index c448133c79..1407e73eba 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/pom.xml +++ b/samples/server/petstore/spring-mvc-spring-pageable/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml index c61218492a..42dc38e182 100644 --- a/samples/server/petstore/spring-mvc/pom.xml +++ b/samples/server/petstore/spring-mvc/pom.xml @@ -176,7 +176,7 @@ 2.8.4 2.0.2 4.3.20.RELEASE - 0.2.1 + 0.2.2 2.9.8 From c27ddc67fe309298b2914c946ceb60b576c09a2b Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 15 Dec 2021 22:18:39 +0800 Subject: [PATCH 22/54] show error when schema in discriminator mapping is undefined (#11127) --- .../org/openapitools/codegen/DefaultCodegen.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 32947d7870..a9780140f4 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -3170,10 +3170,16 @@ public class DefaultCodegen implements CodegenConfig { List uniqueDescendants = new ArrayList(); if (sourceDiscriminator.getMapping() != null && !sourceDiscriminator.getMapping().isEmpty()) { for (Entry e : sourceDiscriminator.getMapping().entrySet()) { - String nameOrRef = e.getValue(); - String name = nameOrRef.indexOf('/') >= 0 ? ModelUtils.getSimpleRef(nameOrRef) : nameOrRef; - String modelName = toModelName(name); - uniqueDescendants.add(new MappedModel(e.getKey(), modelName)); + String name; + if (e.getValue().indexOf('/') >= 0) { + name = ModelUtils.getSimpleRef(e.getValue()); + if (ModelUtils.getSchema(openAPI, name) == null) { + LOGGER.error("Failed to lookup the schema '{}' when processing the discriminator mapping of oneOf/anyOf. Please check to ensure it's defined properly.", name); + } + } else { + name = e.getValue(); + } + uniqueDescendants.add(new MappedModel(e.getKey(), toModelName(name))); } } From ebb69147a54866fba800db2de44fa674a5b54a32 Mon Sep 17 00:00:00 2001 From: agilob Date: Fri, 17 Dec 2021 02:11:36 +0000 Subject: [PATCH 23/54] Forbid using standard streams in archunit (#11130) --- .../codegen/languages/DartDioNextClientCodegen.java | 1 - .../java/org/openapitools/codegen/ArchUnitRulesTest.java | 9 +++++++++ .../src/test/resources/archunit_ignore_patterns.txt | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 5f438eb6f8..0632215212 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -430,7 +430,6 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { * @param serializer */ private void addBuiltValueSerializer(BuiltValueSerializer serializer) { - System.out.println("######## Add serializer!"); additionalProperties.compute("builtValueSerializers", (k, v) -> { Set serializers = v == null ? Sets.newHashSet() : ((Set) v); serializers.add(serializer); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java index 0a9d7a95ab..fee76d588f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ArchUnitRulesTest.java @@ -4,6 +4,7 @@ import com.tngtech.archunit.core.domain.JavaClasses; import com.tngtech.archunit.core.domain.JavaModifier; import com.tngtech.archunit.core.importer.ClassFileImporter; import com.tngtech.archunit.lang.ArchRule; +import com.tngtech.archunit.library.GeneralCodingRules; import org.junit.Test; import org.slf4j.Logger; @@ -19,6 +20,14 @@ public class ArchUnitRulesTest { ArchUnitRulesTest.LOGGERS_SHOULD_BE_NOT_PUBLIC_NOT_STATIC_AND_FINAL.check(importedClasses); } + @Test + public void classesNotAllowedToUseStandardStreams() { + final JavaClasses importedClasses = new ClassFileImporter() + .importPackages("org.openapitools.codegen.languages"); + + GeneralCodingRules.NO_CLASSES_SHOULD_ACCESS_STANDARD_STREAMS.check(importedClasses); + } + @Test public void abstractClassesAreAbstract() { final JavaClasses importedClasses = new ClassFileImporter() diff --git a/modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt b/modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt new file mode 100644 index 0000000000..e6814b46eb --- /dev/null +++ b/modules/openapi-generator/src/test/resources/archunit_ignore_patterns.txt @@ -0,0 +1,2 @@ +# This rule is for ArchUnitRulesTest.classesNotAllowedToUseStandardStreams to ignore method `postProcess()` of CodegenConfig as it contains funding information +.*\.postProcess\(\).* From 9b65513bb1f5ff30a0bf8a51188829b19c62ffb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20=C4=8Cerm=C3=A1k?= Date: Fri, 17 Dec 2021 03:12:11 +0100 Subject: [PATCH 24/54] [Protobuf-Schema] Namespace updates (#11115) * [Protobuf-Schema] Namespace updates * [Protobuf-Schema] Petstore sample updated --- .../codegen/languages/ProtobufSchemaCodegen.java | 16 ++++++++++++---- .../main/resources/protobuf-schema/api.mustache | 2 +- .../resources/protobuf-schema/model.mustache | 2 +- .../test/resources/3_0/protobuf-schema/pet.proto | 2 +- .../protobuf-schema/services/pet_service.proto | 2 +- .../protobuf-schema/services/store_service.proto | 2 +- .../protobuf-schema/services/user_service.proto | 2 +- 7 files changed, 18 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java index d842a935a0..777f6fc516 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/ProtobufSchemaCodegen.java @@ -91,7 +91,7 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf apiTemplateFiles.put("api.mustache", ".proto"); embeddedTemplateDir = templateDir = "protobuf-schema"; hideGenerationTimestamp = Boolean.TRUE; - modelPackage = "messages"; + modelPackage = "models"; apiPackage = "services"; defaultIncludes = new HashSet<>( @@ -167,12 +167,20 @@ public class ProtobufSchemaCodegen extends DefaultCodegen implements CodegenConf apiDocTemplateFiles.clear(); // TODO: add api doc template modelDocTemplateFiles.clear(); // TODO: add model doc template - modelPackage = "models"; - apiPackage = "services"; - if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); } + else { + additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); + } + + if (!additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { + additionalProperties.put(CodegenConstants.API_PACKAGE, apiPackage); + } + + if (!additionalProperties.containsKey(CodegenConstants.MODEL_PACKAGE)) { + additionalProperties.put(CodegenConstants.MODEL_PACKAGE, modelPackage); + } if (additionalProperties.containsKey(this.NUMBERED_FIELD_NUMBER_LIST)) { this.numberedFieldNumberList = convertPropertyToBooleanAndWriteBack(NUMBERED_FIELD_NUMBER_LIST); diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache index ccf06f93c6..dc4ec5e1c3 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/api.mustache @@ -1,7 +1,7 @@ {{>partial_header}} syntax = "proto3"; -package {{{packageName}}}; +package {{#lambda.lowercase}}{{{packageName}}}.{{{apiPackage}}}.{{{classname}}};{{/lambda.lowercase}} import "google/protobuf/empty.proto"; {{#imports}} diff --git a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache index 2a609db9a8..2aca6336c9 100644 --- a/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache +++ b/modules/openapi-generator/src/main/resources/protobuf-schema/model.mustache @@ -1,7 +1,7 @@ {{>partial_header}} syntax = "proto3"; -package {{{packageName}}}; +package {{#lambda.lowercase}}{{{packageName}}};{{/lambda.lowercase}} {{#imports}} {{#import}} diff --git a/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto b/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto index 7ba4adc282..be5371035c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto +++ b/modules/openapi-generator/src/test/resources/3_0/protobuf-schema/pet.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package ; +package openapitools; import public "models/lizard_all_of.proto"; import public "models/snake_all_of.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/pet_service.proto b/samples/config/petstore/protobuf-schema/services/pet_service.proto index 6ac05f1dee..ba8b4c18e3 100644 --- a/samples/config/petstore/protobuf-schema/services/pet_service.proto +++ b/samples/config/petstore/protobuf-schema/services/pet_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package petstore.services.petservice; import "google/protobuf/empty.proto"; import public "models/api_response.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/store_service.proto b/samples/config/petstore/protobuf-schema/services/store_service.proto index e30382ad50..05ebe84e1f 100644 --- a/samples/config/petstore/protobuf-schema/services/store_service.proto +++ b/samples/config/petstore/protobuf-schema/services/store_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package petstore.services.storeservice; import "google/protobuf/empty.proto"; import public "models/order.proto"; diff --git a/samples/config/petstore/protobuf-schema/services/user_service.proto b/samples/config/petstore/protobuf-schema/services/user_service.proto index 8130b04aad..119219d6fc 100644 --- a/samples/config/petstore/protobuf-schema/services/user_service.proto +++ b/samples/config/petstore/protobuf-schema/services/user_service.proto @@ -10,7 +10,7 @@ syntax = "proto3"; -package petstore; +package petstore.services.userservice; import "google/protobuf/empty.proto"; import public "models/user.proto"; From 2e08c5f403a431490738f32cafec00c7dd55c19f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Dec 2021 10:14:29 +0800 Subject: [PATCH 25/54] Bump actions/download-artifact from 2.0.10 to 2.1.0 (#11066) Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2.0.10 to 2.1.0. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v2.0.10...v2.1.0) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-supported-versions.yaml | 2 +- .github/workflows/openapi-generator.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 017b4bdf0a..07ad0cbbdf 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -81,7 +81,7 @@ jobs: - name: Check out code uses: actions/checkout@v2 - name: Download build artifact - uses: actions/download-artifact@v2.0.10 + uses: actions/download-artifact@v2.1.0 with: name: artifact - name: Run Ensures Script diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index b2e477592d..c75551e262 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -93,7 +93,7 @@ jobs: java-version: 8 distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact - uses: actions/download-artifact@v2.0.10 + uses: actions/download-artifact@v2.1.0 with: name: openapi-generator-cli.jar path: modules/openapi-generator-cli/target @@ -132,7 +132,7 @@ jobs: java-version: 8 distribution: 'temurin' - name: Download openapi-generator-cli.jar artifact - uses: actions/download-artifact@v2.0.10 + uses: actions/download-artifact@v2.1.0 with: name: openapi-generator-cli.jar path: modules/openapi-generator-cli/target From 94e3ae10fd64aba1baf6b4c5dfa1f0b6d5698057 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Dec 2021 10:14:41 +0800 Subject: [PATCH 26/54] Bump actions/upload-artifact from 2.2.4 to 2.3.1 (#11136) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2.2.4 to 2.3.1. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v2.2.4...v2.3.1) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/check-supported-versions.yaml | 2 +- .github/workflows/openapi-generator.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 07ad0cbbdf..78aba7433a 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -50,7 +50,7 @@ jobs: run: mvn -nsu -B --quiet -Djacoco.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress clean install --file pom.xml ${{ matrix.flags }} - name: Upload Maven build artifact - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2.3.1 if: matrix.java == '8' && matrix.os == 'ubuntu-latest' with: name: artifact diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index c75551e262..b7d6f0fedb 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -39,7 +39,7 @@ jobs: run: mvn --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error - run: ls -la modules/openapi-generator-cli/target - name: Upload openapi-generator-cli.jar artifact - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2.3.1 with: name: openapi-generator-cli.jar path: modules/openapi-generator-cli/target/openapi-generator-cli.jar @@ -75,7 +75,7 @@ jobs: run: mvn --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error - name: Publish unit test reports if: ${{ always() }} - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v2.3.1 with: name: surefire-test-results path: '**/surefire-reports/TEST-*.xml' From fedc54af9a2995df1e76bedf85122d548e78a1d9 Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Fri, 17 Dec 2021 03:18:10 +0100 Subject: [PATCH 27/54] [K6 Generator] various enhancements (request body example data extraction, support for generating scenario tests and load tests out of the box, and much more) (#11106) * Further K6 OpenAPI generator enhancements * request body example data extraction * request grouping and ordering * response visibility * request data extraction for chaining requests Signed-off-by: Michael H. Siemaszko * Further K6 OpenAPI generator enhancements - regenerated samples Signed-off-by: Michael H. Siemaszko * Fix suggested changes by linter * Fix extra spaces in the template * Log exception * Rename function signature to camelCase * Address comments on Big-O * Move declaration of variable near the usage * Add config file for generating k6 script * Regenerate k6 script * Regenerate samples * Fix predicate * Fix missing import Co-authored-by: Michael H. Siemaszko --- bin/configs/k6.yaml | 6 + modules/openapi-generator/pom.xml | 5 + .../codegen/CodegenOperation.java | 35 +- .../codegen/languages/K6ClientCodegen.java | 494 +++++++++++-- .../src/main/resources/k6/script.mustache | 82 +-- pom.xml | 1 + .../petstore/k6/.openapi-generator/FILES | 2 + .../petstore/k6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/script.js | 676 ++++++++++++++---- 9 files changed, 1055 insertions(+), 248 deletions(-) create mode 100644 bin/configs/k6.yaml create mode 100644 samples/client/petstore/k6/.openapi-generator/FILES diff --git a/bin/configs/k6.yaml b/bin/configs/k6.yaml new file mode 100644 index 0000000000..9933744e31 --- /dev/null +++ b/bin/configs/k6.yaml @@ -0,0 +1,6 @@ +generatorName: k6 +outputDir: samples/client/petstore/k6 +inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml +templateDir: modules/openapi-generator/src/main/resources/k6 +additionalProperties: + appName: PetstoreClient diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index ada2ac46d9..7fbb9f96c3 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -297,6 +297,11 @@ commons-lang3 ${commons-lang.version} + + org.apache.commons + commons-text + ${commons-text.version} + commons-cli commons-cli diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java index 83413a9ee1..ca0cca500c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenOperation.java @@ -66,7 +66,11 @@ public class CodegenOperation { * * @return true if parameter exists, false otherwise */ - private static boolean nonempty(List params) { + private static boolean nonEmpty(List params) { + return params != null && params.size() > 0; + } + + private static boolean nonEmpty(Map params) { return params != null && params.size() > 0; } @@ -76,7 +80,7 @@ public class CodegenOperation { * @return true if body parameter exists, false otherwise */ public boolean getHasBodyParam() { - return nonempty(bodyParams); + return nonEmpty(bodyParams); } /** @@ -85,7 +89,7 @@ public class CodegenOperation { * @return true if query parameter exists, false otherwise */ public boolean getHasQueryParams() { - return nonempty(queryParams); + return nonEmpty(queryParams); } /** @@ -103,7 +107,7 @@ public class CodegenOperation { * @return true if header parameter exists, false otherwise */ public boolean getHasHeaderParams() { - return nonempty(headerParams); + return nonEmpty(headerParams); } /** @@ -112,7 +116,7 @@ public class CodegenOperation { * @return true if path parameter exists, false otherwise */ public boolean getHasPathParams() { - return nonempty(pathParams); + return nonEmpty(pathParams); } /** @@ -121,7 +125,7 @@ public class CodegenOperation { * @return true if any form parameter exists, false otherwise */ public boolean getHasFormParams() { - return nonempty(formParams); + return nonEmpty(formParams); } /** @@ -139,7 +143,7 @@ public class CodegenOperation { * @return true if any cookie parameter exists, false otherwise */ public boolean getHasCookieParams() { - return nonempty(cookieParams); + return nonEmpty(cookieParams); } /** @@ -148,7 +152,7 @@ public class CodegenOperation { * @return true if any optional parameter exists, false otherwise */ public boolean getHasOptionalParams() { - return nonempty(optionalParams); + return nonEmpty(optionalParams); } /** @@ -157,7 +161,7 @@ public class CodegenOperation { * @return true if any optional parameter exists, false otherwise */ public boolean getHasRequiredParams() { - return nonempty(requiredParams); + return nonEmpty(requiredParams); } /** @@ -166,7 +170,7 @@ public class CodegenOperation { * @return true if header response exists, false otherwise */ public boolean getHasResponseHeaders() { - return nonempty(responseHeaders); + return nonEmpty(responseHeaders); } /** @@ -175,7 +179,7 @@ public class CodegenOperation { * @return true if examples parameter exists, false otherwise */ public boolean getHasExamples() { - return nonempty(examples); + return nonEmpty(examples); } /** @@ -187,6 +191,15 @@ public class CodegenOperation { return responses.stream().filter(response -> response.isDefault).findFirst().isPresent(); } + /** + * Check if there's at least one vendor extension + * + * @return true if vendor extensions exists, false otherwise + */ + public boolean getHasVendorExtensions() { + return nonEmpty(vendorExtensions); + } + /** * Check if act as Restful index method * diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java index bf3cf05c81..681594ea8e 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/K6ClientCodegen.java @@ -28,22 +28,28 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; +import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Objects; +import java.util.Optional; +import java.util.OptionalInt; import java.util.Set; +import java.util.TreeMap; import java.util.TreeSet; +import java.util.Map.Entry; import java.util.stream.Collectors; import javax.annotation.Nullable; import com.google.common.collect.ImmutableMap; -import org.apache.commons.lang3.StringEscapeUtils; +import org.apache.commons.text.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; import org.openapitools.codegen.CodegenConfig; import org.openapitools.codegen.CodegenConstants; import org.openapitools.codegen.CodegenModel; +import org.openapitools.codegen.CodegenOperation; import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.CodegenProperty; import org.openapitools.codegen.CodegenResponse; @@ -56,10 +62,13 @@ import org.openapitools.codegen.utils.ModelUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Mustache.Lambda; import com.samskivert.mustache.Template; +import io.swagger.v3.core.util.Json; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; import io.swagger.v3.oas.models.PathItem; @@ -73,6 +82,24 @@ import io.swagger.v3.oas.models.servers.Server; public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { + // K6 vendor extension - operation grouping - group operations and define their + // ordering, to allow for e.g. scenario testing + private static final String X_OPERATION_GROUPING = "x-k6-openapi-operation-grouping"; + + // K6 vendor extension - operation response - for now, allows to hide given + // operation response, so that in case of multiple 2xx responses, generated + // script checks only against e.g. code 200 responses + private static final String X_OPERATION_RESPONSE = "x-k6-openapi-operation-response"; + private static final String X_OPERATION_RESPONSE_HIDE = "hide"; + + // K6 vendor extension - extract data from operation - allows to specify path to + // value in body of response which should be extracted and assigned to variable + // for later use by other operations + private static final String X_OPERATION_DATAEXTRACT = "x-k6-openapi-operation-dataextract"; + private static final String X_OPERATION_DATAEXTRACT_OPERATION_ID = "operationId"; // denotes ID of operation whose response body contains value to be extracted + private static final String X_OPERATION_DATAEXTRACT_VALUE_PATH = "valuePath"; // denotes path to value in body of response which should be extracted + private static final String X_OPERATION_DATAEXTRACT_PARAMETER_NAME = "parameterName"; // denotes name of parameter to which extracted value should be assigned + public K6ClientCodegen() { super(); @@ -86,6 +113,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { String key; Object value; boolean hasExample; + boolean initialize; public Parameter(String key, Object value) { this.key = key; @@ -98,6 +126,11 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { this.hasExample = hasExample; } + public Parameter(String key, boolean initialize) { + this.key = key; + this.initialize = initialize; + } + @Override public int hashCode() { return key.hashCode(); @@ -110,10 +143,35 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { if (obj == null || getClass() != obj.getClass()) return false; Parameter p = (Parameter) obj; - return key.equals(p.key) && value.equals(p.value) && hasExample == p.hasExample; + return key.equals(p.key) && value.equals(p.value) && hasExample == p.hasExample + && initialize == p.initialize; } } - + + // Stores information specified in `X_OPERATION_GROUPING` K6 vendor extension + static class OperationGrouping { + String groupName; + int order; + + public OperationGrouping(String groupName, int order) { + this.groupName = groupName; + this.order = order; + } + } + + // Stores information specified in `X_OPERATION_DATAEXTRACT` K6 vendor extension + static class DataExtractSubstituteParameter { + String operationId; + String valuePath; + String paramName; + + public DataExtractSubstituteParameter(String operationId, String valuePath, String paramName) { + this.operationId = operationId; + this.valuePath = valuePath; + this.paramName = paramName; + } + } + static class ParameterValueLambda implements Mustache.Lambda { private static final String NO_EXAMPLE_PARAM_VALUE_PREFIX = "TODO_EDIT_THE_"; @@ -123,7 +181,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { // default used if no example is provided String noExampleParamValue = String.join("", quoteExample( - String.join("", NO_EXAMPLE_PARAM_VALUE_PREFIX, fragment.execute())), + String.join("", NO_EXAMPLE_PARAM_VALUE_PREFIX, fragment.execute())), ";", " // specify value as there is no example value for this parameter in OpenAPI spec"); @@ -138,10 +196,10 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { @SuppressWarnings("unchecked") Set exampleValues = ((Map) rawValue).values().stream() - .map(x -> quoteExample( - StringEscapeUtils.escapeEcmaScript( - String.valueOf(x.getValue())))) - .collect(Collectors.toCollection(() -> new TreeSet<>())); + .map(x -> quoteExample( + StringEscapeUtils.escapeEcmaScript( + String.valueOf(x.getValue())))) + .collect(Collectors.toCollection(TreeSet::new)); if (!exampleValues.isEmpty()) { @@ -160,11 +218,20 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { quoteExample( StringEscapeUtils.escapeEcmaScript( String.valueOf( - ((K6ClientCodegen.Parameter) fragment.context()).value))), + ((K6ClientCodegen.Parameter) fragment.context()).value))), ";", " // extracted from 'example' field defined at the parameter level of OpenAPI spec")); } + // param needs to be initialized for subsequent data extraction - see `X_OPERATION_DATAEXTRACT` K6 vendor extension + } else if (fragment.context() instanceof K6ClientCodegen.Parameter + && ((K6ClientCodegen.Parameter) fragment.context()).initialize) { + + writer.write(String.join("", + "null", + ";", + " // parameter initialized for subsequent data extraction")); + } else { writer.write(noExampleParamValue); } @@ -231,25 +298,33 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { static class HTTPRequest { String method; + boolean isDelete; String path; @Nullable List query; @Nullable HTTPBody body; + boolean hasBodyExample; @Nullable HTTPParameters params; @Nullable List k6Checks; + @Nullable + DataExtractSubstituteParameter dataExtract; public HTTPRequest(String method, String path, @Nullable List query, @Nullable HTTPBody body, - @Nullable HTTPParameters params, @Nullable List k6Checks) { + boolean hasBodyExample, @Nullable HTTPParameters params, @Nullable List k6Checks, + DataExtractSubstituteParameter dataExtract) { // NOTE: https://k6.io/docs/javascript-api/k6-http/del-url-body-params this.method = method.equals("delete") ? "del" : method; + this.isDelete = method.equals("delete"); this.path = path; this.query = query; this.body = body; + this.hasBodyExample = hasBodyExample; this.params = params; this.k6Checks = k6Checks; + this.dataExtract = dataExtract; } } @@ -257,11 +332,26 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { String groupName; Set variables; // query and path parameters List requests; + private final Map requestsMap; - public HTTPRequestGroup(String groupName, Set variables, List requests) { + public HTTPRequestGroup(String groupName, Set variables, Map requestsMap) { this.groupName = groupName; this.variables = variables; - this.requests = requests; + this.requestsMap = requestsMap; + this.requests = sortRequests(requestsMap); + } + + private void addRequests(Map moreRequests) { + this.requestsMap.putAll(moreRequests); + this.requests = sortRequests(this.requestsMap); + } + + private void addVariables(Set moreVariables) { + this.variables.addAll(moreVariables); + } + + private List sortRequests(Map requestsMap) { + return new ArrayList<>(new TreeMap<>(requestsMap).values()); } } @@ -398,14 +488,21 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { } additionalProperties.put(BASE_URL, baseURL); - List requestGroups = new ArrayList<>(); + // if data is to be extracted from any of the operations' responses, this has to + // be known prior to executing processing of OpenAPI spec further down + Map dataExtractSubstituteParams = getDataExtractSubstituteParameters( + openAPI); + + Map requestGroups = new HashMap<>(); Set extraParameters = new HashSet<>(); Map> pathVariables = new HashMap<>(); for (String path : openAPI.getPaths().keySet()) { - List requests = new ArrayList<>(); + Map requests = new HashMap<>(); Set variables = new HashSet<>(); + String groupName = path; + for (Map.Entry methodOperation : openAPI.getPaths().get(path). readOperationsMap().entrySet()) { List httpParams = new ArrayList<>(); @@ -416,11 +513,32 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { final Operation operation = methodOperation.getValue(); final PathItem.HttpMethod method = methodOperation.getKey(); + OptionalInt operationGroupingOrder = OptionalInt.empty(); + + String operationId = operation.getOperationId(); + + boolean hasRequestBodyExample = false; + + // optionally group and order operations - see `X_OPERATION_GROUPING` K6 vendor + // extension + final CodegenOperation cgOperation = super.fromOperation(path, method.name(), operation, null); + Optional operationGrouping = extractOperationGrouping(cgOperation); + if (operationGrouping.isPresent()) { + groupName = operationGrouping.get().groupName; + operationGroupingOrder = OptionalInt.of(operationGrouping.get().order); + } for (Map.Entry resp : operation.getResponses().entrySet()) { String statusData = resp.getKey().equals("default") ? "200" : resp.getKey(); + + // optionally hide given response - see `X_OPERATION_RESPONSE` K6 vendor + // extension + // i.e. in case of multiple 2xx responses, generated script checks only against + // e.g. code 200 responses + boolean hideOperationResponse = shouldHideOperationResponse(resp.getValue()); + int status = Integer.parseInt(statusData); - if (status >= 200 && status < 300) { + if (!hideOperationResponse && (status >= 200 && status < 300)) { k6Checks.add(new k6Check(status, resp.getValue().getDescription())); } } @@ -428,7 +546,7 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { if (hasBodyParameter(openAPI, operation) || hasFormParameter(openAPI, operation)) { String defaultContentType = hasFormParameter(openAPI, operation) ? "application/x-www-form-urlencoded" : "application/json"; List consumes = new ArrayList<>(getConsumesInfo(openAPI, operation)); - String contentTypeValue = consumes == null || consumes.isEmpty() ? defaultContentType : consumes.get(0); + String contentTypeValue = consumes.isEmpty() ? defaultContentType : consumes.get(0); if (contentTypeValue.equals("*/*")) contentTypeValue = "application/json"; Parameter contentType = new Parameter("Content-Type", getDoubleQuotedString(contentTypeValue)); @@ -436,6 +554,12 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { RequestBody requestBody = ModelUtils.getReferencedRequestBody(openAPI, operation.getRequestBody()); + // extract request body example, if present + hasRequestBodyExample = hasRequestBodyExample(requestBody, contentTypeValue); + if (hasRequestBodyExample) { + extractRequestBodyExample(requestBody, contentTypeValue, bodyOrFormParams); + } + for (Map.Entry responseEntry : operation.getResponses().entrySet()) { CodegenResponse r = fromResponse(responseEntry.getKey(), responseEntry.getValue()); if (r.baseType != null && @@ -445,30 +569,34 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { } } - List formParameters = fromRequestBodyToFormParameters(requestBody, imports); - for (CodegenParameter parameter : formParameters) { - String reference = ""; - if (parameter.isModel) { - Schema nestedSchema = ModelUtils.getSchema(openAPI, parameter.baseType); - CodegenModel model = fromModel(parameter.paramName, nestedSchema); - reference = generateNestedModelTemplate(model); - if (parameter.dataType.equals("List")) { - reference = "[" + reference + "]"; + // if we have at least one request body example, we do not need to construct these dummies + if (!hasRequestBodyExample) { + List formParameters = fromRequestBodyToFormParameters(requestBody, imports); + for (CodegenParameter parameter : formParameters) { + String reference = ""; + if (parameter.isModel) { + Schema nestedSchema = ModelUtils.getSchema(openAPI, parameter.baseType); + CodegenModel model = fromModel(parameter.paramName, nestedSchema); + reference = generateNestedModelTemplate(model); + if (parameter.dataType.equals("List")) { + reference = "[" + reference + "]"; + } } - } - Parameter k6Parameter; - if (parameter.dataType.equals("File")) { - k6Parameter = new Parameter(parameter.paramName, - "http.file(open(\"/path/to/file.bin\", \"b\"), \"test.bin\")"); - } else { - k6Parameter = new Parameter(parameter.paramName, !reference.isEmpty() ? reference - : getDoubleQuotedString(parameter.dataType.toLowerCase(Locale.ROOT))); - } + Parameter k6Parameter; + if (parameter.dataType.equals("File")) { + k6Parameter = new Parameter(parameter.paramName, + "http.file(open(\"/path/to/file.bin\", \"b\"), \"test.bin\")"); + } else { + k6Parameter = new Parameter(parameter.paramName, !reference.isEmpty() ? reference + : getDoubleQuotedString(parameter.dataType.toLowerCase(Locale.ROOT))); + } - bodyOrFormParams.add(k6Parameter); + bodyOrFormParams.add(k6Parameter); + } } } + String accepts = getAccept(openAPI, operation); String responseType = getDoubleQuotedString(accepts); @@ -507,32 +635,46 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { } } } catch (NullPointerException e) { - + LOGGER.error(e.getMessage(), e); } - pathVariables.put(path, variables); + pathVariables.put(groupName, variables); final HTTPParameters params = new HTTPParameters(null, null, httpParams, null, null, null, null, null, responseType.length() > 0 ? responseType : null); assert params.headers != null; - requests.add(new HTTPRequest(method.toString().toLowerCase(Locale.ROOT), path, + + // check if data needs to be extracted from response of this operation + Optional dataExtract = getDataExtractSubstituteParameter( + dataExtractSubstituteParams, operationId); + + // calculate order for this current request + Integer requestOrder = calculateRequestOrder(operationGroupingOrder, requests.size()); + + requests.put(requestOrder, new HTTPRequest(method.toString().toLowerCase(Locale.ROOT), path, queryParams.size() > 0 ? queryParams : null, - bodyOrFormParams.size() > 0 ? new HTTPBody(bodyOrFormParams) : null, - params.headers.size() > 0 ? params : null, k6Checks.size() > 0 ? k6Checks : null)); + bodyOrFormParams.size() > 0 ? new HTTPBody(bodyOrFormParams) : null, hasRequestBodyExample, + params.headers.size() > 0 ? params : null, k6Checks.size() > 0 ? k6Checks : null, + dataExtract.orElse(null))); } - requestGroups.add(new HTTPRequestGroup(path, pathVariables.get(path), requests)); + + addOrUpdateRequestGroup(requestGroups, groupName, pathVariables.get(groupName), requests); } - for (HTTPRequestGroup requestGroup : requestGroups) { + for (HTTPRequestGroup requestGroup : requestGroups.values()) { for (HTTPRequest request : requestGroup.requests) { if (request.path.contains("/{")) { request.path = request.path.replace("/{", "/${"); } } + + // any variables not defined yet but used for subsequent data extraction must be + // initialized + initializeDataExtractSubstituteParameters(dataExtractSubstituteParams, requestGroup); } - additionalProperties.put("requestGroups", requestGroups); + additionalProperties.put("requestGroups", requestGroups.values()); additionalProperties.put("extra", extraParameters); for (String[] supportingTemplateFile : JAVASCRIPT_SUPPORTING_FILES) { @@ -744,9 +886,273 @@ public class K6ClientCodegen extends DefaultCodegen implements CodegenConfig { return accepts; } - + @Override protected ImmutableMap.Builder addMustacheLambdas() { return super.addMustacheLambdas().put("handleParamValue", new ParameterValueLambda()); } + + /** + * We're iterating over paths but grouping requests across paths, therefore + * these need to be aggregated. + * + * @param requestGroups + * @param groupName + * @param variables + * @param requests + */ + private void addOrUpdateRequestGroup(Map requestGroups, String groupName, + Set variables, Map requests) { + if (requestGroups.containsKey(groupName)) { + HTTPRequestGroup existingHTTPRequestGroup = requestGroups.get(groupName); + existingHTTPRequestGroup.addRequests(requests); + existingHTTPRequestGroup.addVariables(variables); + } else { + requestGroups.put(groupName, new HTTPRequestGroup(groupName, variables, requests)); + } + } + + /** + * If `X_OPERATION_DATAEXTRACT` K6 vendor extension is present, extract info + * from it. + * + * @param openAPI + * @return + */ + private Map getDataExtractSubstituteParameters(OpenAPI openAPI) { + Map dataExtractSubstituteParams = new HashMap<>(); + + for (String path : openAPI.getPaths().keySet()) { + for (Map.Entry methodOperation : openAPI.getPaths().get(path) + .readOperationsMap().entrySet()) { + + final PathItem.HttpMethod method = methodOperation.getKey(); + final Operation operation = methodOperation.getValue(); + final CodegenOperation cgOperation = super.fromOperation(path, method.name(), operation, null); + + if (cgOperation.getHasVendorExtensions() + && cgOperation.vendorExtensions.containsKey(X_OPERATION_DATAEXTRACT) + && cgOperation.vendorExtensions.get(X_OPERATION_DATAEXTRACT) instanceof java.util.Map) { + + Optional dataExtractSubstituteParameter = getDataExtractSubstituteParameter( + (Map) cgOperation.vendorExtensions.get(X_OPERATION_DATAEXTRACT)); + + // TODO: add support for extracting data for multiple params + dataExtractSubstituteParameter.ifPresent(extractSubstituteParameter -> dataExtractSubstituteParams.put(extractSubstituteParameter.operationId, + extractSubstituteParameter)); + } + + } + } + + return dataExtractSubstituteParams; + } + + /** + * Optionally, retrieve information specified in the `X_OPERATION_DATAEXTRACT` + * K6 vendor extension + * + * @param xOperationDataExtractProperties + * @return optional as only returned if all required info is present + */ + private Optional getDataExtractSubstituteParameter( + Map xOperationDataExtractProperties) { + + Optional operationId = Optional.empty(); + Optional valuePath = Optional.empty(); + Optional parameterName = Optional.empty(); + + for (Map.Entry xOperationDataExtractPropertiesEntry : xOperationDataExtractProperties.entrySet()) { + + switch (String.valueOf(xOperationDataExtractPropertiesEntry.getKey())) { + case X_OPERATION_DATAEXTRACT_OPERATION_ID: + operationId = Optional.of(String.valueOf(xOperationDataExtractPropertiesEntry.getValue())); + continue; + + case X_OPERATION_DATAEXTRACT_VALUE_PATH: + valuePath = Optional.of(String.valueOf(xOperationDataExtractPropertiesEntry.getValue())); + continue; + + case X_OPERATION_DATAEXTRACT_PARAMETER_NAME: + parameterName = Optional.of(String.valueOf(xOperationDataExtractPropertiesEntry.getValue())); + } + } + + if (operationId.isPresent() && valuePath.isPresent() && parameterName.isPresent()) { + return Optional + .of(new DataExtractSubstituteParameter(operationId.get(), valuePath.get(), parameterName.get())); + + } else { + return Optional.empty(); + } + } + + /** + * Optionally, retrieve data extraction properties for given operation + * + * @param dataExtractSubstituteParams + * @param operationId + * @return optional as only returned if present for given operation + */ + private Optional getDataExtractSubstituteParameter( + Map dataExtractSubstituteParams, String operationId) { + + return (!dataExtractSubstituteParams.isEmpty() && dataExtractSubstituteParams.containsKey(operationId)) + ? Optional.of(dataExtractSubstituteParams.get(operationId)) + : Optional.empty(); + } + + /** + * Optionally, retrieve information specified in the `X_OPERATION_GROUPING` K6 + * vendor extension + * + * @param cgOperation + * @return optional as only returned if required info is present + */ + private Optional extractOperationGrouping(CodegenOperation cgOperation) { + Optional operationGrouping = Optional.empty(); + + if (cgOperation.getHasVendorExtensions() && cgOperation.vendorExtensions.containsKey(X_OPERATION_GROUPING) + && cgOperation.vendorExtensions.get(X_OPERATION_GROUPING) instanceof java.util.Map) { + + Map.Entry operationGroupingEntry = ((Map) cgOperation.vendorExtensions + .get(X_OPERATION_GROUPING)).entrySet().stream().findFirst().get(); + + return Optional.of(new OperationGrouping(String.valueOf(operationGroupingEntry.getKey()), + Integer.parseInt(String.valueOf(operationGroupingEntry.getValue())))); + } + + return operationGrouping; + } + + /** + * If `X_OPERATION_RESPONSE` K6 vendor extension is present, check if given + * operation response should be hidden. + * + * @param resp + * @return true if should be hidden, false otherwise + */ + private boolean shouldHideOperationResponse(ApiResponse resp) { + boolean hideOperationResponse = false; + + if (Objects.nonNull(resp.getExtensions()) && !resp.getExtensions().isEmpty() + && resp.getExtensions().containsKey(X_OPERATION_RESPONSE)) { + + Map respExtensions = (Map) resp.getExtensions().get(X_OPERATION_RESPONSE); + Entry entry = respExtensions.entrySet().stream().findFirst().orElse(null); + + if (entry.getKey().equals(X_OPERATION_RESPONSE_HIDE)) { + return Boolean.parseBoolean(String.valueOf(entry.getValue())); + } + } + + return false; + } + + /** + * Check if example is present for given request body and content type. + * + * @param requestBody + * @param contentTypeValue + * @return true if present, false otherwise + */ + private boolean hasRequestBodyExample(RequestBody requestBody, String contentTypeValue) { + return (Objects.nonNull(requestBody.getContent()) && requestBody.getContent().containsKey(contentTypeValue) + && Objects.nonNull(requestBody.getContent().get(contentTypeValue).getExamples()) + && !requestBody.getContent().get(contentTypeValue).getExamples().isEmpty()); + } + + /** + * Extract example for given request body. + * + * @param requestBody + * @param contentTypeValue + * @param bodyOrFormParams + */ + private void extractRequestBodyExample(RequestBody requestBody, String contentTypeValue, + List bodyOrFormParams) { + + Optional> requestBodyExampleEntry = requestBody.getContent().get(contentTypeValue) + .getExamples().entrySet().stream().findFirst(); + + if (requestBodyExampleEntry.isPresent()) { + + Example requestBodyExample = requestBodyExampleEntry.get().getValue(); + + try { + JsonNode requestBodyExampleValueJsonNode = Json.mapper() + .readTree(String.valueOf(requestBodyExample.getValue())); + + Iterator> fields = requestBodyExampleValueJsonNode.fields(); + while (fields.hasNext()) { + Map.Entry fieldsEntry = fields.next(); + + JsonNode exampleValueAsJsonNode = fieldsEntry.getValue(); + + Parameter k6Parameter = new Parameter(fieldsEntry.getKey(), + exampleValueAsJsonNode.isNumber() ? exampleValueAsJsonNode.asText() + : exampleValueAsJsonNode.toString()); + + bodyOrFormParams.add(k6Parameter); + } + + } catch (JsonProcessingException e) { + LOGGER.error(e.getMessage(), e); + } + } + } + + /** + * Calculate order for this current request + * + * @param operationGroupingOrder + * @param requestsSize + * @return request order + */ + private Integer calculateRequestOrder(OptionalInt operationGroupingOrder, int requestsSize) { + int requestOrder; + + if (operationGroupingOrder.isPresent()) { + requestOrder = operationGroupingOrder.getAsInt() - 1; + + } else { + switch (requestsSize) { + case 0: + case 1: + requestOrder = requestsSize; + break; + + default: + requestOrder = (requestsSize - 1); + break; + } + } + + return requestOrder; + } + + // + /** + * Any variables not defined yet but used for subsequent data extraction must be + * initialized + * + * @param dataExtractSubstituteParams + * @param requestGroup + */ + private void initializeDataExtractSubstituteParameters( + Map dataExtractSubstituteParams, HTTPRequestGroup requestGroup) { + + if (!dataExtractSubstituteParams.isEmpty()) { + Set existingVariablesNames = requestGroup.variables.stream().map(v -> v.key) + .collect(Collectors.toSet()); + + Set initializeVariables = dataExtractSubstituteParams.values().stream() + .filter(p -> !existingVariablesNames.contains(toVarName(p.paramName))).collect(Collectors.toSet()); + + for (DataExtractSubstituteParameter initializeVariable : initializeVariables) { + requestGroup.variables.add(new Parameter(toVarName(initializeVariable.paramName), true)); + } + } + } + } diff --git a/modules/openapi-generator/src/main/resources/k6/script.mustache b/modules/openapi-generator/src/main/resources/k6/script.mustache index cac3381de0..ed5269a4fe 100644 --- a/modules/openapi-generator/src/main/resources/k6/script.mustache +++ b/modules/openapi-generator/src/main/resources/k6/script.mustache @@ -19,48 +19,50 @@ export default function() { let {{{key}}} = {{#lambda.handleParamValue}}{{value}}{{/lambda.handleParamValue}} {{/variables}} {{#requests}} - {{#-first}} - let url = BASE_URL + `{{{path}}}{{=<% %>=}}<%#query%><%#-first%>?<%/-first%><%& key%>=<%& value%><%^-last%>&<%/-last%><%/query%><%={{ }}=%>`; - // Request No. {{-index}} - {{#body}} - // TODO: edit the parameters of the request body. - let body = {{#body}}{{=<% %>=}}{<%#parameters%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/parameters%>}<%={{ }}=%>{{/body}}; - {{/body}} - {{#params}} - let params = {{#params}}{{=<% %>=}}{headers: {<%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%><%#responseType%>, "Accept": <%& responseType%><%/responseType%>}<%# auth%>, auth: "<%& auth%>"<%/auth%>}<%={{ }}=%>{{/params}}; - {{/params}} - let request = http.{{method}}(url{{#body}}, body{{/body}}{{#params}}, params{{/params}}); - {{#k6Checks}} - {{=<% %>=}} - check(request, { - "<%& description%>": (r) => r.status === <%& status%> - }); - <%={{ }}=%> - {{/k6Checks}} - {{/-first}} - {{^-first}} - // Request No. {{-index}} - {{#body}} - // TODO: edit the parameters of the request body. - body = {{#body}}{{=<% %>=}}{<%#parameters%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/parameters%>}<%={{ }}=%>{{/body}}; - {{/body}} - {{#params}} - params = {{#params}}{{=<% %>=}}{headers: {<%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%>}<%# auth%>, auth: "<%& auth%>"<%/auth%>}<%={{ }}=%>{{/params}}; - {{/params}} - request = http.{{method}}(url{{#body}}, body{{/body}}{{#params}}, params{{/params}}); - {{#k6Checks}} - {{=<% %>=}} - check(request, { - "<%& description%>": (r) => r.status === <%& status%> - }); - <%={{ }}=%> - {{/k6Checks}} - {{/-first}} - sleep(SLEEP_DURATION); - {{^-last}} - {{/-last}} + // Request No. {{-index}} + { + let url = BASE_URL + `{{{path}}}{{=<% %>=}}<%#query%><%#-first%>?<%/-first%><%& key%>=<%& value%><%^-last%>&<%/-last%><%/query%><%={{ }}=%>`; + {{#body}} + {{^hasBodyExample}} + // TODO: edit the parameters of the request body. + {{/hasBodyExample}} + let body = {{#body}}{{=<% %>=}}{<%#parameters%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/parameters%>}<%={{ }}=%>{{/body}}; + {{/body}} + {{#params}} + let params = {{#params}}{{=<% %>=}}{headers: {<%# headers%>"<%& key%>": <%& value%><%^-last%>, <%/-last%><%/headers%><%#responseType%>, "Accept": <%& responseType%><%/responseType%>}<%# auth%>, auth: "<%& auth%>"<%/auth%>}<%={{ }}=%>{{/params}}; + {{/params}} + {{#isDelete}} + {{#params}} + // this is a DELETE method request - if params are also set, empty body must be passed + let request = http.{{method}}(url, {} {{#params}}, params{{/params}}); + {{/params}} + {{^params}} + let request = http.{{method}}(url); + {{/params}} + {{/isDelete}} + {{^isDelete}} + let request = http.{{method}}(url{{#body}}, JSON.stringify(body){{/body}}{{#params}}, params{{/params}}); + {{/isDelete}} + + {{#k6Checks}} + {{=<% %>=}} + check(request, { + "<%& description%>": (r) => r.status === <%& status%> + }); + <%={{ }}=%> + {{/k6Checks}} + {{#dataExtract}} + + {{{paramName}}} = JSON.parse(request.body).{{{valuePath}}}; // extract data for subsequent use + {{/dataExtract}} + {{^-last}} + + sleep(SLEEP_DURATION); + {{/-last}} + } {{/requests}} }); + {{/requestGroups}} } diff --git a/pom.xml b/pom.xml index 999440c675..c96acc02e4 100644 --- a/pom.xml +++ b/pom.xml @@ -1545,6 +1545,7 @@ 1.4 2.11.0 3.12.0 + 1.9 1.3.0 1.0.2 4.9.10 diff --git a/samples/client/petstore/k6/.openapi-generator/FILES b/samples/client/petstore/k6/.openapi-generator/FILES new file mode 100644 index 0000000000..343cd1bd1f --- /dev/null +++ b/samples/client/petstore/k6/.openapi-generator/FILES @@ -0,0 +1,2 @@ +README.md +script.js diff --git a/samples/client/petstore/k6/.openapi-generator/VERSION b/samples/client/petstore/k6/.openapi-generator/VERSION index 4b448de535..4077803655 100644 --- a/samples/client/petstore/k6/.openapi-generator/VERSION +++ b/samples/client/petstore/k6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.0-SNAPSHOT \ No newline at end of file +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 6988d6417d..7ae1bf1453 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -1,204 +1,576 @@ /* * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * OpenAPI spec version: 1.0.0 * * NOTE: This class is auto generated by OpenAPI Generator. * https://github.com/OpenAPITools/openapi-generator * - * OpenAPI generator version: 5.3.0-SNAPSHOT + * OpenAPI generator version: 5.3.1-SNAPSHOT */ import http from "k6/http"; import { group, check, sleep } from "k6"; -const BASE_URL = "http://petstore.swagger.io/v2"; +const BASE_URL = "https://127.0.0.1/no_varaible"; // Sleep duration between successive requests. // You might want to edit the value of this variable or remove calls to the sleep function on the script. const SLEEP_DURATION = 0.1; // Global variables should be initialized. +let booleanGroup = "TODO_EDIT_THE_BOOLEAN_GROUP"; +let header1 = "TODO_EDIT_THE_HEADER_1"; let apiKey = "TODO_EDIT_THE_API_KEY"; +let requiredBooleanGroup = "TODO_EDIT_THE_REQUIRED_BOOLEAN_GROUP"; +let enumHeaderStringArray = "TODO_EDIT_THE_ENUM_HEADER_STRING_ARRAY"; +let enumHeaderString = "TODO_EDIT_THE_ENUM_HEADER_STRING"; export default function() { + group("/fake", () => { + let enumQueryInteger = 'TODO_EDIT_THE_ENUM_QUERY_INTEGER'; // specify value as there is no example value for this parameter in OpenAPI spec + let enumQueryString = 'TODO_EDIT_THE_ENUM_QUERY_STRING'; // specify value as there is no example value for this parameter in OpenAPI spec + let enumQueryStringArray = 'TODO_EDIT_THE_ENUM_QUERY_STRING_ARRAY'; // specify value as there is no example value for this parameter in OpenAPI spec + let enumQueryDouble = 'TODO_EDIT_THE_ENUM_QUERY_DOUBLE'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake?enum_query_string_array=${enum_query_string_array}&enum_query_string=${enum_query_string}&enum_query_integer=${enum_query_integer}&enum_query_double=${enum_query_double}`; + // TODO: edit the parameters of the request body. + let body = {"enumFormStringArray": "list", "enumFormString": "string"}; + let params = {headers: {"Content-Type": "application/x-www-form-urlencoded", "enum_header_string_array": `${enumHeaderStringArray}`, "enum_header_string": `${enumHeaderString}`, "Accept": "application/json"}}; + let request = http.get(url, JSON.stringify(body), params); + + + sleep(SLEEP_DURATION); + } + + // Request No. 2 + { + let url = BASE_URL + `/fake`; + // TODO: edit the parameters of the request body. + let body = {"client": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.patch(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/outer/boolean", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/outer/boolean`; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, params); + + check(request, { + "Output boolean": (r) => r.status === 200 + }); + } + }); + + group("/another-fake/dummy", () => { + + // Request No. 1 + { + let url = BASE_URL + `/another-fake/dummy`; + // TODO: edit the parameters of the request body. + let body = {"client": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.patch(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + group("/pet", () => { - let url = BASE_URL + `/pet`; + // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "list", "tags": [{"id": "long", "name": "string"}], "status": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.put(url, body, params); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/pet`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.put(url, JSON.stringify(body), params); + + check(request, { + "Successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "list", "tags": [{"id": "long", "name": "string"}], "status": "string"}; - params = {headers: {"Content-Type": "application/json"}}; - request = http.post(url, body, params); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/pet`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "Successful operation": (r) => r.status === 200 + }); + } }); - group("/pet/findByStatus", () => { - let status = 'TODO_EDIT_THE_STATUS'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/findByStatus?status=${status}`; + + group("/user/{username}", () => { + let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/pet/findByTags", () => { - let tags = 'TODO_EDIT_THE_TAGS'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/findByTags?tags=${tags}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/pet/{petId}", () => { - let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/${petId}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/${username}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"name": "string", "status": "string"}; - params = {headers: {"Content-Type": "application/x-www-form-urlencoded"}}; - request = http.post(url, body, params); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/${username}`; + let request = http.del(url); - // Request No. 3 - params = {headers: {"api_key": `${apiKey}`}}; - request = http.del(url, params); - sleep(SLEEP_DURATION); + } }); - group("/pet/{petId}/uploadImage", () => { - let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/pet/${petId}/uploadImage`; - // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"additionalMetadata": "string", "file": http.file(open("/path/to/file.bin", "b"), "test.bin")}; - let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/inventory", () => { - let url = BASE_URL + `/store/inventory`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/order", () => { - let url = BASE_URL + `/store/order`; - // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "petId": "long", "quantity": "integer", "shipDate": "date", "status": "string", "complete": "boolean"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/order/{orderId}", () => { - let orderId = 'TODO_EDIT_THE_ORDERID'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/store/order/${orderId}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - // Request No. 2 - request = http.del(url); - sleep(SLEEP_DURATION); - }); - group("/user", () => { - let url = BASE_URL + `/user`; + group("/fake/body-with-binary", () => { + // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/body-with-binary`; + let params = {headers: {"Content-Type": "image/png", "Accept": "application/json"}}; + let request = http.put(url, params); + + check(request, { + "Success": (r) => r.status === 200 + }); + } }); - group("/user/createWithArray", () => { - let url = BASE_URL + `/user/createWithArray`; + + group("/fake_classname_test", () => { + // Request No. 1 - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake_classname_test`; + // TODO: edit the parameters of the request body. + let body = {"client": "string"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.patch(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); + group("/user/createWithList", () => { - let url = BASE_URL + `/user/createWithList`; + // Request No. 1 - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/createWithList`; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); + + group("/fake/inline-additionalProperties", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/inline-additionalProperties`; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/store/inventory", () => { + + // Request No. 1 + { + let url = BASE_URL + `/store/inventory`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + group("/user/login", () => { let password = 'TODO_EDIT_THE_PASSWORD'; // specify value as there is no example value for this parameter in OpenAPI spec let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/user/login?username=${username}&password=${password}`; + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/user/login?username=${username}&password=${password}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } }); - group("/user/logout", () => { - let url = BASE_URL + `/user/logout`; + + group("/fake/outer/composite", () => { + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/outer/composite`; + // TODO: edit the parameters of the request body. + let body = {"myNumber": "bigdecimal", "myString": "string", "myBoolean": "boolean"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "Output composite": (r) => r.status === 200 + }); + } }); - group("/user/{username}", () => { - let username = 'TODO_EDIT_THE_USERNAME'; // specify value as there is no example value for this parameter in OpenAPI spec - let url = BASE_URL + `/user/${username}`; + + group("/fake/jsonFormData", () => { + // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/fake/jsonFormData`; + // TODO: edit the parameters of the request body. + let body = {"param": "string", "param2": "string"}; + let params = {headers: {"Content-Type": "application/x-www-form-urlencoded", "Accept": "application/json"}}; + let request = http.get(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/{petId}/uploadImageWithRequiredFile", () => { + let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake/${petId}/uploadImageWithRequiredFile`; + // TODO: edit the parameters of the request body. + let body = {"additionalMetadata": "string", "requiredFile": http.file(open("/path/to/file.bin", "b"), "test.bin")}; + let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/pet/{petId}", () => { + let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/pet/${petId}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - params = {headers: {"Content-Type": "application/json"}}; - request = http.put(url, body, params); - sleep(SLEEP_DURATION); + { + let url = BASE_URL + `/pet/${petId}`; + let params = {headers: {"api_key": `${apiKey}`, "Accept": "application/json"}}; + // this is a DELETE method request - if params are also set, empty body must be passed + let request = http.del(url, {} , params); - // Request No. 3 - request = http.del(url); - sleep(SLEEP_DURATION); + check(request, { + "Successful operation": (r) => r.status === 200 + }); + } }); + + group("/foo", () => { + + // Request No. 1 + { + let url = BASE_URL + `/foo`; + let request = http.get(url); + + check(request, { + "response": (r) => r.status === 200 + }); + } + }); + + group("/fake/outer/string", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/outer/string`; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, params); + + check(request, { + "Output string": (r) => r.status === 200 + }); + } + }); + + group("/fake/test-query-parameters", () => { + let allowEmpty = 'TODO_EDIT_THE_ALLOWEMPTY'; // specify value as there is no example value for this parameter in OpenAPI spec + let ioutil = 'TODO_EDIT_THE_IOUTIL'; // specify value as there is no example value for this parameter in OpenAPI spec + let context = 'TODO_EDIT_THE_CONTEXT'; // specify value as there is no example value for this parameter in OpenAPI spec + let http = 'TODO_EDIT_THE_HTTP'; // specify value as there is no example value for this parameter in OpenAPI spec + let pipe = 'TODO_EDIT_THE_PIPE'; // specify value as there is no example value for this parameter in OpenAPI spec + let language = 'TODO_EDIT_THE_LANGUAGE'; // specify value as there is no example value for this parameter in OpenAPI spec + let url = 'TODO_EDIT_THE_URL'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake/test-query-parameters?pipe=${pipe}&ioutil=${ioutil}&http=${http}&url=${url}&context=${context}&language=${language}&allowEmpty=${allowEmpty}`; + let request = http.put(url); + + check(request, { + "Success": (r) => r.status === 200 + }); + } + }); + + group("/store/order/{order_id}", () => { + let orderId = 'TODO_EDIT_THE_ORDER_ID'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/store/order/${order_id}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + + sleep(SLEEP_DURATION); + } + + // Request No. 2 + { + let url = BASE_URL + `/store/order/${order_id}`; + let request = http.del(url); + + } + }); + + group("/pet/findByStatus", () => { + let status = 'TODO_EDIT_THE_STATUS'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/pet/findByStatus?status=${status}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/body-with-query-params", () => { + let query = 'TODO_EDIT_THE_QUERY'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake/body-with-query-params?query=${query}`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.put(url, JSON.stringify(body), params); + + check(request, { + "Success": (r) => r.status === 200 + }); + } + }); + + group("/pet/{petId}/uploadImage", () => { + let petId = 'TODO_EDIT_THE_PETID'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/pet/${petId}/uploadImage`; + // TODO: edit the parameters of the request body. + let body = {"additionalMetadata": "string", "file": http.file(open("/path/to/file.bin", "b"), "test.bin")}; + let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/http-signature-test", () => { + let query1 = 'TODO_EDIT_THE_QUERY_1'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/fake/http-signature-test?query_1=${query_1}`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "set", "tags": "list", "status": "string"}; + let params = {headers: {"Content-Type": "application/json", "header_1": `${header1}`, "Accept": "application/json"}}; + let request = http.get(url, JSON.stringify(body), params); + + check(request, { + "The instance started successfully": (r) => r.status === 200 + }); + } + }); + + group("/user", () => { + + // Request No. 1 + { + let url = BASE_URL + `/user`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/property/enum-int", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/property/enum-int`; + // TODO: edit the parameters of the request body. + let body = {"value": "outerenuminteger"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "Output enum (int)": (r) => r.status === 200 + }); + } + }); + + group("/user/createWithArray", () => { + + // Request No. 1 + { + let url = BASE_URL + `/user/createWithArray`; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/body-with-file-schema", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/body-with-file-schema`; + // TODO: edit the parameters of the request body. + let body = {"file": http.file(open("/path/to/file.bin", "b"), "test.bin"), "files": "list"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.put(url, JSON.stringify(body), params); + + check(request, { + "Success": (r) => r.status === 200 + }); + } + }); + + group("/pet/findByTags", () => { + let tags = 'TODO_EDIT_THE_TAGS'; // specify value as there is no example value for this parameter in OpenAPI spec + + // Request No. 1 + { + let url = BASE_URL + `/pet/findByTags?tags=${tags}`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/store/order", () => { + + // Request No. 1 + { + let url = BASE_URL + `/store/order`; + // TODO: edit the parameters of the request body. + let body = {"id": "long", "petId": "long", "quantity": "integer", "shipDate": "date", "status": "string", "complete": "boolean"}; + let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; + let request = http.post(url, JSON.stringify(body), params); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/user/logout", () => { + + // Request No. 1 + { + let url = BASE_URL + `/user/logout`; + let request = http.get(url); + + check(request, { + "successful operation": (r) => r.status === 200 + }); + } + }); + + group("/fake/health", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/health`; + let request = http.get(url); + + check(request, { + "The instance started successfully": (r) => r.status === 200 + }); + } + }); + + group("/fake/outer/number", () => { + + // Request No. 1 + { + let url = BASE_URL + `/fake/outer/number`; + let params = {headers: {"Content-Type": "application/json", "Accept": "*/*"}}; + let request = http.post(url, params); + + check(request, { + "Output number": (r) => r.status === 200 + }); + } + }); + } From 42d635b463f1b3795535c73d0867635e74c22181 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Fri, 17 Dec 2021 02:19:41 +0000 Subject: [PATCH 28/54] [swift5][client] improve code formatting (#11124) * [swift][client] improve code formatting with multiple response as * [kotlin][vertx] update sample project --- .../src/main/resources/swift5/api.mustache | 13 ++++--- .../PetstoreClient/APIs/AnotherFakeAPI.swift | 1 - .../Sources/PetstoreClient/APIs/FakeAPI.swift | 14 -------- .../APIs/FakeClassnameTags123API.swift | 1 - .../Sources/PetstoreClient/APIs/PetAPI.swift | 9 ----- .../PetstoreClient/APIs/StoreAPI.swift | 4 --- .../Sources/PetstoreClient/APIs/UserAPI.swift | 8 ----- .../server/api/model/ApiResponse.kt | 34 ------------------- 8 files changed, 9 insertions(+), 75 deletions(-) delete mode 100644 samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index 2351c74fd9..e5cd7ea449 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -23,9 +23,9 @@ extension {{projectName}}API { /** {{{.}}} */{{/description}} {{#objcCompatible}}@objc {{/objcCompatible}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class {{classname}}{{#objcCompatible}} : NSObject{{/objcCompatible}} { {{#operation}} - {{#allParams}} {{#isEnum}} + /** * enum for parameter {{paramName}} */ @@ -36,7 +36,6 @@ extension {{projectName}}API { {{/enumVars}} {{/allowableValues}} } - {{/isEnum}} {{/allParams}} {{^useVapor}} @@ -45,6 +44,7 @@ extension {{projectName}}API { {{^useResult}} {{^useCombine}} {{^useAsyncAwait}} + /** {{#summary}} {{{.}}} @@ -80,6 +80,7 @@ extension {{projectName}}API { {{/usePromiseKit}} {{/useVapor}} {{#usePromiseKit}} + /** {{#summary}} {{{.}}} @@ -111,6 +112,7 @@ extension {{projectName}}API { } {{/usePromiseKit}} {{#useRxSwift}} + /** {{#summary}} {{{.}}} @@ -147,6 +149,7 @@ extension {{projectName}}API { } {{/useRxSwift}} {{#useCombine}} + /** {{#summary}} {{{.}}} @@ -186,6 +189,7 @@ extension {{projectName}}API { #endif {{/useCombine}} {{#useAsyncAwait}} + /** {{#summary}} {{{.}}} @@ -229,6 +233,7 @@ extension {{projectName}}API { } {{/useAsyncAwait}} {{#useResult}} + /** {{#summary}} {{{.}}} @@ -241,7 +246,7 @@ extension {{projectName}}API { @available(*, deprecated, message: "This operation is deprecated.") {{/isDeprecated}} @discardableResult - open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}open{{/nonPublicApi}} class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}[{{enumName}}_{{operationId}}]{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{^-last}}, {{/-last}}{{/allParams}}{{#hasParams}}, {{/hasParams}}apiResponseQueue: DispatchQueue = {{projectName}}API.apiResponseQueue, completion: @escaping ((_ result: Swift.Result<{{{returnType}}}{{^returnType}}Void{{/returnType}}, ErrorResponse>) -> Void)) -> RequestTask { return {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).execute(apiResponseQueue) { result in switch result { {{#returnType}} @@ -259,6 +264,7 @@ extension {{projectName}}API { } {{/useResult}} {{#useVapor}} + /** {{#summary}} {{{.}}} @@ -380,7 +386,6 @@ extension {{projectName}}API { } } } - {{/useVapor}} {{^useVapor}} diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift index 78cd04bd6b..85f7cf3511 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/AnotherFakeAPI.swift @@ -60,5 +60,4 @@ open class AnotherFakeAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift index 144a6d4e68..014da83783 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeAPI.swift @@ -61,7 +61,6 @@ open class FakeAPI { } } - /** POST /fake/outer/boolean Test serialization of outer boolean types @@ -110,7 +109,6 @@ open class FakeAPI { } } - /** POST /fake/outer/composite Test serialization of object with outer number type @@ -159,7 +157,6 @@ open class FakeAPI { } } - /** POST /fake/outer/number Test serialization of outer number types @@ -208,7 +205,6 @@ open class FakeAPI { } } - /** POST /fake/outer/string Test serialization of outer string types @@ -257,7 +253,6 @@ open class FakeAPI { } } - /** PUT /fake/body-with-file-schema For this test, the body for this request much reference a schema named `File`. @@ -304,7 +299,6 @@ open class FakeAPI { } } - /** PUT /fake/body-with-query-params - parameter query: (query) @@ -358,7 +352,6 @@ open class FakeAPI { } } - /** To test \"client\" model PATCH /fake @@ -407,7 +400,6 @@ open class FakeAPI { } } - /** Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 POST /fake @@ -507,7 +499,6 @@ open class FakeAPI { } } - /** * enum for parameter enumHeaderStringArray */ @@ -661,7 +652,6 @@ open class FakeAPI { } } - /** Fake endpoint to test group parameters (optional) DELETE /fake @@ -736,7 +726,6 @@ open class FakeAPI { } } - /** test inline additionalProperties POST /fake/inline-additionalProperties @@ -783,7 +772,6 @@ open class FakeAPI { } } - /** test json serialization of form data GET /fake/jsonFormData @@ -836,7 +824,6 @@ open class FakeAPI { } } - /** PUT /fake/test-query-parameters To test the collection format in query parameters @@ -904,5 +891,4 @@ open class FakeAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift index 0a10495252..e8ad26cffe 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/FakeClassnameTags123API.swift @@ -66,5 +66,4 @@ open class FakeClassnameTags123API { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift index e07bf6753d..5e80152150 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/PetAPI.swift @@ -68,7 +68,6 @@ open class PetAPI { } } - /** Deletes a pet DELETE /pet/{petId} @@ -130,7 +129,6 @@ open class PetAPI { } } - /** * enum for parameter status */ @@ -203,7 +201,6 @@ open class PetAPI { } } - /** Finds Pets by tags GET /pet/findByTags @@ -269,7 +266,6 @@ open class PetAPI { } } - /** Find pet by ID GET /pet/{petId} @@ -332,7 +328,6 @@ open class PetAPI { } } - /** Update an existing pet PUT /pet @@ -394,7 +389,6 @@ open class PetAPI { } } - /** Updates a pet in the store with form data POST /pet/{petId} @@ -458,7 +452,6 @@ open class PetAPI { } } - /** uploads an image POST /pet/{petId}/uploadImage @@ -522,7 +515,6 @@ open class PetAPI { } } - /** uploads an image (required) POST /fake/{petId}/uploadImageWithRequiredFile @@ -585,5 +577,4 @@ open class PetAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift index 6c3358a616..d802c4c765 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/StoreAPI.swift @@ -66,7 +66,6 @@ open class StoreAPI { } } - /** Returns pet inventories by status GET /store/inventory @@ -118,7 +117,6 @@ open class StoreAPI { } } - /** Find purchase order by ID GET /store/order/{order_id} @@ -175,7 +173,6 @@ open class StoreAPI { } } - /** Place an order for a pet POST /store/order @@ -224,5 +221,4 @@ open class StoreAPI { } } } - } diff --git a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift index e71a3ee7bf..1832059076 100644 --- a/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift +++ b/samples/client/petstore/swift5/vaporLibrary/Sources/PetstoreClient/APIs/UserAPI.swift @@ -58,7 +58,6 @@ open class UserAPI { } } - /** Creates list of users with given input array POST /user/createWithArray @@ -102,7 +101,6 @@ open class UserAPI { } } - /** Creates list of users with given input array POST /user/createWithList @@ -146,7 +144,6 @@ open class UserAPI { } } - /** Delete user DELETE /user/{username} @@ -200,7 +197,6 @@ open class UserAPI { } } - /** Get user by user name GET /user/{username} @@ -255,7 +251,6 @@ open class UserAPI { } } - /** Logs user into the system GET /user/login @@ -317,7 +312,6 @@ open class UserAPI { } } - /** Logs out current logged in user session GET /user/logout @@ -358,7 +352,6 @@ open class UserAPI { } } - /** Updated user PUT /user/{username} @@ -414,5 +407,4 @@ open class UserAPI { } } } - } diff --git a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt b/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt deleted file mode 100644 index 223e80919a..0000000000 --- a/samples/server/petstore/kotlin/vertx/src/main/kotlin/org/openapitools/server/api/model/ApiResponse.kt +++ /dev/null @@ -1,34 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.server.api.model - - - -import com.google.gson.annotations.SerializedName -import com.fasterxml.jackson.annotation.JsonIgnoreProperties -import com.fasterxml.jackson.annotation.JsonInclude -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ -@JsonInclude(JsonInclude.Include.NON_NULL) -@JsonIgnoreProperties(ignoreUnknown = true) -data class ApiResponse ( - var code: kotlin.Int? = null, - var type: kotlin.String? = null, - var message: kotlin.String? = null -) { - -} - From 80d1eedc20383d6080bd96900598bcd9fd91e9f9 Mon Sep 17 00:00:00 2001 From: Samuel Nelson Date: Fri, 17 Dec 2021 15:20:26 +1300 Subject: [PATCH 29/54] Fix deprecation issue since akka-http 2.6 (#11048) --- .../src/main/resources/scala-akka-client/apiInvoker.mustache | 4 ++-- .../main/scala/org/openapitools/client/core/ApiInvoker.scala | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache b/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache index f9dd5c19b8..ae815e21c6 100644 --- a/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache +++ b/modules/openapi-generator/src/main/resources/scala-akka-client/apiInvoker.mustache @@ -11,7 +11,7 @@ import akka.http.scaladsl.model.Uri.Query import akka.http.scaladsl.model._ import akka.http.scaladsl.model.headers._ import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller } -import akka.stream.ActorMaterializer +import akka.stream.Materializer import akka.stream.scaladsl.Source import akka.util.{ ByteString, Timeout } import de.heikoseeberger.akkahttpjson4s.Json4sSupport @@ -81,7 +81,7 @@ class ApiInvoker(formats: Formats)(implicit system: ActorSystem) extends CustomC protected val settings: ApiSettings = ApiSettings(system) - private implicit val materializer: ActorMaterializer = ActorMaterializer() + private implicit val materializer: Materializer = Materializer(system) private implicit val serialization: Serialization = jackson.Serialization diff --git a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala index 74575e12cd..4b28ea9862 100644 --- a/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala +++ b/samples/client/petstore/scala-akka/src/main/scala/org/openapitools/client/core/ApiInvoker.scala @@ -21,7 +21,7 @@ import akka.http.scaladsl.model.Uri.Query import akka.http.scaladsl.model._ import akka.http.scaladsl.model.headers._ import akka.http.scaladsl.unmarshalling.{ Unmarshal, Unmarshaller } -import akka.stream.ActorMaterializer +import akka.stream.Materializer import akka.stream.scaladsl.Source import akka.util.{ ByteString, Timeout } import de.heikoseeberger.akkahttpjson4s.Json4sSupport @@ -91,7 +91,7 @@ class ApiInvoker(formats: Formats)(implicit system: ActorSystem) extends CustomC protected val settings: ApiSettings = ApiSettings(system) - private implicit val materializer: ActorMaterializer = ActorMaterializer() + private implicit val materializer: Materializer = Materializer(system) private implicit val serialization: Serialization = jackson.Serialization From 6f6d4f8c02fd459de5aaee4755f64d0f82dedc9e Mon Sep 17 00:00:00 2001 From: Josh Burton Date: Fri, 17 Dec 2021 15:36:42 +1300 Subject: [PATCH 30/54] [dart-dio-next] Removes dioLibrary option (#10931) As there is no longer a fork of the dio library this option can be removed --- ...ext-dio-http-petstore-client-lib-fake.yaml | 11 - docs/generators/dart-dio-next.md | 1 - .../languages/DartDioNextClientCodegen.java | 54 +- .../resources/dart/libraries/dio/api.mustache | 2 +- .../dart/libraries/dio/api_client.mustache | 2 +- .../libraries/dio/auth/api_key_auth.mustache | 2 +- .../dart/libraries/dio/auth/auth.mustache | 2 +- .../libraries/dio/auth/basic_auth.mustache | 2 +- .../libraries/dio/auth/bearer_auth.mustache | 2 +- .../dart/libraries/dio/auth/oauth.mustache | 2 +- .../dart/libraries/dio/pubspec.mustache | 5 - .../built_value/api_util.mustache | 4 +- .../dio/DartDioNextClientCodegenTest.java | 20 - .../dio/DartDioNextClientOptionsTest.java | 1 - .../DartDioNextClientOptionsProvider.java | 1 - pom.xml | 1 - .../.gitignore | 41 - .../.openapi-generator-ignore | 23 - .../.openapi-generator/FILES | 121 -- .../.openapi-generator/VERSION | 1 - .../README.md | 200 --- .../analysis_options.yaml | 9 - .../doc/AdditionalPropertiesClass.md | 16 - .../doc/Animal.md | 16 - .../doc/AnotherFakeApi.md | 57 - .../doc/ApiResponse.md | 17 - .../doc/ArrayOfArrayOfNumberOnly.md | 15 - .../doc/ArrayOfNumberOnly.md | 15 - .../doc/ArrayTest.md | 17 - .../doc/Capitalization.md | 20 - .../doc/Cat.md | 17 - .../doc/CatAllOf.md | 15 - .../doc/Category.md | 16 - .../doc/ClassModel.md | 15 - .../doc/DefaultApi.md | 51 - .../doc/DeprecatedObject.md | 15 - .../doc/Dog.md | 17 - .../doc/DogAllOf.md | 15 - .../doc/EnumArrays.md | 16 - .../doc/EnumTest.md | 22 - .../doc/FakeApi.md | 816 ---------- .../doc/FakeClassnameTags123Api.md | 61 - .../doc/FileSchemaTestClass.md | 16 - .../doc/Foo.md | 15 - .../doc/FormatTest.md | 30 - .../doc/HasOnlyReadOnly.md | 16 - .../doc/HealthCheckResult.md | 15 - .../doc/InlineResponseDefault.md | 15 - .../doc/MapTest.md | 18 - ...dPropertiesAndAdditionalPropertiesClass.md | 17 - .../doc/Model200Response.md | 16 - .../doc/ModelClient.md | 15 - .../doc/ModelEnumClass.md | 14 - .../doc/ModelFile.md | 15 - .../doc/ModelList.md | 15 - .../doc/ModelReturn.md | 15 - .../doc/Name.md | 18 - .../doc/NullableClass.md | 26 - .../doc/NumberOnly.md | 15 - .../doc/ObjectWithDeprecatedFields.md | 18 - .../doc/Order.md | 20 - .../doc/OuterComposite.md | 17 - .../doc/OuterEnum.md | 14 - .../doc/OuterEnumDefaultValue.md | 14 - .../doc/OuterEnumInteger.md | 14 - .../doc/OuterEnumIntegerDefaultValue.md | 14 - .../doc/OuterObjectWithEnumProperty.md | 15 - .../doc/Pet.md | 20 - .../doc/PetApi.md | 427 ----- .../doc/ReadOnlyFirst.md | 16 - .../doc/SpecialModelName.md | 15 - .../doc/StoreApi.md | 186 --- .../doc/Tag.md | 16 - .../doc/User.md | 22 - .../doc/UserApi.md | 349 ---- .../lib/openapi.dart | 65 - .../lib/src/api.dart | 115 -- .../lib/src/api/another_fake_api.dart | 113 -- .../lib/src/api/default_api.dart | 92 -- .../lib/src/api/fake_api.dart | 1417 ----------------- .../src/api/fake_classname_tags123_api.dart | 120 -- .../lib/src/api/pet_api.dart | 755 --------- .../lib/src/api/store_api.dart | 314 ---- .../lib/src/api/user_api.dart | 532 ------- .../lib/src/api_util.dart | 78 - .../lib/src/auth/api_key_auth.dart | 30 - .../lib/src/auth/auth.dart | 18 - .../lib/src/auth/basic_auth.dart | 37 - .../lib/src/auth/bearer_auth.dart | 26 - .../lib/src/auth/oauth.dart | 26 - .../lib/src/date_serializer.dart | 31 - .../model/additional_properties_class.dart | 87 - .../lib/src/model/animal.dart | 85 - .../lib/src/model/api_response.dart | 101 -- .../model/array_of_array_of_number_only.dart | 72 - .../lib/src/model/array_of_number_only.dart | 72 - .../lib/src/model/array_test.dart | 103 -- .../lib/src/model/capitalization.dart | 147 -- .../lib/src/model/cat.dart | 104 -- .../lib/src/model/cat_all_of.dart | 71 - .../lib/src/model/category.dart | 85 - .../lib/src/model/class_model.dart | 71 - .../lib/src/model/date.dart | 70 - .../lib/src/model/deprecated_object.dart | 71 - .../lib/src/model/dog.dart | 104 -- .../lib/src/model/dog_all_of.dart | 71 - .../lib/src/model/enum_arrays.dart | 119 -- .../lib/src/model/enum_test.dart | 252 --- .../lib/src/model/file_schema_test_class.dart | 88 - .../lib/src/model/foo.dart | 72 - .../lib/src/model/format_test.dart | 292 ---- .../lib/src/model/has_only_read_only.dart | 86 - .../lib/src/model/health_check_result.dart | 72 - .../src/model/inline_response_default.dart | 72 - .../lib/src/model/map_test.dart | 133 -- ...rties_and_additional_properties_class.dart | 103 -- .../lib/src/model/model200_response.dart | 86 - .../lib/src/model/model_client.dart | 71 - .../lib/src/model/model_enum_class.dart | 35 - .../lib/src/model/model_file.dart | 72 - .../lib/src/model/model_list.dart | 71 - .../lib/src/model/model_return.dart | 71 - .../lib/src/model/name.dart | 114 -- .../lib/src/model/nullable_class.dart | 249 --- .../lib/src/model/number_only.dart | 71 - .../model/object_with_deprecated_fields.dart | 118 -- .../lib/src/model/order.dart | 170 -- .../lib/src/model/outer_composite.dart | 101 -- .../lib/src/model/outer_enum.dart | 35 - .../src/model/outer_enum_default_value.dart | 35 - .../lib/src/model/outer_enum_integer.dart | 35 - .../outer_enum_integer_default_value.dart | 35 - .../outer_object_with_enum_property.dart | 71 - .../lib/src/model/pet.dart | 167 -- .../lib/src/model/read_only_first.dart | 86 - .../lib/src/model/special_model_name.dart | 71 - .../lib/src/model/tag.dart | 86 - .../lib/src/model/user.dart | 177 -- .../lib/src/serializers.dart | 146 -- .../dio_http_petstore_client_lib_fake/pom.xml | 88 - .../pubspec.yaml | 17 - .../additional_properties_class_test.dart | 21 - .../test/animal_test.dart | 21 - .../test/another_fake_api_test.dart | 20 - .../test/api_response_test.dart | 26 - .../array_of_array_of_number_only_test.dart | 16 - .../test/array_of_number_only_test.dart | 16 - .../test/array_test_test.dart | 26 - .../test/capitalization_test.dart | 42 - .../test/cat_all_of_test.dart | 16 - .../test/cat_test.dart | 26 - .../test/category_test.dart | 21 - .../test/class_model_test.dart | 16 - .../test/default_api_test.dart | 16 - .../test/deprecated_object_test.dart | 16 - .../test/dog_all_of_test.dart | 16 - .../test/dog_test.dart | 26 - .../test/enum_arrays_test.dart | 21 - .../test/enum_test_test.dart | 51 - .../test/fake_api_test.dart | 136 -- .../test/fake_classname_tags123_api_test.dart | 20 - .../test/file_schema_test_class_test.dart | 21 - .../test/foo_test.dart | 16 - .../test/format_test_test.dart | 93 -- .../test/has_only_read_only_test.dart | 21 - .../test/health_check_result_test.dart | 16 - .../test/inline_response_default_test.dart | 16 - .../test/map_test_test.dart | 31 - ..._and_additional_properties_class_test.dart | 26 - .../test/model200_response_test.dart | 21 - .../test/model_client_test.dart | 16 - .../test/model_enum_class_test.dart | 9 - .../test/model_file_test.dart | 17 - .../test/model_list_test.dart | 16 - .../test/model_return_test.dart | 16 - .../test/name_test.dart | 31 - .../test/nullable_class_test.dart | 71 - .../test/number_only_test.dart | 16 - .../object_with_deprecated_fields_test.dart | 31 - .../test/order_test.dart | 42 - .../test/outer_composite_test.dart | 26 - .../test/outer_enum_default_value_test.dart | 9 - ...outer_enum_integer_default_value_test.dart | 9 - .../test/outer_enum_integer_test.dart | 9 - .../test/outer_enum_test.dart | 9 - .../outer_object_with_enum_property_test.dart | 16 - .../test/pet_api_test.dart | 80 - .../test/pet_test.dart | 42 - .../test/read_only_first_test.dart | 21 - .../test/special_model_name_test.dart | 16 - .../test/store_api_test.dart | 45 - .../test/tag_test.dart | 21 - .../test/user_api_test.dart | 73 - .../test/user_test.dart | 52 - 194 files changed, 12 insertions(+), 13385 deletions(-) delete mode 100644 bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart delete mode 100644 samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart diff --git a/bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml b/bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml deleted file mode 100644 index eb33c1a7f2..0000000000 --- a/bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: dart-dio-next -outputDir: samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio -typeMappings: - Client: "ModelClient" - File: "ModelFile" - EnumClass: "ModelEnumClass" -additionalProperties: - hideGenerationTimestamp: "true" - dioLibrary: "dio_http" diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index ac9d15dc06..d644e35b04 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -9,7 +9,6 @@ These options may be applied as additional-properties (cli) or configOptions (pl | ------ | ----------- | ------ | ------- | |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |dateLibrary|Specify Date library|
          **core**
          [DEFAULT] Dart core library (DateTime)
          **timemachine**
          Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
          |core| -|dioLibrary|Specify Dio library|
          **dio_http**
          dio_http 5.x
          **dio**
          [DEFAULT] dio 4.x
          |dio| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java index 0632215212..5b9f96a216 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/DartDioNextClientCodegen.java @@ -39,11 +39,6 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { private final Logger LOGGER = LoggerFactory.getLogger(DartDioNextClientCodegen.class); - public static final String DIO_LIBRARY = "dioLibrary"; - public static final String DIO_ORIGINAL = "dio"; - public static final String DIO_HTTP = "dio_http"; - public static final String DIO_LIBRARY_DEFAULT = DIO_ORIGINAL; - public static final String DATE_LIBRARY = "dateLibrary"; public static final String DATE_LIBRARY_CORE = "core"; public static final String DATE_LIBRARY_TIME_MACHINE = "timemachine"; @@ -52,13 +47,11 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { public static final String SERIALIZATION_LIBRARY_BUILT_VALUE = "built_value"; public static final String SERIALIZATION_LIBRARY_DEFAULT = SERIALIZATION_LIBRARY_BUILT_VALUE; + private static final String DIO_IMPORT = "package:dio/dio.dart"; private static final String CLIENT_NAME = "clientName"; private String dateLibrary; - private String dioLibrary; - private String dioImport; - private String clientName; public DartDioNextClientCodegen() { @@ -87,7 +80,6 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { serializationLibrary.setDefault(SERIALIZATION_LIBRARY_DEFAULT); cliOptions.add(serializationLibrary); - // Date Library Option final CliOption dateOption = CliOption.newString(DATE_LIBRARY, "Specify Date library"); dateOption.setDefault(DATE_LIBRARY_DEFAULT); @@ -96,16 +88,6 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { dateOptions.put(DATE_LIBRARY_TIME_MACHINE, "Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing."); dateOption.setEnum(dateOptions); cliOptions.add(dateOption); - - // Dio Library Option - final CliOption dioOption = CliOption.newString(DIO_LIBRARY, "Specify Dio library"); - dioOption.setDefault(DIO_LIBRARY_DEFAULT); - - final Map dioOptions = new HashMap<>(); - dioOptions.put(DIO_ORIGINAL, "[DEFAULT] dio 4.x"); - dioOptions.put(DIO_HTTP, "dio_http 5.x"); - dioOption.setEnum(dioOptions); - cliOptions.add(dioOption); } public String getDateLibrary() { @@ -116,14 +98,6 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { this.dateLibrary = library; } - public String getDioLibrary() { - return dioLibrary; - } - - public void setDioLibrary(String library) { - this.dioLibrary = library; - } - public String getClientName() { return clientName; } @@ -163,12 +137,6 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { } setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); - if (!additionalProperties.containsKey(DIO_LIBRARY)) { - additionalProperties.put(DIO_LIBRARY, DIO_LIBRARY_DEFAULT); - LOGGER.debug("Dio library not set, using default {}", DIO_LIBRARY_DEFAULT); - } - setDioLibrary(additionalProperties.get(DIO_LIBRARY).toString()); - if (!additionalProperties.containsKey(CLIENT_NAME)) { final String name = org.openapitools.codegen.utils.StringUtils.camelize(pubName); additionalProperties.put(CLIENT_NAME, name); @@ -194,31 +162,15 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { supportingFiles.add(new SupportingFile("auth/oauth.mustache", authFolder, "oauth.dart")); supportingFiles.add(new SupportingFile("auth/auth.mustache", authFolder, "auth.dart")); - configureDioLibrary(); configureSerializationLibrary(srcFolder); configureDateLibrary(srcFolder); } - private void configureDioLibrary() { - switch (dioLibrary) { - case DIO_HTTP: - dioImport = "package:dio_http/dio_http.dart"; - break; - case DIO_ORIGINAL: - default: - dioImport = "package:dio/dio.dart"; - break; - } - } - private void configureSerializationLibrary(String srcFolder) { switch (library) { default: case SERIALIZATION_LIBRARY_BUILT_VALUE: additionalProperties.put("useBuiltValue", "true"); - additionalProperties.put("useDioHttp", dioLibrary.equals(DIO_HTTP)); - additionalProperties.put("dioImport", dioImport); - additionalProperties.put("dioLibrary", dioLibrary); configureSerializationLibraryBuiltValue(srcFolder); break; } @@ -243,7 +195,7 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { imports.put("BuiltMap", "package:built_collection/built_collection.dart"); imports.put("JsonObject", "package:built_value/json_object.dart"); imports.put("Uint8List", "dart:typed_data"); - imports.put("MultipartFile", dioImport); + imports.put("MultipartFile", DIO_IMPORT); } private void configureDateLibrary(String srcFolder) { @@ -442,7 +394,7 @@ public class DartDioNextClientCodegen extends AbstractDartCodegen { for (String modelImport : originalImports) { if (imports.containsKey(modelImport)) { String i = imports.get(modelImport); - if (Objects.equals(i, dioImport) && !isModel) { + if (Objects.equals(i, DIO_IMPORT) && !isModel) { // Don't add imports to operations that are already imported continue; } diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache index ce040b2d8a..01663cfd23 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api.mustache @@ -2,7 +2,7 @@ import 'dart:async'; {{#useBuiltValue}}import 'package:built_value/serializer.dart';{{/useBuiltValue}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; {{#operations}} {{#imports}}import '{{.}}'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache index 97b998b1d6..35fabd973d 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/api_client.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}';{{#useBuiltValue}} +import 'package:dio/dio.dart';{{#useBuiltValue}} import 'package:built_value/serializer.dart'; import 'package:{{pubName}}/src/serializers.dart';{{/useBuiltValue}} import 'package:{{pubName}}/src/auth/api_key_auth.dart'; diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache index 71d10a8185..2174d15963 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/api_key_auth.mustache @@ -1,6 +1,6 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class ApiKeyAuthInterceptor extends AuthInterceptor { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache index 7c275784c0..a266e2384c 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/auth.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; abstract class AuthInterceptor extends Interceptor { /// Get auth information on given route for the given type. diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache index 3472d1cd22..c286274c3a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/basic_auth.mustache @@ -1,7 +1,7 @@ {{>header}} import 'dart:convert'; -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class BasicAuthInfo { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache index 7aa011d916..626c7d238d 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/bearer_auth.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class BearerAuthInterceptor extends AuthInterceptor { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache index fccc6610f4..4f7b79655a 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/auth/oauth.mustache @@ -1,5 +1,5 @@ {{>header}} -import '{{dioImport}}'; +import 'package:dio/dio.dart'; import 'package:{{pubName}}/src/auth/auth.dart'; class OAuthInterceptor extends AuthInterceptor { diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache index d480e663ac..6bf879a489 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/pubspec.mustache @@ -7,12 +7,7 @@ environment: sdk: '>=2.12.0 <3.0.0' dependencies: -{{#useDioHttp}} - dio_http: '>=5.0.0 <6.0.0' -{{/useDioHttp}} -{{^useDioHttp}} dio: '>=4.0.0 <5.0.0' -{{/useDioHttp}} {{#useBuiltValue}} built_value: '>=8.1.0 <9.0.0' built_collection: '>=5.1.0 <6.0.0' diff --git a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache index 4cdede63a0..fb5ab08aed 100644 --- a/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache +++ b/modules/openapi-generator/src/main/resources/dart/libraries/dio/serialization/built_value/api_util.mustache @@ -4,8 +4,8 @@ import 'dart:typed_data'; import 'package:built_collection/built_collection.dart'; import 'package:built_value/serializer.dart'; -import '{{dioImport}}'; -import 'package:{{dioLibrary}}/src/parameter.dart'; +import 'package:dio/dio.dart'; +import 'package:dio/src/parameter.dart'; /// Format the given form parameter object into something that Dio can handle. /// Returns primitive or String. diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java index 7166ac0404..1d0e81d236 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientCodegenTest.java @@ -84,24 +84,4 @@ public class DartDioNextClientCodegenTest { } } - - @Test - public void testInitialDioLibraryValues() throws Exception { - final DartDioNextClientCodegen codegen = new DartDioNextClientCodegen(); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(DartDioNextClientCodegen.DIO_LIBRARY), DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT); - Assert.assertEquals(codegen.getDioLibrary(), DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT); - } - - @Test - public void testAdditionalPropertiesPutForDioLibraryValues() throws Exception { - final DartDioNextClientCodegen codegen = new DartDioNextClientCodegen(); - codegen.additionalProperties().put(DartDioNextClientCodegen.DIO_LIBRARY, DartDioNextClientCodegen.DIO_HTTP); - codegen.processOpts(); - - Assert.assertEquals(codegen.additionalProperties().get(DartDioNextClientCodegen.DIO_LIBRARY), DartDioNextClientCodegen.DIO_HTTP); - Assert.assertEquals(codegen.getDioLibrary(), DartDioNextClientCodegen.DIO_HTTP); - } - } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java index 210c8290cd..f2237e4fba 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java @@ -50,7 +50,6 @@ public class DartDioNextClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setSourceFolder(DartDioNextClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioNextClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT); - verify(clientCodegen).setDioLibrary(DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT); verify(clientCodegen).setLibrary(DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java index 2b4840d7d4..b03f2a9721 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java @@ -58,7 +58,6 @@ public class DartDioNextClientOptionsProvider implements OptionsProvider { .put(DartDioNextClientCodegen.PUB_HOMEPAGE, PUB_HOMEPAGE_VALUE) .put(CodegenConstants.SERIALIZATION_LIBRARY, DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT) .put(DartDioNextClientCodegen.DATE_LIBRARY, DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT) - .put(DartDioNextClientCodegen.DIO_LIBRARY, DartDioNextClientCodegen.DIO_LIBRARY_DEFAULT) .put(CodegenConstants.SOURCE_FOLDER, SOURCE_FOLDER_VALUE) .put(DartDioNextClientCodegen.USE_ENUM_EXTENSION, USE_ENUM_EXTENSION) .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) diff --git a/pom.xml b/pom.xml index c96acc02e4..6dd63afc4b 100644 --- a/pom.xml +++ b/pom.xml @@ -1402,7 +1402,6 @@ samples/openapi3/client/petstore/dart2/petstore_client_lib samples/openapi3/client/petstore/dart2/petstore samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake - samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore deleted file mode 100644 index 4298cdcbd1..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.gitignore +++ /dev/null @@ -1,41 +0,0 @@ -# See https://dart.dev/guides/libraries/private-files - -# Files and directories created by pub -.dart_tool/ -.buildlog -.packages -.project -.pub/ -build/ -**/packages/ - -# Files created by dart2js -# (Most Dart developers will use pub build to compile Dart, use/modify these -# rules if you intend to use dart2js directly -# Convention is to use extension '.dart.js' for Dart compiled to Javascript to -# differentiate from explicit Javascript files) -*.dart.js -*.part.js -*.js.deps -*.js.map -*.info.json - -# Directory created by dartdoc -doc/api/ - -# Don't commit pubspec lock file -# (Library packages only! Remove pattern if developing an application package) -pubspec.lock - -# Don’t commit files and directories created by other development environments. -# For example, if your development environment creates any of the following files, -# consider putting them in a global ignore file: - -# IntelliJ -*.iml -*.ipr -*.iws -.idea/ - -# Mac -.DS_Store diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES deleted file mode 100644 index ae28fd24be..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/FILES +++ /dev/null @@ -1,121 +0,0 @@ -.gitignore -README.md -analysis_options.yaml -doc/AdditionalPropertiesClass.md -doc/Animal.md -doc/AnotherFakeApi.md -doc/ApiResponse.md -doc/ArrayOfArrayOfNumberOnly.md -doc/ArrayOfNumberOnly.md -doc/ArrayTest.md -doc/Capitalization.md -doc/Cat.md -doc/CatAllOf.md -doc/Category.md -doc/ClassModel.md -doc/DefaultApi.md -doc/DeprecatedObject.md -doc/Dog.md -doc/DogAllOf.md -doc/EnumArrays.md -doc/EnumTest.md -doc/FakeApi.md -doc/FakeClassnameTags123Api.md -doc/FileSchemaTestClass.md -doc/Foo.md -doc/FormatTest.md -doc/HasOnlyReadOnly.md -doc/HealthCheckResult.md -doc/InlineResponseDefault.md -doc/MapTest.md -doc/MixedPropertiesAndAdditionalPropertiesClass.md -doc/Model200Response.md -doc/ModelClient.md -doc/ModelEnumClass.md -doc/ModelFile.md -doc/ModelList.md -doc/ModelReturn.md -doc/Name.md -doc/NullableClass.md -doc/NumberOnly.md -doc/ObjectWithDeprecatedFields.md -doc/Order.md -doc/OuterComposite.md -doc/OuterEnum.md -doc/OuterEnumDefaultValue.md -doc/OuterEnumInteger.md -doc/OuterEnumIntegerDefaultValue.md -doc/OuterObjectWithEnumProperty.md -doc/Pet.md -doc/PetApi.md -doc/ReadOnlyFirst.md -doc/SpecialModelName.md -doc/StoreApi.md -doc/Tag.md -doc/User.md -doc/UserApi.md -lib/openapi.dart -lib/src/api.dart -lib/src/api/another_fake_api.dart -lib/src/api/default_api.dart -lib/src/api/fake_api.dart -lib/src/api/fake_classname_tags123_api.dart -lib/src/api/pet_api.dart -lib/src/api/store_api.dart -lib/src/api/user_api.dart -lib/src/api_util.dart -lib/src/auth/api_key_auth.dart -lib/src/auth/auth.dart -lib/src/auth/basic_auth.dart -lib/src/auth/bearer_auth.dart -lib/src/auth/oauth.dart -lib/src/date_serializer.dart -lib/src/model/additional_properties_class.dart -lib/src/model/animal.dart -lib/src/model/api_response.dart -lib/src/model/array_of_array_of_number_only.dart -lib/src/model/array_of_number_only.dart -lib/src/model/array_test.dart -lib/src/model/capitalization.dart -lib/src/model/cat.dart -lib/src/model/cat_all_of.dart -lib/src/model/category.dart -lib/src/model/class_model.dart -lib/src/model/date.dart -lib/src/model/deprecated_object.dart -lib/src/model/dog.dart -lib/src/model/dog_all_of.dart -lib/src/model/enum_arrays.dart -lib/src/model/enum_test.dart -lib/src/model/file_schema_test_class.dart -lib/src/model/foo.dart -lib/src/model/format_test.dart -lib/src/model/has_only_read_only.dart -lib/src/model/health_check_result.dart -lib/src/model/inline_response_default.dart -lib/src/model/map_test.dart -lib/src/model/mixed_properties_and_additional_properties_class.dart -lib/src/model/model200_response.dart -lib/src/model/model_client.dart -lib/src/model/model_enum_class.dart -lib/src/model/model_file.dart -lib/src/model/model_list.dart -lib/src/model/model_return.dart -lib/src/model/name.dart -lib/src/model/nullable_class.dart -lib/src/model/number_only.dart -lib/src/model/object_with_deprecated_fields.dart -lib/src/model/order.dart -lib/src/model/outer_composite.dart -lib/src/model/outer_enum.dart -lib/src/model/outer_enum_default_value.dart -lib/src/model/outer_enum_integer.dart -lib/src/model/outer_enum_integer_default_value.dart -lib/src/model/outer_object_with_enum_property.dart -lib/src/model/pet.dart -lib/src/model/read_only_first.dart -lib/src/model/special_model_name.dart -lib/src/model/tag.dart -lib/src/model/user.dart -lib/src/serializers.dart -pubspec.yaml diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION deleted file mode 100644 index 4077803655..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md deleted file mode 100644 index 52553e236b..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/README.md +++ /dev/null @@ -1,200 +0,0 @@ -# openapi (EXPERIMENTAL) -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Build package: org.openapitools.codegen.languages.DartDioNextClientCodegen - -## Requirements - -* Dart 2.12.0 or later OR Flutter 1.26.0 or later -* Dio 4.0.0+ - -## Installation & Usage - -### pub.dev -To use the package from [pub.dev](https://pub.dev), please include the following in pubspec.yaml -```yaml -dependencies: - openapi: 1.0.0 -``` - -### Github -If this Dart package is published to Github, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - git: - url: https://github.com/GIT_USER_ID/GIT_REPO_ID.git - #ref: main -``` - -### Local development -To use the package from your local drive, please include the following in pubspec.yaml -```yaml -dependencies: - openapi: - path: /path/to/openapi -``` - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```dart -import 'package:openapi/openapi.dart'; - - -final api = Openapi().getAnotherFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = await api.call123testSpecialTags(modelClient); - print(response); -} catch on DioError (e) { - print("Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n"); -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -[*AnotherFakeApi*](doc/AnotherFakeApi.md) | [**call123testSpecialTags**](doc/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags -[*DefaultApi*](doc/DefaultApi.md) | [**fooGet**](doc/DefaultApi.md#fooget) | **GET** /foo | -[*FakeApi*](doc/FakeApi.md) | [**fakeHealthGet**](doc/FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[*FakeApi*](doc/FakeApi.md) | [**fakeHttpSignatureTest**](doc/FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterBooleanSerialize**](doc/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterCompositeSerialize**](doc/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterNumberSerialize**](doc/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[*FakeApi*](doc/FakeApi.md) | [**fakeOuterStringSerialize**](doc/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[*FakeApi*](doc/FakeApi.md) | [**fakePropertyEnumIntegerSerialize**](doc/FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithBinary**](doc/FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithFileSchema**](doc/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[*FakeApi*](doc/FakeApi.md) | [**testBodyWithQueryParams**](doc/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[*FakeApi*](doc/FakeApi.md) | [**testClientModel**](doc/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[*FakeApi*](doc/FakeApi.md) | [**testEndpointParameters**](doc/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[*FakeApi*](doc/FakeApi.md) | [**testEnumParameters**](doc/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[*FakeApi*](doc/FakeApi.md) | [**testGroupParameters**](doc/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[*FakeApi*](doc/FakeApi.md) | [**testInlineAdditionalProperties**](doc/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[*FakeApi*](doc/FakeApi.md) | [**testJsonFormData**](doc/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[*FakeApi*](doc/FakeApi.md) | [**testQueryParameterCollectionFormat**](doc/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | -[*FakeClassnameTags123Api*](doc/FakeClassnameTags123Api.md) | [**testClassname**](doc/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case -[*PetApi*](doc/PetApi.md) | [**addPet**](doc/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[*PetApi*](doc/PetApi.md) | [**deletePet**](doc/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[*PetApi*](doc/PetApi.md) | [**findPetsByStatus**](doc/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[*PetApi*](doc/PetApi.md) | [**findPetsByTags**](doc/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[*PetApi*](doc/PetApi.md) | [**getPetById**](doc/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[*PetApi*](doc/PetApi.md) | [**updatePet**](doc/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[*PetApi*](doc/PetApi.md) | [**updatePetWithForm**](doc/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[*PetApi*](doc/PetApi.md) | [**uploadFile**](doc/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[*PetApi*](doc/PetApi.md) | [**uploadFileWithRequiredFile**](doc/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) -[*StoreApi*](doc/StoreApi.md) | [**deleteOrder**](doc/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**getInventory**](doc/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[*StoreApi*](doc/StoreApi.md) | [**getOrderById**](doc/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[*StoreApi*](doc/StoreApi.md) | [**placeOrder**](doc/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -[*UserApi*](doc/UserApi.md) | [**createUser**](doc/UserApi.md#createuser) | **POST** /user | Create user -[*UserApi*](doc/UserApi.md) | [**createUsersWithArrayInput**](doc/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**createUsersWithListInput**](doc/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[*UserApi*](doc/UserApi.md) | [**deleteUser**](doc/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[*UserApi*](doc/UserApi.md) | [**getUserByName**](doc/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[*UserApi*](doc/UserApi.md) | [**loginUser**](doc/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[*UserApi*](doc/UserApi.md) | [**logoutUser**](doc/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[*UserApi*](doc/UserApi.md) | [**updateUser**](doc/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [AdditionalPropertiesClass](doc/AdditionalPropertiesClass.md) - - [Animal](doc/Animal.md) - - [ApiResponse](doc/ApiResponse.md) - - [ArrayOfArrayOfNumberOnly](doc/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](doc/ArrayOfNumberOnly.md) - - [ArrayTest](doc/ArrayTest.md) - - [Capitalization](doc/Capitalization.md) - - [Cat](doc/Cat.md) - - [CatAllOf](doc/CatAllOf.md) - - [Category](doc/Category.md) - - [ClassModel](doc/ClassModel.md) - - [DeprecatedObject](doc/DeprecatedObject.md) - - [Dog](doc/Dog.md) - - [DogAllOf](doc/DogAllOf.md) - - [EnumArrays](doc/EnumArrays.md) - - [EnumTest](doc/EnumTest.md) - - [FileSchemaTestClass](doc/FileSchemaTestClass.md) - - [Foo](doc/Foo.md) - - [FormatTest](doc/FormatTest.md) - - [HasOnlyReadOnly](doc/HasOnlyReadOnly.md) - - [HealthCheckResult](doc/HealthCheckResult.md) - - [InlineResponseDefault](doc/InlineResponseDefault.md) - - [MapTest](doc/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](doc/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](doc/Model200Response.md) - - [ModelClient](doc/ModelClient.md) - - [ModelEnumClass](doc/ModelEnumClass.md) - - [ModelFile](doc/ModelFile.md) - - [ModelList](doc/ModelList.md) - - [ModelReturn](doc/ModelReturn.md) - - [Name](doc/Name.md) - - [NullableClass](doc/NullableClass.md) - - [NumberOnly](doc/NumberOnly.md) - - [ObjectWithDeprecatedFields](doc/ObjectWithDeprecatedFields.md) - - [Order](doc/Order.md) - - [OuterComposite](doc/OuterComposite.md) - - [OuterEnum](doc/OuterEnum.md) - - [OuterEnumDefaultValue](doc/OuterEnumDefaultValue.md) - - [OuterEnumInteger](doc/OuterEnumInteger.md) - - [OuterEnumIntegerDefaultValue](doc/OuterEnumIntegerDefaultValue.md) - - [OuterObjectWithEnumProperty](doc/OuterObjectWithEnumProperty.md) - - [Pet](doc/Pet.md) - - [ReadOnlyFirst](doc/ReadOnlyFirst.md) - - [SpecialModelName](doc/SpecialModelName.md) - - [Tag](doc/Tag.md) - - [User](doc/User.md) - - -## Documentation For Authorization - - -## api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -## api_key_query - -- **Type**: API key -- **API key parameter name**: api_key_query -- **Location**: URL query string - -## bearer_test - -- **Type**: HTTP basic authentication - -## http_basic_test - -- **Type**: HTTP basic authentication - -## http_signature_test - -- **Type**: HTTP basic authentication - -## petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml deleted file mode 100644 index a611887d3a..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -analyzer: - language: - strict-inference: true - strict-raw-types: true - strong-mode: - implicit-dynamic: false - implicit-casts: false - exclude: - - test/*.dart diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md deleted file mode 100644 index f9f7857894..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AdditionalPropertiesClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.AdditionalPropertiesClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **BuiltMap<String, String>** | | [optional] -**mapOfMapProperty** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md deleted file mode 100644 index 415b56e9bc..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Animal.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Animal - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md deleted file mode 100644 index df89b0eb12..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/AnotherFakeApi.md +++ /dev/null @@ -1,57 +0,0 @@ -# openapi.api.AnotherFakeApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**call123testSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags - - -# **call123testSpecialTags** -> ModelClient call123testSpecialTags(modelClient) - -To test special tags - -To test special tags and operation ID starting with number - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getAnotherFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.call123testSpecialTags(modelClient); - print(response); -} catch on DioError (e) { - print('Exception when calling AnotherFakeApi->call123testSpecialTags: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md deleted file mode 100644 index 7ad5da0f89..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ApiResponse.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ApiResponse - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **int** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index d1a272ab60..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ArrayOfArrayOfNumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**BuiltList<BuiltList<num>>**](BuiltList.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md deleted file mode 100644 index 94b60f272f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayOfNumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ArrayOfNumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | **BuiltList<num>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md deleted file mode 100644 index 0813d4fa93..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ArrayTest.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.ArrayTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **BuiltList<String>** | | [optional] -**arrayArrayOfInteger** | [**BuiltList<BuiltList<int>>**](BuiltList.md) | | [optional] -**arrayArrayOfModel** | [**BuiltList<BuiltList<ReadOnlyFirst>>**](BuiltList.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md deleted file mode 100644 index 4a07b4eb82..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Capitalization.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Capitalization - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**sCAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md deleted file mode 100644 index 6552eea4b4..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Cat.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Cat - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md deleted file mode 100644 index 36b2ae0e8a..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/CatAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.CatAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md deleted file mode 100644 index ae6bc52e89..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Category.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Category - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **String** | | [default to 'default-name'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md deleted file mode 100644 index 13ae5d3a47..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ClassModel.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ClassModel - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**class_** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md deleted file mode 100644 index f1753b62ee..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DefaultApi.md +++ /dev/null @@ -1,51 +0,0 @@ -# openapi.api.DefaultApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fooGet**](DefaultApi.md#fooget) | **GET** /foo | - - -# **fooGet** -> InlineResponseDefault fooGet() - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getDefaultApi(); - -try { - final response = api.fooGet(); - print(response); -} catch on DioError (e) { - print('Exception when calling DefaultApi->fooGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**InlineResponseDefault**](InlineResponseDefault.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md deleted file mode 100644 index bf2ef67a26..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DeprecatedObject.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DeprecatedObject - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md deleted file mode 100644 index d36439b767..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Dog.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.Dog - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] [default to 'red'] -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md deleted file mode 100644 index 97a7c8fba4..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/DogAllOf.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.DogAllOf - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md deleted file mode 100644 index 06170bb8f5..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumArrays.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.EnumArrays - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | **String** | | [optional] -**arrayEnum** | **BuiltList<String>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md deleted file mode 100644 index 7c24fe2347..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/EnumTest.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.EnumTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | **String** | | [optional] -**enumStringRequired** | **String** | | -**enumInteger** | **int** | | [optional] -**enumNumber** | **double** | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] -**outerEnumInteger** | [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] -**outerEnumDefaultValue** | [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] -**outerEnumIntegerDefaultValue** | [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md deleted file mode 100644 index 740e5ee668..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeApi.md +++ /dev/null @@ -1,816 +0,0 @@ -# openapi.api.FakeApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fakeHealthGet**](FakeApi.md#fakehealthget) | **GET** /fake/health | Health check endpoint -[**fakeHttpSignatureTest**](FakeApi.md#fakehttpsignaturetest) | **GET** /fake/http-signature-test | test http signature authentication -[**fakeOuterBooleanSerialize**](FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean | -[**fakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite | -[**fakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number | -[**fakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string | -[**fakePropertyEnumIntegerSerialize**](FakeApi.md#fakepropertyenumintegerserialize) | **POST** /fake/property/enum-int | -[**testBodyWithBinary**](FakeApi.md#testbodywithbinary) | **PUT** /fake/body-with-binary | -[**testBodyWithFileSchema**](FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema | -[**testBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params | -[**testClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model -[**testEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters -[**testGroupParameters**](FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) -[**testInlineAdditionalProperties**](FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data -[**testQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | - - -# **fakeHealthGet** -> HealthCheckResult fakeHealthGet() - -Health check endpoint - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); - -try { - final response = api.fakeHealthGet(); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeHealthGet: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**HealthCheckResult**](HealthCheckResult.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeHttpSignatureTest** -> fakeHttpSignatureTest(pet, query1, header1) - -test http signature authentication - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: http_signature_test -//defaultApiClient.getAuthentication('http_signature_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('http_signature_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store -final String query1 = query1_example; // String | query parameter -final String header1 = header1_example; // String | header parameter - -try { - api.fakeHttpSignatureTest(pet, query1, header1); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeHttpSignatureTest: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - **query1** | **String**| query parameter | [optional] - **header1** | **String**| header parameter | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_signature_test](../README.md#http_signature_test) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterBooleanSerialize** -> bool fakeOuterBooleanSerialize(body) - - - -Test serialization of outer boolean types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final bool body = true; // bool | Input boolean as post body - -try { - final response = api.fakeOuterBooleanSerialize(body); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterBooleanSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **bool**| Input boolean as post body | [optional] - -### Return type - -**bool** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(outerComposite) - - - -Test serialization of object with outer number type - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final OuterComposite outerComposite = ; // OuterComposite | Input composite as post body - -try { - final response = api.fakeOuterCompositeSerialize(outerComposite); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterCompositeSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterNumberSerialize** -> num fakeOuterNumberSerialize(body) - - - -Test serialization of outer number types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final num body = 8.14; // num | Input number as post body - -try { - final response = api.fakeOuterNumberSerialize(body); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterNumberSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **num**| Input number as post body | [optional] - -### Return type - -**num** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakeOuterStringSerialize** -> String fakeOuterStringSerialize(body) - - - -Test serialization of outer string types - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String body = body_example; // String | Input string as post body - -try { - final response = api.fakeOuterStringSerialize(body); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakeOuterStringSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **String**| Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **fakePropertyEnumIntegerSerialize** -> OuterObjectWithEnumProperty fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty) - - - -Test serialization of enum (int) properties with examples - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final OuterObjectWithEnumProperty outerObjectWithEnumProperty = ; // OuterObjectWithEnumProperty | Input enum (int) as post body - -try { - final response = api.fakePropertyEnumIntegerSerialize(outerObjectWithEnumProperty); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->fakePropertyEnumIntegerSerialize: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **outerObjectWithEnumProperty** | [**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md)| Input enum (int) as post body | - -### Return type - -[**OuterObjectWithEnumProperty**](OuterObjectWithEnumProperty.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: */* - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithBinary** -> testBodyWithBinary(body) - - - -For this test, the body has to be a binary file. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final MultipartFile body = BINARY_DATA_HERE; // MultipartFile | image to upload - -try { - api.testBodyWithBinary(body); -} catch on DioError (e) { - print('Exception when calling FakeApi->testBodyWithBinary: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | **MultipartFile**| image to upload | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: image/png - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithFileSchema** -> testBodyWithFileSchema(fileSchemaTestClass) - - - -For this test, the body for this request must reference a schema named `File`. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final FileSchemaTestClass fileSchemaTestClass = ; // FileSchemaTestClass | - -try { - api.testBodyWithFileSchema(fileSchemaTestClass); -} catch on DioError (e) { - print('Exception when calling FakeApi->testBodyWithFileSchema: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testBodyWithQueryParams** -> testBodyWithQueryParams(query, user) - - - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String query = query_example; // String | -final User user = ; // User | - -try { - api.testBodyWithQueryParams(query, user); -} catch on DioError (e) { - print('Exception when calling FakeApi->testBodyWithQueryParams: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **query** | **String**| | - **user** | [**User**](User.md)| | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testClientModel** -> ModelClient testClientModel(modelClient) - -To test \"client\" model - -To test \"client\" model - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.testClientModel(modelClient); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeApi->testClientModel: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEndpointParameters** -> testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: http_basic_test -//defaultApiClient.getAuthentication('http_basic_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('http_basic_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final num number = 8.14; // num | None -final double double_ = 1.2; // double | None -final String patternWithoutDelimiter = patternWithoutDelimiter_example; // String | None -final String byte = BYTE_ARRAY_DATA_HERE; // String | None -final int integer = 56; // int | None -final int int32 = 56; // int | None -final int int64 = 789; // int | None -final double float = 3.4; // double | None -final String string = string_example; // String | None -final Uint8List binary = BINARY_DATA_HERE; // Uint8List | None -final Date date = 2013-10-20; // Date | None -final DateTime dateTime = 2013-10-20T19:20:30+01:00; // DateTime | None -final String password = password_example; // String | None -final String callback = callback_example; // String | None - -try { - api.testEndpointParameters(number, double_, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, callback); -} catch on DioError (e) { - print('Exception when calling FakeApi->testEndpointParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **num**| None | - **double_** | **double**| None | - **patternWithoutDelimiter** | **String**| None | - **byte** | **String**| None | - **integer** | **int**| None | [optional] - **int32** | **int**| None | [optional] - **int64** | **int**| None | [optional] - **float** | **double**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **Uint8List**| None | [optional] - **date** | **Date**| None | [optional] - **dateTime** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - **callback** | **String**| None | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testEnumParameters** -> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) - -To test enum parameters - -To test enum parameters - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final BuiltList enumHeaderStringArray = ; // BuiltList | Header parameter enum test (string array) -final String enumHeaderString = enumHeaderString_example; // String | Header parameter enum test (string) -final BuiltList enumQueryStringArray = ; // BuiltList | Query parameter enum test (string array) -final String enumQueryString = enumQueryString_example; // String | Query parameter enum test (string) -final int enumQueryInteger = 56; // int | Query parameter enum test (double) -final double enumQueryDouble = 1.2; // double | Query parameter enum test (double) -final BuiltList enumFormStringArray = ; // BuiltList | Form parameter enum test (string array) -final String enumFormString = enumFormString_example; // String | Form parameter enum test (string) - -try { - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); -} catch on DioError (e) { - print('Exception when calling FakeApi->testEnumParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumHeaderStringArray** | [**BuiltList<String>**](String.md)| Header parameter enum test (string array) | [optional] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryStringArray** | [**BuiltList<String>**](String.md)| Query parameter enum test (string array) | [optional] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to '-efg'] - **enumQueryInteger** | **int**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **double**| Query parameter enum test (double) | [optional] - **enumFormStringArray** | [**BuiltList<String>**](String.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to '-efg'] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testGroupParameters** -> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) - -Fake endpoint to test group parameters (optional) - -Fake endpoint to test group parameters (optional) - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure HTTP basic authorization: bearer_test -//defaultApiClient.getAuthentication('bearer_test').username = 'YOUR_USERNAME' -//defaultApiClient.getAuthentication('bearer_test').password = 'YOUR_PASSWORD'; - -final api = Openapi().getFakeApi(); -final int requiredStringGroup = 56; // int | Required String in group parameters -final bool requiredBooleanGroup = true; // bool | Required Boolean in group parameters -final int requiredInt64Group = 789; // int | Required Integer in group parameters -final int stringGroup = 56; // int | String in group parameters -final bool booleanGroup = true; // bool | Boolean in group parameters -final int int64Group = 789; // int | Integer in group parameters - -try { - api.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); -} catch on DioError (e) { - print('Exception when calling FakeApi->testGroupParameters: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requiredStringGroup** | **int**| Required String in group parameters | - **requiredBooleanGroup** | **bool**| Required Boolean in group parameters | - **requiredInt64Group** | **int**| Required Integer in group parameters | - **stringGroup** | **int**| String in group parameters | [optional] - **booleanGroup** | **bool**| Boolean in group parameters | [optional] - **int64Group** | **int**| Integer in group parameters | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[bearer_test](../README.md#bearer_test) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testInlineAdditionalProperties** -> testInlineAdditionalProperties(requestBody) - -test inline additionalProperties - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final BuiltMap requestBody = ; // BuiltMap | request body - -try { - api.testInlineAdditionalProperties(requestBody); -} catch on DioError (e) { - print('Exception when calling FakeApi->testInlineAdditionalProperties: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **requestBody** | [**BuiltMap<String, String>**](String.md)| request body | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testJsonFormData** -> testJsonFormData(param, param2) - -test json serialization of form data - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final String param = param_example; // String | field1 -final String param2 = param2_example; // String | field2 - -try { - api.testJsonFormData(param, param2); -} catch on DioError (e) { - print('Exception when calling FakeApi->testJsonFormData: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **testQueryParameterCollectionFormat** -> testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language) - - - -To test the collection format in query parameters - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getFakeApi(); -final BuiltList pipe = ; // BuiltList | -final BuiltList ioutil = ; // BuiltList | -final BuiltList http = ; // BuiltList | -final BuiltList url = ; // BuiltList | -final BuiltList context = ; // BuiltList | -final String allowEmpty = allowEmpty_example; // String | -final BuiltMap language = ; // BuiltMap | - -try { - api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, allowEmpty, language); -} catch on DioError (e) { - print('Exception when calling FakeApi->testQueryParameterCollectionFormat: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pipe** | [**BuiltList<String>**](String.md)| | - **ioutil** | [**BuiltList<String>**](String.md)| | - **http** | [**BuiltList<String>**](String.md)| | - **url** | [**BuiltList<String>**](String.md)| | - **context** | [**BuiltList<String>**](String.md)| | - **allowEmpty** | **String**| | - **language** | [**BuiltMap<String, String>**](String.md)| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md deleted file mode 100644 index 35e244fbf2..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FakeClassnameTags123Api.md +++ /dev/null @@ -1,61 +0,0 @@ -# openapi.api.FakeClassnameTags123Api - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case - - -# **testClassname** -> ModelClient testClassname(modelClient) - -To test class name in snake case - -To test class name in snake case - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key_query -//defaultApiClient.getAuthentication('api_key_query').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key_query').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getFakeClassnameTags123Api(); -final ModelClient modelClient = ; // ModelClient | client model - -try { - final response = api.testClassname(modelClient); - print(response); -} catch on DioError (e) { - print('Exception when calling FakeClassnameTags123Api->testClassname: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **modelClient** | [**ModelClient**](ModelClient.md)| client model | - -### Return type - -[**ModelClient**](ModelClient.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md deleted file mode 100644 index 105fece87f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FileSchemaTestClass.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.FileSchemaTestClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**file** | [**ModelFile**](ModelFile.md) | | [optional] -**files** | [**BuiltList<ModelFile>**](ModelFile.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md deleted file mode 100644 index 185b76e3f5..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Foo.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.Foo - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] [default to 'bar'] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md deleted file mode 100644 index f811264ca2..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/FormatTest.md +++ /dev/null @@ -1,30 +0,0 @@ -# openapi.model.FormatTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **int** | | [optional] -**int32** | **int** | | [optional] -**int64** | **int** | | [optional] -**number** | **num** | | -**float** | **double** | | [optional] -**double_** | **double** | | [optional] -**decimal** | **double** | | [optional] -**string** | **String** | | [optional] -**byte** | **String** | | -**binary** | [**Uint8List**](Uint8List.md) | | [optional] -**date** | [**Date**](Date.md) | | -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | -**patternWithDigits** | **String** | A string that is a 10 digit number. Can have leading zeros. | [optional] -**patternWithDigitsAndDelimiter** | **String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md deleted file mode 100644 index 32cae93715..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HasOnlyReadOnly.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.HasOnlyReadOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md deleted file mode 100644 index 4d6aeb75d9..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/HealthCheckResult.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.HealthCheckResult - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**nullableMessage** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md deleted file mode 100644 index c5e61e1162..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/InlineResponseDefault.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.InlineResponseDefault - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md deleted file mode 100644 index 4ad87df642..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MapTest.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.MapTest - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [**BuiltMap<String, BuiltMap<String, String>>**](BuiltMap.md) | | [optional] -**mapOfEnumString** | **BuiltMap<String, String>** | | [optional] -**directMap** | **BuiltMap<String, bool>** | | [optional] -**indirectMap** | **BuiltMap<String, bool>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index b1a4c4ccc4..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.MixedPropertiesAndAdditionalPropertiesClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**map** | [**BuiltMap<String, Animal>**](Animal.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md deleted file mode 100644 index 5aa3fb97c3..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Model200Response.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Model200Response - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | [optional] -**class_** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md deleted file mode 100644 index f7b922f4a3..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelClient.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelClient - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md deleted file mode 100644 index ebaafb44c7..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelEnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.ModelEnumClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md deleted file mode 100644 index 4be260e93f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelFile.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelFile - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**sourceURI** | **String** | Test capitalization | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md deleted file mode 100644 index 283aa1f6b7..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelList.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelList - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**n123list** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md deleted file mode 100644 index bc02df7a36..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ModelReturn.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.ModelReturn - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**return_** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md deleted file mode 100644 index 25f49ea946..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Name.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.Name - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **int** | | -**snakeCase** | **int** | | [optional] -**property** | **String** | | [optional] -**n123number** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md deleted file mode 100644 index 4ce8d5e175..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NullableClass.md +++ /dev/null @@ -1,26 +0,0 @@ -# openapi.model.NullableClass - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integerProp** | **int** | | [optional] -**numberProp** | **num** | | [optional] -**booleanProp** | **bool** | | [optional] -**stringProp** | **String** | | [optional] -**dateProp** | [**Date**](Date.md) | | [optional] -**datetimeProp** | [**DateTime**](DateTime.md) | | [optional] -**arrayNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**arrayAndItemsNullableProp** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**arrayItemsNullable** | [**BuiltList<JsonObject>**](JsonObject.md) | | [optional] -**objectNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] -**objectAndItemsNullableProp** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] -**objectItemsNullable** | [**BuiltMap<String, JsonObject>**](JsonObject.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md deleted file mode 100644 index d8096a3db3..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/NumberOnly.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.NumberOnly - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | **num** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md deleted file mode 100644 index 3e7848d382..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ObjectWithDeprecatedFields.md +++ /dev/null @@ -1,18 +0,0 @@ -# openapi.model.ObjectWithDeprecatedFields - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**id** | **num** | | [optional] -**deprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional] -**bars** | **BuiltList<String>** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md deleted file mode 100644 index bde5ffe51a..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Order.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Order - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**petId** | **int** | | [optional] -**quantity** | **int** | | [optional] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] -**status** | **String** | Order Status | [optional] -**complete** | **bool** | | [optional] [default to false] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md deleted file mode 100644 index 04bab7eff5..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterComposite.md +++ /dev/null @@ -1,17 +0,0 @@ -# openapi.model.OuterComposite - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | **num** | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **bool** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md deleted file mode 100644 index af62ad87ab..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnum.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnum - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md deleted file mode 100644 index c1bf8b0dec..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumDefaultValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md deleted file mode 100644 index 8c80a9e5c8..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumInteger.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumInteger - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index eb8b55d702..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,14 +0,0 @@ -# openapi.model.OuterEnumIntegerDefaultValue - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md deleted file mode 100644 index eab2ae8f66..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/OuterObjectWithEnumProperty.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.OuterObjectWithEnumProperty - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | [**OuterEnumInteger**](OuterEnumInteger.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md deleted file mode 100644 index 08e0aeedd7..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Pet.md +++ /dev/null @@ -1,20 +0,0 @@ -# openapi.model.Pet - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **BuiltSet<String>** | | -**tags** | [**BuiltList<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md deleted file mode 100644 index 6afc643ea5..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/PetApi.md +++ /dev/null @@ -1,427 +0,0 @@ -# openapi.api.PetApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -[**uploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) - - -# **addPet** -> addPet(pet) - -Add a new pet to the store - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store - -try { - api.addPet(pet); -} catch on DioError (e) { - print('Exception when calling PetApi->addPet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | Pet id to delete -final String apiKey = apiKey_example; // String | - -try { - api.deletePet(petId, apiKey); -} catch on DioError (e) { - print('Exception when calling PetApi->deletePet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -> BuiltList findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final BuiltList status = ; // BuiltList | Status values that need to be considered for filter - -try { - final response = api.findPetsByStatus(status); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->findPetsByStatus: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**BuiltList<String>**](String.md)| Status values that need to be considered for filter | - -### Return type - -[**BuiltList<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -> BuiltSet findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final BuiltSet tags = ; // BuiltSet | Tags to filter by - -try { - final response = api.findPetsByTags(tags); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->findPetsByTags: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**BuiltSet<String>**](String.md)| Tags to filter by | - -### Return type - -[**BuiltSet<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to return - -try { - final response = api.getPetById(petId); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->getPetById: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -> updatePet(pet) - -Update an existing pet - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final Pet pet = ; // Pet | Pet object that needs to be added to the store - -try { - api.updatePet(pet); -} catch on DioError (e) { - print('Exception when calling PetApi->updatePet: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet that needs to be updated -final String name = name_example; // String | Updated name of the pet -final String status = status_example; // String | Updated status of the pet - -try { - api.updatePetWithForm(petId, name, status); -} catch on DioError (e) { - print('Exception when calling PetApi->updatePetWithForm: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to update -final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server -final MultipartFile file = BINARY_DATA_HERE; // MultipartFile | file to upload - -try { - final response = api.uploadFile(petId, additionalMetadata, file); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->uploadFile: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **MultipartFile**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFileWithRequiredFile** -> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - -uploads an image (required) - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure OAuth2 access token for authorization: petstore_auth -//defaultApiClient.getAuthentication('petstore_auth').accessToken = 'YOUR_ACCESS_TOKEN'; - -final api = Openapi().getPetApi(); -final int petId = 789; // int | ID of pet to update -final MultipartFile requiredFile = BINARY_DATA_HERE; // MultipartFile | file to upload -final String additionalMetadata = additionalMetadata_example; // String | Additional data to pass to server - -try { - final response = api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - print(response); -} catch on DioError (e) { - print('Exception when calling PetApi->uploadFileWithRequiredFile: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **int**| ID of pet to update | - **requiredFile** | **MultipartFile**| file to upload | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md deleted file mode 100644 index 8f612e8ba1..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/ReadOnlyFirst.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.ReadOnlyFirst - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md deleted file mode 100644 index 5fcfa98e0b..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/SpecialModelName.md +++ /dev/null @@ -1,15 +0,0 @@ -# openapi.model.SpecialModelName - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket** | **int** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md deleted file mode 100644 index 5c8a683579..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/StoreApi.md +++ /dev/null @@ -1,186 +0,0 @@ -# openapi.api.StoreApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final String orderId = orderId_example; // String | ID of the order that needs to be deleted - -try { - api.deleteOrder(orderId); -} catch on DioError (e) { - print('Exception when calling StoreApi->deleteOrder: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -> BuiltMap getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```dart -import 'package:openapi/api.dart'; -// TODO Configure API key authorization: api_key -//defaultApiClient.getAuthentication('api_key').apiKey = 'YOUR_API_KEY'; -// uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//defaultApiClient.getAuthentication('api_key').apiKeyPrefix = 'Bearer'; - -final api = Openapi().getStoreApi(); - -try { - final response = api.getInventory(); - print(response); -} catch on DioError (e) { - print('Exception when calling StoreApi->getInventory: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**BuiltMap<String, int>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final int orderId = 789; // int | ID of pet that needs to be fetched - -try { - final response = api.getOrderById(orderId); - print(response); -} catch on DioError (e) { - print('Exception when calling StoreApi->getOrderById: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **int**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -> Order placeOrder(order) - -Place an order for a pet - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getStoreApi(); -final Order order = ; // Order | order placed for purchasing the pet - -try { - final response = api.placeOrder(order); - print(response); -} catch on DioError (e) { - print('Exception when calling StoreApi->placeOrder: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md deleted file mode 100644 index c219f987c1..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/Tag.md +++ /dev/null @@ -1,16 +0,0 @@ -# openapi.model.Tag - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**name** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md deleted file mode 100644 index fa87e64d85..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/User.md +++ /dev/null @@ -1,22 +0,0 @@ -# openapi.model.User - -## Load the model package -```dart -import 'package:openapi/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **int** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md deleted file mode 100644 index e3af05ffb0..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/doc/UserApi.md +++ /dev/null @@ -1,349 +0,0 @@ -# openapi.api.UserApi - -## Load the API package -```dart -import 'package:openapi/api.dart'; -``` - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -> createUser(user) - -Create user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final User user = ; // User | Created user object - -try { - api.createUser(user); -} catch on DioError (e) { - print('Exception when calling UserApi->createUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final BuiltList user = ; // BuiltList | List of user object - -try { - api.createUsersWithArrayInput(user); -} catch on DioError (e) { - print('Exception when calling UserApi->createUsersWithArrayInput: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -> createUsersWithListInput(user) - -Creates list of users with given input array - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final BuiltList user = ; // BuiltList | List of user object - -try { - api.createUsersWithListInput(user); -} catch on DioError (e) { - print('Exception when calling UserApi->createUsersWithListInput: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**BuiltList<User>**](User.md)| List of user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The name that needs to be deleted - -try { - api.deleteUser(username); -} catch on DioError (e) { - print('Exception when calling UserApi->deleteUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The name that needs to be fetched. Use user1 for testing. - -try { - final response = api.getUserByName(username); - print(response); -} catch on DioError (e) { - print('Exception when calling UserApi->getUserByName: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | The user name for login -final String password = password_example; // String | The password for login in clear text - -try { - final response = api.loginUser(username, password); - print(response); -} catch on DioError (e) { - print('Exception when calling UserApi->loginUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); - -try { - api.logoutUser(); -} catch on DioError (e) { - print('Exception when calling UserApi->logoutUser: $e\n'); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -> updateUser(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example -```dart -import 'package:openapi/api.dart'; - -final api = Openapi().getUserApi(); -final String username = username_example; // String | name that need to be deleted -final User user = ; // User | Updated user object - -try { - api.updateUser(username, user); -} catch on DioError (e) { - print('Exception when calling UserApi->updateUser: $e\n'); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart deleted file mode 100644 index 5dbf2a6964..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/openapi.dart +++ /dev/null @@ -1,65 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -export 'package:openapi/src/api.dart'; -export 'package:openapi/src/auth/api_key_auth.dart'; -export 'package:openapi/src/auth/basic_auth.dart'; -export 'package:openapi/src/auth/oauth.dart'; -export 'package:openapi/src/serializers.dart'; -export 'package:openapi/src/model/date.dart'; - -export 'package:openapi/src/api/another_fake_api.dart'; -export 'package:openapi/src/api/default_api.dart'; -export 'package:openapi/src/api/fake_api.dart'; -export 'package:openapi/src/api/fake_classname_tags123_api.dart'; -export 'package:openapi/src/api/pet_api.dart'; -export 'package:openapi/src/api/store_api.dart'; -export 'package:openapi/src/api/user_api.dart'; - -export 'package:openapi/src/model/additional_properties_class.dart'; -export 'package:openapi/src/model/animal.dart'; -export 'package:openapi/src/model/api_response.dart'; -export 'package:openapi/src/model/array_of_array_of_number_only.dart'; -export 'package:openapi/src/model/array_of_number_only.dart'; -export 'package:openapi/src/model/array_test.dart'; -export 'package:openapi/src/model/capitalization.dart'; -export 'package:openapi/src/model/cat.dart'; -export 'package:openapi/src/model/cat_all_of.dart'; -export 'package:openapi/src/model/category.dart'; -export 'package:openapi/src/model/class_model.dart'; -export 'package:openapi/src/model/deprecated_object.dart'; -export 'package:openapi/src/model/dog.dart'; -export 'package:openapi/src/model/dog_all_of.dart'; -export 'package:openapi/src/model/enum_arrays.dart'; -export 'package:openapi/src/model/enum_test.dart'; -export 'package:openapi/src/model/file_schema_test_class.dart'; -export 'package:openapi/src/model/foo.dart'; -export 'package:openapi/src/model/format_test.dart'; -export 'package:openapi/src/model/has_only_read_only.dart'; -export 'package:openapi/src/model/health_check_result.dart'; -export 'package:openapi/src/model/inline_response_default.dart'; -export 'package:openapi/src/model/map_test.dart'; -export 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -export 'package:openapi/src/model/model200_response.dart'; -export 'package:openapi/src/model/model_client.dart'; -export 'package:openapi/src/model/model_enum_class.dart'; -export 'package:openapi/src/model/model_file.dart'; -export 'package:openapi/src/model/model_list.dart'; -export 'package:openapi/src/model/model_return.dart'; -export 'package:openapi/src/model/name.dart'; -export 'package:openapi/src/model/nullable_class.dart'; -export 'package:openapi/src/model/number_only.dart'; -export 'package:openapi/src/model/object_with_deprecated_fields.dart'; -export 'package:openapi/src/model/order.dart'; -export 'package:openapi/src/model/outer_composite.dart'; -export 'package:openapi/src/model/outer_enum.dart'; -export 'package:openapi/src/model/outer_enum_default_value.dart'; -export 'package:openapi/src/model/outer_enum_integer.dart'; -export 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -export 'package:openapi/src/model/outer_object_with_enum_property.dart'; -export 'package:openapi/src/model/pet.dart'; -export 'package:openapi/src/model/read_only_first.dart'; -export 'package:openapi/src/model/special_model_name.dart'; -export 'package:openapi/src/model/tag.dart'; -export 'package:openapi/src/model/user.dart'; diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart deleted file mode 100644 index d2d54f3818..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api.dart +++ /dev/null @@ -1,115 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/serializers.dart'; -import 'package:openapi/src/auth/api_key_auth.dart'; -import 'package:openapi/src/auth/basic_auth.dart'; -import 'package:openapi/src/auth/bearer_auth.dart'; -import 'package:openapi/src/auth/oauth.dart'; -import 'package:openapi/src/api/another_fake_api.dart'; -import 'package:openapi/src/api/default_api.dart'; -import 'package:openapi/src/api/fake_api.dart'; -import 'package:openapi/src/api/fake_classname_tags123_api.dart'; -import 'package:openapi/src/api/pet_api.dart'; -import 'package:openapi/src/api/store_api.dart'; -import 'package:openapi/src/api/user_api.dart'; - -class Openapi { - static const String basePath = r'http://petstore.swagger.io:80/v2'; - - final Dio dio; - final Serializers serializers; - - Openapi({ - Dio? dio, - Serializers? serializers, - String? basePathOverride, - List? interceptors, - }) : this.serializers = serializers ?? standardSerializers, - this.dio = dio ?? - Dio(BaseOptions( - baseUrl: basePathOverride ?? basePath, - connectTimeout: 5000, - receiveTimeout: 3000, - )) { - if (interceptors == null) { - this.dio.interceptors.addAll([ - OAuthInterceptor(), - BasicAuthInterceptor(), - BearerAuthInterceptor(), - ApiKeyAuthInterceptor(), - ]); - } else { - this.dio.interceptors.addAll(interceptors); - } - } - - void setOAuthToken(String name, String token) { - if (this.dio.interceptors.any((i) => i is OAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is OAuthInterceptor) as OAuthInterceptor).tokens[name] = token; - } - } - - void setBearerAuth(String name, String token) { - if (this.dio.interceptors.any((i) => i is BearerAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BearerAuthInterceptor) as BearerAuthInterceptor).tokens[name] = token; - } - } - - void setBasicAuth(String name, String username, String password) { - if (this.dio.interceptors.any((i) => i is BasicAuthInterceptor)) { - (this.dio.interceptors.firstWhere((i) => i is BasicAuthInterceptor) as BasicAuthInterceptor).authInfo[name] = BasicAuthInfo(username, password); - } - } - - void setApiKey(String name, String apiKey) { - if (this.dio.interceptors.any((i) => i is ApiKeyAuthInterceptor)) { - (this.dio.interceptors.firstWhere((element) => element is ApiKeyAuthInterceptor) as ApiKeyAuthInterceptor).apiKeys[name] = apiKey; - } - } - - /// Get AnotherFakeApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - AnotherFakeApi getAnotherFakeApi() { - return AnotherFakeApi(dio, serializers); - } - - /// Get DefaultApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - DefaultApi getDefaultApi() { - return DefaultApi(dio, serializers); - } - - /// Get FakeApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - FakeApi getFakeApi() { - return FakeApi(dio, serializers); - } - - /// Get FakeClassnameTags123Api instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - FakeClassnameTags123Api getFakeClassnameTags123Api() { - return FakeClassnameTags123Api(dio, serializers); - } - - /// Get PetApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - PetApi getPetApi() { - return PetApi(dio, serializers); - } - - /// Get StoreApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - StoreApi getStoreApi() { - return StoreApi(dio, serializers); - } - - /// Get UserApi instance, base route and serializer can be overridden by a given but be careful, - /// by doing that all interceptors will not be executed - UserApi getUserApi() { - return UserApi(dio, serializers); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart deleted file mode 100644 index d361f9ce96..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/another_fake_api.dart +++ /dev/null @@ -1,113 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:openapi/src/model/model_client.dart'; - -class AnotherFakeApi { - - final Dio _dio; - - final Serializers _serializers; - - const AnotherFakeApi(this._dio, this._serializers); - - /// To test special tags - /// To test special tags and operation ID starting with number - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> call123testSpecialTags({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/another-fake/dummy'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - try { - const _responseType = FullType(ModelClient); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ModelClient; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart deleted file mode 100644 index 87c6f0dd2f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/default_api.dart +++ /dev/null @@ -1,92 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:openapi/src/model/inline_response_default.dart'; - -class DefaultApi { - - final Dio _dio; - - final Serializers _serializers; - - const DefaultApi(this._dio, this._serializers); - - /// fooGet - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [InlineResponseDefault] as data - /// Throws [DioError] if API call or serialization fails - Future> fooGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/foo'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - InlineResponseDefault _responseData; - - try { - const _responseType = FullType(InlineResponseDefault); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as InlineResponseDefault; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart deleted file mode 100644 index d864083600..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_api.dart +++ /dev/null @@ -1,1417 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'dart:typed_data'; -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/date.dart'; -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; -import 'package:openapi/src/model/user.dart'; - -class FakeApi { - - final Dio _dio; - - final Serializers _serializers; - - const FakeApi(this._dio, this._serializers); - - /// Health check endpoint - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [HealthCheckResult] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeHealthGet({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/health'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - HealthCheckResult _responseData; - - try { - const _responseType = FullType(HealthCheckResult); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as HealthCheckResult; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// test http signature authentication - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [query1] - query parameter - /// * [header1] - header parameter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> fakeHttpSignatureTest({ - required Pet pet, - String? query1, - String? header1, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/http-signature-test'; - final _options = Options( - method: r'GET', - headers: { - if (header1 != null) r'header_1': header1, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'signature', - 'name': 'http_signature_test', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (query1 != null) r'query_1': encodeQueryParameter(_serializers, query1, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// fakeOuterBooleanSerialize - /// Test serialization of outer boolean types - /// - /// Parameters: - /// * [body] - Input boolean as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [bool] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterBooleanSerialize({ - bool? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/boolean'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - bool _responseData; - - try { - _responseData = _response.data as bool; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterCompositeSerialize - /// Test serialization of object with outer number type - /// - /// Parameters: - /// * [outerComposite] - Input composite as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [OuterComposite] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterCompositeSerialize({ - OuterComposite? outerComposite, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/composite'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(OuterComposite); - _bodyData = outerComposite == null ? null : _serializers.serialize(outerComposite, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterComposite _responseData; - - try { - const _responseType = FullType(OuterComposite); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as OuterComposite; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterNumberSerialize - /// Test serialization of outer number types - /// - /// Parameters: - /// * [body] - Input number as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [num] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterNumberSerialize({ - num? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/number'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - num _responseData; - - try { - _responseData = _response.data as num; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakeOuterStringSerialize - /// Test serialization of outer string types - /// - /// Parameters: - /// * [body] - Input string as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails - Future> fakeOuterStringSerialize({ - String? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/outer/string'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - String _responseData; - - try { - _responseData = _response.data as String; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// fakePropertyEnumIntegerSerialize - /// Test serialization of enum (int) properties with examples - /// - /// Parameters: - /// * [outerObjectWithEnumProperty] - Input enum (int) as post body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [OuterObjectWithEnumProperty] as data - /// Throws [DioError] if API call or serialization fails - Future> fakePropertyEnumIntegerSerialize({ - required OuterObjectWithEnumProperty outerObjectWithEnumProperty, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/property/enum-int'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(OuterObjectWithEnumProperty); - _bodyData = _serializers.serialize(outerObjectWithEnumProperty, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - OuterObjectWithEnumProperty _responseData; - - try { - const _responseType = FullType(OuterObjectWithEnumProperty); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as OuterObjectWithEnumProperty; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// testBodyWithBinary - /// For this test, the body has to be a binary file. - /// - /// Parameters: - /// * [body] - image to upload - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithBinary({ - MultipartFile? body, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-binary'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'image/png', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = body?.finalize(); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testBodyWithFileSchema - /// For this test, the body for this request must reference a schema named `File`. - /// - /// Parameters: - /// * [fileSchemaTestClass] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithFileSchema({ - required FileSchemaTestClass fileSchemaTestClass, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-file-schema'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(FileSchemaTestClass); - _bodyData = _serializers.serialize(fileSchemaTestClass, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testBodyWithQueryParams - /// - /// - /// Parameters: - /// * [query] - /// * [user] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testBodyWithQueryParams({ - required String query, - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/body-with-query-params'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'query': encodeQueryParameter(_serializers, query, const FullType(String)), - }; - - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// To test \"client\" model - /// To test \"client\" model - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> testClientModel({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - try { - const _responseType = FullType(ModelClient); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ModelClient; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - /// - /// Parameters: - /// * [number] - None - /// * [double_] - None - /// * [patternWithoutDelimiter] - None - /// * [byte] - None - /// * [integer] - None - /// * [int32] - None - /// * [int64] - None - /// * [float] - None - /// * [string] - None - /// * [binary] - None - /// * [date] - None - /// * [dateTime] - None - /// * [password] - None - /// * [callback] - None - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEndpointParameters({ - required num number, - required double double_, - required String patternWithoutDelimiter, - required String byte, - int? integer, - int? int32, - int? int64, - double? float, - String? string, - Uint8List? binary, - Date? date, - DateTime? dateTime, - String? password, - String? callback, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'basic', - 'name': 'http_basic_test', - }, - ], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = { - if (integer != null) r'integer': encodeQueryParameter(_serializers, integer, const FullType(int)), - if (int32 != null) r'int32': encodeQueryParameter(_serializers, int32, const FullType(int)), - if (int64 != null) r'int64': encodeQueryParameter(_serializers, int64, const FullType(int)), - r'number': encodeQueryParameter(_serializers, number, const FullType(num)), - if (float != null) r'float': encodeQueryParameter(_serializers, float, const FullType(double)), - r'double': encodeQueryParameter(_serializers, double_, const FullType(double)), - if (string != null) r'string': encodeQueryParameter(_serializers, string, const FullType(String)), - r'pattern_without_delimiter': encodeQueryParameter(_serializers, patternWithoutDelimiter, const FullType(String)), - r'byte': encodeQueryParameter(_serializers, byte, const FullType(String)), - if (binary != null) r'binary': encodeQueryParameter(_serializers, binary, const FullType(Uint8List)), - if (date != null) r'date': encodeQueryParameter(_serializers, date, const FullType(Date)), - if (dateTime != null) r'dateTime': encodeQueryParameter(_serializers, dateTime, const FullType(DateTime)), - if (password != null) r'password': encodeQueryParameter(_serializers, password, const FullType(String)), - if (callback != null) r'callback': encodeQueryParameter(_serializers, callback, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// To test enum parameters - /// To test enum parameters - /// - /// Parameters: - /// * [enumHeaderStringArray] - Header parameter enum test (string array) - /// * [enumHeaderString] - Header parameter enum test (string) - /// * [enumQueryStringArray] - Query parameter enum test (string array) - /// * [enumQueryString] - Query parameter enum test (string) - /// * [enumQueryInteger] - Query parameter enum test (double) - /// * [enumQueryDouble] - Query parameter enum test (double) - /// * [enumFormStringArray] - Form parameter enum test (string array) - /// * [enumFormString] - Form parameter enum test (string) - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testEnumParameters({ - BuiltList? enumHeaderStringArray, - String? enumHeaderString = '-efg', - BuiltList? enumQueryStringArray, - String? enumQueryString = '-efg', - int? enumQueryInteger, - double? enumQueryDouble, - BuiltList? enumFormStringArray, - String? enumFormString, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'GET', - headers: { - if (enumHeaderStringArray != null) r'enum_header_string_array': enumHeaderStringArray, - if (enumHeaderString != null) r'enum_header_string': enumHeaderString, - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - final _queryParameters = { - if (enumQueryStringArray != null) r'enum_query_string_array': encodeCollectionQueryParameter(_serializers, enumQueryStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), - if (enumQueryString != null) r'enum_query_string': encodeQueryParameter(_serializers, enumQueryString, const FullType(String)), - if (enumQueryInteger != null) r'enum_query_integer': encodeQueryParameter(_serializers, enumQueryInteger, const FullType(int)), - if (enumQueryDouble != null) r'enum_query_double': encodeQueryParameter(_serializers, enumQueryDouble, const FullType(double)), - }; - - dynamic _bodyData; - - try { - _bodyData = { - if (enumFormStringArray != null) r'enum_form_string_array': encodeCollectionQueryParameter(_serializers, enumFormStringArray, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - if (enumFormString != null) r'enum_form_string': encodeQueryParameter(_serializers, enumFormString, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - queryParameters: _queryParameters, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Fake endpoint to test group parameters (optional) - /// Fake endpoint to test group parameters (optional) - /// - /// Parameters: - /// * [requiredStringGroup] - Required String in group parameters - /// * [requiredBooleanGroup] - Required Boolean in group parameters - /// * [requiredInt64Group] - Required Integer in group parameters - /// * [stringGroup] - String in group parameters - /// * [booleanGroup] - Boolean in group parameters - /// * [int64Group] - Integer in group parameters - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testGroupParameters({ - required int requiredStringGroup, - required bool requiredBooleanGroup, - required int requiredInt64Group, - int? stringGroup, - bool? booleanGroup, - int? int64Group, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake'; - final _options = Options( - method: r'DELETE', - headers: { - r'required_boolean_group': requiredBooleanGroup, - if (booleanGroup != null) r'boolean_group': booleanGroup, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'http', - 'scheme': 'bearer', - 'name': 'bearer_test', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'required_string_group': encodeQueryParameter(_serializers, requiredStringGroup, const FullType(int)), - r'required_int64_group': encodeQueryParameter(_serializers, requiredInt64Group, const FullType(int)), - if (stringGroup != null) r'string_group': encodeQueryParameter(_serializers, stringGroup, const FullType(int)), - if (int64Group != null) r'int64_group': encodeQueryParameter(_serializers, int64Group, const FullType(int)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test inline additionalProperties - /// - /// - /// Parameters: - /// * [requestBody] - request body - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testInlineAdditionalProperties({ - required BuiltMap requestBody, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/inline-additionalProperties'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(BuiltMap, [FullType(String), FullType(String)]); - _bodyData = _serializers.serialize(requestBody, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// test json serialization of form data - /// - /// - /// Parameters: - /// * [param] - field1 - /// * [param2] - field2 - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testJsonFormData({ - required String param, - required String param2, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/jsonFormData'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = { - r'param': encodeQueryParameter(_serializers, param, const FullType(String)), - r'param2': encodeQueryParameter(_serializers, param2, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// testQueryParameterCollectionFormat - /// To test the collection format in query parameters - /// - /// Parameters: - /// * [pipe] - /// * [ioutil] - /// * [http] - /// * [url] - /// * [context] - /// * [allowEmpty] - /// * [language] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> testQueryParameterCollectionFormat({ - required BuiltList pipe, - required BuiltList ioutil, - required BuiltList http, - required BuiltList url, - required BuiltList context, - required String allowEmpty, - BuiltMap? language, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/test-query-parameters'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'pipe': encodeCollectionQueryParameter(_serializers, pipe, const FullType(BuiltList, [FullType(String)]), format: ListFormat.pipes,), - r'ioutil': encodeCollectionQueryParameter(_serializers, ioutil, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - r'http': encodeCollectionQueryParameter(_serializers, http, const FullType(BuiltList, [FullType(String)]), format: ListFormat.ssv,), - r'url': encodeCollectionQueryParameter(_serializers, url, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - r'context': encodeCollectionQueryParameter(_serializers, context, const FullType(BuiltList, [FullType(String)]), format: ListFormat.multi,), - if (language != null) r'language': encodeQueryParameter(_serializers, language, const FullType(BuiltMap, [FullType(String), FullType(String)]), ), - r'allowEmpty': encodeQueryParameter(_serializers, allowEmpty, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart deleted file mode 100644 index e39c39e2f5..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/fake_classname_tags123_api.dart +++ /dev/null @@ -1,120 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:openapi/src/model/model_client.dart'; - -class FakeClassnameTags123Api { - - final Dio _dio; - - final Serializers _serializers; - - const FakeClassnameTags123Api(this._dio, this._serializers); - - /// To test class name in snake case - /// To test class name in snake case - /// - /// Parameters: - /// * [modelClient] - client model - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ModelClient] as data - /// Throws [DioError] if API call or serialization fails - Future> testClassname({ - required ModelClient modelClient, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake_classname_test'; - final _options = Options( - method: r'PATCH', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key_query', - 'keyName': 'api_key_query', - 'where': 'query', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(ModelClient); - _bodyData = _serializers.serialize(modelClient, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ModelClient _responseData; - - try { - const _responseType = FullType(ModelClient); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ModelClient; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart deleted file mode 100644 index a1d8a0fc2d..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/pet_api.dart +++ /dev/null @@ -1,755 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/pet.dart'; - -class PetApi { - - final Dio _dio; - - final Serializers _serializers; - - const PetApi(this._dio, this._serializers); - - /// Add a new pet to the store - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> addPet({ - required Pet pet, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Deletes a pet - /// - /// - /// Parameters: - /// * [petId] - Pet id to delete - /// * [apiKey] - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> deletePet({ - required int petId, - String? apiKey, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - if (apiKey != null) r'api_key': apiKey, - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Finds Pets by status - /// Multiple status values can be provided with comma separated strings - /// - /// Parameters: - /// * [status] - Status values that need to be considered for filter - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [BuiltList] as data - /// Throws [DioError] if API call or serialization fails - Future>> findPetsByStatus({ - required BuiltList status, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/findByStatus'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'status': encodeCollectionQueryParameter(_serializers, status, const FullType(BuiltList, [FullType(String)]), format: ListFormat.csv,), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - BuiltList _responseData; - - try { - const _responseType = FullType(BuiltList, [FullType(Pet)]); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as BuiltList; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Finds Pets by tags - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Parameters: - /// * [tags] - Tags to filter by - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [BuiltSet] as data - /// Throws [DioError] if API call or serialization fails - @Deprecated('This operation has been deprecated') - Future>> findPetsByTags({ - required BuiltSet tags, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/findByTags'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'tags': encodeCollectionQueryParameter(_serializers, tags, const FullType(BuiltSet, [FullType(String)]), format: ListFormat.csv,), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - BuiltSet _responseData; - - try { - const _responseType = FullType(BuiltSet, [FullType(Pet)]); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as BuiltSet; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Find pet by ID - /// Returns a single pet - /// - /// Parameters: - /// * [petId] - ID of pet to return - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Pet] as data - /// Throws [DioError] if API call or serialization fails - Future> getPetById({ - required int petId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Pet _responseData; - - try { - const _responseType = FullType(Pet); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Pet; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Update an existing pet - /// - /// - /// Parameters: - /// * [pet] - Pet object that needs to be added to the store - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> updatePet({ - required Pet pet, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet'; - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(Pet); - _bodyData = _serializers.serialize(pet, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Updates a pet in the store with form data - /// - /// - /// Parameters: - /// * [petId] - ID of pet that needs to be updated - /// * [name] - Updated name of the pet - /// * [status] - Updated status of the pet - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> updatePetWithForm({ - required int petId, - String? name, - String? status, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'application/x-www-form-urlencoded', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = { - if (name != null) r'name': encodeQueryParameter(_serializers, name, const FullType(String)), - if (status != null) r'status': encodeQueryParameter(_serializers, status, const FullType(String)), - }; - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// uploads an image - /// - /// - /// Parameters: - /// * [petId] - ID of pet to update - /// * [additionalMetadata] - Additional data to pass to server - /// * [file] - file to upload - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> uploadFile({ - required int petId, - String? additionalMetadata, - MultipartFile? file, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/pet/{petId}/uploadImage'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'multipart/form-data', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - if (file != null) r'file': file, - }); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse _responseData; - - try { - const _responseType = FullType(ApiResponse); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// uploads an image (required) - /// - /// - /// Parameters: - /// * [petId] - ID of pet to update - /// * [requiredFile] - file to upload - /// * [additionalMetadata] - Additional data to pass to server - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [ApiResponse] as data - /// Throws [DioError] if API call or serialization fails - Future> uploadFileWithRequiredFile({ - required int petId, - required MultipartFile requiredFile, - String? additionalMetadata, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/fake/{petId}/uploadImageWithRequiredFile'.replaceAll('{' r'petId' '}', petId.toString()); - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'oauth2', - 'name': 'petstore_auth', - }, - ], - ...?extra, - }, - contentType: 'multipart/form-data', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - _bodyData = FormData.fromMap({ - if (additionalMetadata != null) r'additionalMetadata': encodeFormParameter(_serializers, additionalMetadata, const FullType(String)), - r'requiredFile': requiredFile, - }); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - ApiResponse _responseData; - - try { - const _responseType = FullType(ApiResponse); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as ApiResponse; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart deleted file mode 100644 index bb10a12cbe..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/store_api.dart +++ /dev/null @@ -1,314 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/order.dart'; - -class StoreApi { - - final Dio _dio; - - final Serializers _serializers; - - const StoreApi(this._dio, this._serializers); - - /// Delete purchase order by ID - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// Parameters: - /// * [orderId] - ID of the order that needs to be deleted - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> deleteOrder({ - required String orderId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Returns pet inventories by status - /// Returns a map of status codes to quantities - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [BuiltMap] as data - /// Throws [DioError] if API call or serialization fails - Future>> getInventory({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/inventory'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[ - { - 'type': 'apiKey', - 'name': 'api_key', - 'keyName': 'api_key', - 'where': 'header', - }, - ], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - BuiltMap _responseData; - - try { - const _responseType = FullType(BuiltMap, [FullType(String), FullType(int)]); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as BuiltMap; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response>( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Find purchase order by ID - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// Parameters: - /// * [orderId] - ID of pet that needs to be fetched - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails - Future> getOrderById({ - required int orderId, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order/{order_id}'.replaceAll('{' r'order_id' '}', orderId.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Order _responseData; - - try { - const _responseType = FullType(Order); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Order; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Place an order for a pet - /// - /// - /// Parameters: - /// * [order] - order placed for purchasing the pet - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [Order] as data - /// Throws [DioError] if API call or serialization fails - Future> placeOrder({ - required Order order, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/store/order'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(Order); - _bodyData = _serializers.serialize(order, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - Order _responseData; - - try { - const _responseType = FullType(Order); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as Order; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart deleted file mode 100644 index e628b862c0..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api/user_api.dart +++ /dev/null @@ -1,532 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:async'; - -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/api_util.dart'; -import 'package:openapi/src/model/user.dart'; - -class UserApi { - - final Dio _dio; - - final Serializers _serializers; - - const UserApi(this._dio, this._serializers); - - /// Create user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [user] - Created user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> createUser({ - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Creates list of users with given input array - /// - /// - /// Parameters: - /// * [user] - List of user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> createUsersWithArrayInput({ - required BuiltList user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/createWithArray'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Creates list of users with given input array - /// - /// - /// Parameters: - /// * [user] - List of user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> createUsersWithListInput({ - required BuiltList user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/createWithList'; - final _options = Options( - method: r'POST', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(BuiltList, [FullType(User)]); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Delete user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [username] - The name that needs to be deleted - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> deleteUser({ - required String username, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'DELETE', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Get user by user name - /// - /// - /// Parameters: - /// * [username] - The name that needs to be fetched. Use user1 for testing. - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [User] as data - /// Throws [DioError] if API call or serialization fails - Future> getUserByName({ - required String username, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - User _responseData; - - try { - const _responseType = FullType(User); - _responseData = _serializers.deserialize( - _response.data!, - specifiedType: _responseType, - ) as User; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Logs user into the system - /// - /// - /// Parameters: - /// * [username] - The user name for login - /// * [password] - The password for login in clear text - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] containing a [Response] with a [String] as data - /// Throws [DioError] if API call or serialization fails - Future> loginUser({ - required String username, - required String password, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/login'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _queryParameters = { - r'username': encodeQueryParameter(_serializers, username, const FullType(String)), - r'password': encodeQueryParameter(_serializers, password, const FullType(String)), - }; - - final _response = await _dio.request( - _path, - options: _options, - queryParameters: _queryParameters, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - String _responseData; - - try { - _responseData = _response.data as String; - - } catch (error, stackTrace) { - throw DioError( - requestOptions: _response.requestOptions, - response: _response, - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - return Response( - data: _responseData, - headers: _response.headers, - isRedirect: _response.isRedirect, - requestOptions: _response.requestOptions, - redirects: _response.redirects, - statusCode: _response.statusCode, - statusMessage: _response.statusMessage, - extra: _response.extra, - ); - } - - /// Logs out current logged in user session - /// - /// - /// Parameters: - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> logoutUser({ - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/logout'; - final _options = Options( - method: r'GET', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - validateStatus: validateStatus, - ); - - final _response = await _dio.request( - _path, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - - /// Updated user - /// This can only be done by the logged in user. - /// - /// Parameters: - /// * [username] - name that need to be deleted - /// * [user] - Updated user object - /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation - /// * [headers] - Can be used to add additional headers to the request - /// * [extras] - Can be used to add flags to the request - /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response - /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress - /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress - /// - /// Returns a [Future] - /// Throws [DioError] if API call or serialization fails - Future> updateUser({ - required String username, - required User user, - CancelToken? cancelToken, - Map? headers, - Map? extra, - ValidateStatus? validateStatus, - ProgressCallback? onSendProgress, - ProgressCallback? onReceiveProgress, - }) async { - final _path = r'/user/{username}'.replaceAll('{' r'username' '}', username.toString()); - final _options = Options( - method: r'PUT', - headers: { - ...?headers, - }, - extra: { - 'secure': >[], - ...?extra, - }, - contentType: 'application/json', - validateStatus: validateStatus, - ); - - dynamic _bodyData; - - try { - const _type = FullType(User); - _bodyData = _serializers.serialize(user, specifiedType: _type); - - } catch(error, stackTrace) { - throw DioError( - requestOptions: _options.compose( - _dio.options, - _path, - ), - type: DioErrorType.other, - error: error, - )..stackTrace = stackTrace; - } - - final _response = await _dio.request( - _path, - data: _bodyData, - options: _options, - cancelToken: cancelToken, - onSendProgress: onSendProgress, - onReceiveProgress: onReceiveProgress, - ); - - return _response; - } - -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart deleted file mode 100644 index 5841689c37..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/api_util.dart +++ /dev/null @@ -1,78 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; -import 'dart:typed_data'; - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:dio_http/dio_http.dart'; -import 'package:dio_http/src/parameter.dart'; - -/// Format the given form parameter object into something that Dio can handle. -/// Returns primitive or String. -/// Returns List/Map if the value is BuildList/BuiltMap. -dynamic encodeFormParameter(Serializers serializers, dynamic value, FullType type) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized is String) { - return serialized; - } - if (value is BuiltList || value is BuiltSet || value is BuiltMap) { - return serialized; - } - return json.encode(serialized); -} - -dynamic encodeQueryParameter( - Serializers serializers, - dynamic value, - FullType type, -) { - if (value == null) { - return ''; - } - if (value is String || value is num || value is bool) { - return value; - } - if (value is Uint8List) { - // Currently not sure how to serialize this - return value; - } - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (serialized == null) { - return ''; - } - if (serialized is String) { - return serialized; - } - return serialized; -} - -ListParam encodeCollectionQueryParameter( - Serializers serializers, - dynamic value, - FullType type, { - ListFormat format = ListFormat.multi, -}) { - final serialized = serializers.serialize( - value as Object, - specifiedType: type, - ); - if (value is BuiltList || value is BuiltSet) { - return ListParam(List.of((serialized as Iterable).cast()), format); - } - throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter'); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart deleted file mode 100644 index ba24d7a2bc..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/api_key_auth.dart +++ /dev/null @@ -1,30 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class ApiKeyAuthInterceptor extends AuthInterceptor { - final Map apiKeys = {}; - - @override - void onRequest(RequestOptions options, RequestInterceptorHandler handler) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'apiKey'); - for (final info in authInfo) { - final authName = info['name'] as String; - final authKeyName = info['keyName'] as String; - final authWhere = info['where'] as String; - final apiKey = apiKeys[authName]; - if (apiKey != null) { - if (authWhere == 'query') { - options.queryParameters[authKeyName] = apiKey; - } else { - options.headers[authKeyName] = apiKey; - } - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart deleted file mode 100644 index e6dd5c4f6f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/auth.dart +++ /dev/null @@ -1,18 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; - -abstract class AuthInterceptor extends Interceptor { - /// Get auth information on given route for the given type. - /// Can return an empty list if type is not present on auth data or - /// if route doesn't need authentication. - List> getAuthInfo(RequestOptions route, bool Function(Map secure) handles) { - if (route.extra.containsKey('secure')) { - final auth = route.extra['secure'] as List>; - return auth.where((secure) => handles(secure)).toList(); - } - return []; - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart deleted file mode 100644 index 18ba52cefc..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/basic_auth.dart +++ /dev/null @@ -1,37 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:convert'; - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BasicAuthInfo { - final String username; - final String password; - - const BasicAuthInfo(this.username, this.password); -} - -class BasicAuthInterceptor extends AuthInterceptor { - final Map authInfo = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final metadataAuthInfo = getAuthInfo(options, (secure) => (secure['type'] == 'http' && secure['scheme'] == 'basic') || secure['type'] == 'basic'); - for (final info in metadataAuthInfo) { - final authName = info['name'] as String; - final basicAuthInfo = authInfo[authName]; - if (basicAuthInfo != null) { - final basicAuth = 'Basic ${base64Encode(utf8.encode('${basicAuthInfo.username}:${basicAuthInfo.password}'))}'; - options.headers['Authorization'] = basicAuth; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart deleted file mode 100644 index daa8171300..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/bearer_auth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class BearerAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'http' && secure['scheme'] == 'bearer'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart deleted file mode 100644 index 82140409b3..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/auth/oauth.dart +++ /dev/null @@ -1,26 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:dio_http/dio_http.dart'; -import 'package:openapi/src/auth/auth.dart'; - -class OAuthInterceptor extends AuthInterceptor { - final Map tokens = {}; - - @override - void onRequest( - RequestOptions options, - RequestInterceptorHandler handler, - ) { - final authInfo = getAuthInfo(options, (secure) => secure['type'] == 'oauth' || secure['type'] == 'oauth2'); - for (final info in authInfo) { - final token = tokens[info['name']]; - if (token != null) { - options.headers['Authorization'] = 'Bearer ${token}'; - break; - } - } - super.onRequest(options, handler); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart deleted file mode 100644 index db3c5c437d..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/date_serializer.dart +++ /dev/null @@ -1,31 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -class DateSerializer implements PrimitiveSerializer { - - const DateSerializer(); - - @override - Iterable get types => BuiltList.of([Date]); - - @override - String get wireName => 'Date'; - - @override - Date deserialize(Serializers serializers, Object serialized, - {FullType specifiedType = FullType.unspecified}) { - final parsed = DateTime.parse(serialized as String); - return Date(parsed.year, parsed.month, parsed.day); - } - - @override - Object serialize(Serializers serializers, Date date, - {FullType specifiedType = FullType.unspecified}) { - return date.toString(); - } -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart deleted file mode 100644 index 4d45be3abb..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/additional_properties_class.dart +++ /dev/null @@ -1,87 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'additional_properties_class.g.dart'; - -/// AdditionalPropertiesClass -/// -/// Properties: -/// * [mapProperty] -/// * [mapOfMapProperty] -abstract class AdditionalPropertiesClass implements Built { - @BuiltValueField(wireName: r'map_property') - BuiltMap? get mapProperty; - - @BuiltValueField(wireName: r'map_of_map_property') - BuiltMap>? get mapOfMapProperty; - - AdditionalPropertiesClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(AdditionalPropertiesClassBuilder b) => b; - - factory AdditionalPropertiesClass([void updates(AdditionalPropertiesClassBuilder b)]) = _$AdditionalPropertiesClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AdditionalPropertiesClassSerializer(); -} - -class _$AdditionalPropertiesClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [AdditionalPropertiesClass, _$AdditionalPropertiesClass]; - - @override - final String wireName = r'AdditionalPropertiesClass'; - - @override - Iterable serialize(Serializers serializers, AdditionalPropertiesClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.mapProperty != null) { - result - ..add(r'map_property') - ..add(serializers.serialize(object.mapProperty, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)]))); - } - if (object.mapOfMapProperty != null) { - result - ..add(r'map_of_map_property') - ..add(serializers.serialize(object.mapOfMapProperty, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]))); - } - return result; - } - - @override - AdditionalPropertiesClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = AdditionalPropertiesClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'map_property': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(String)])) as BuiltMap; - result.mapProperty.replace(valueDes); - break; - case r'map_of_map_property': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])) as BuiltMap>; - result.mapOfMapProperty.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart deleted file mode 100644 index cd9084ceb2..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/animal.dart +++ /dev/null @@ -1,85 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'animal.g.dart'; - -/// Animal -/// -/// Properties: -/// * [className] -/// * [color] -abstract class Animal implements Built { - @BuiltValueField(wireName: r'className') - String get className; - - @BuiltValueField(wireName: r'color') - String? get color; - - Animal._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(AnimalBuilder b) => b - ..color = 'red'; - - factory Animal([void updates(AnimalBuilder b)]) = _$Animal; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$AnimalSerializer(); -} - -class _$AnimalSerializer implements StructuredSerializer { - @override - final Iterable types = const [Animal, _$Animal]; - - @override - final String wireName = r'Animal'; - - @override - Iterable serialize(Serializers serializers, Animal object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'className') - ..add(serializers.serialize(object.className, - specifiedType: const FullType(String))); - if (object.color != null) { - result - ..add(r'color') - ..add(serializers.serialize(object.color, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Animal deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = AnimalBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'className': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.className = valueDes; - break; - case r'color': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.color = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart deleted file mode 100644 index c2ebff7ffe..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/api_response.dart +++ /dev/null @@ -1,101 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'api_response.g.dart'; - -/// ApiResponse -/// -/// Properties: -/// * [code] -/// * [type] -/// * [message] -abstract class ApiResponse implements Built { - @BuiltValueField(wireName: r'code') - int? get code; - - @BuiltValueField(wireName: r'type') - String? get type; - - @BuiltValueField(wireName: r'message') - String? get message; - - ApiResponse._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ApiResponseBuilder b) => b; - - factory ApiResponse([void updates(ApiResponseBuilder b)]) = _$ApiResponse; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ApiResponseSerializer(); -} - -class _$ApiResponseSerializer implements StructuredSerializer { - @override - final Iterable types = const [ApiResponse, _$ApiResponse]; - - @override - final String wireName = r'ApiResponse'; - - @override - Iterable serialize(Serializers serializers, ApiResponse object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.code != null) { - result - ..add(r'code') - ..add(serializers.serialize(object.code, - specifiedType: const FullType(int))); - } - if (object.type != null) { - result - ..add(r'type') - ..add(serializers.serialize(object.type, - specifiedType: const FullType(String))); - } - if (object.message != null) { - result - ..add(r'message') - ..add(serializers.serialize(object.message, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ApiResponse deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ApiResponseBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'code': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.code = valueDes; - break; - case r'type': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.type = valueDes; - break; - case r'message': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.message = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart deleted file mode 100644 index 1fa583bccc..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_array_of_number_only.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'array_of_array_of_number_only.g.dart'; - -/// ArrayOfArrayOfNumberOnly -/// -/// Properties: -/// * [arrayArrayNumber] -abstract class ArrayOfArrayOfNumberOnly implements Built { - @BuiltValueField(wireName: r'ArrayArrayNumber') - BuiltList>? get arrayArrayNumber; - - ArrayOfArrayOfNumberOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ArrayOfArrayOfNumberOnlyBuilder b) => b; - - factory ArrayOfArrayOfNumberOnly([void updates(ArrayOfArrayOfNumberOnlyBuilder b)]) = _$ArrayOfArrayOfNumberOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfArrayOfNumberOnlySerializer(); -} - -class _$ArrayOfArrayOfNumberOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [ArrayOfArrayOfNumberOnly, _$ArrayOfArrayOfNumberOnly]; - - @override - final String wireName = r'ArrayOfArrayOfNumberOnly'; - - @override - Iterable serialize(Serializers serializers, ArrayOfArrayOfNumberOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.arrayArrayNumber != null) { - result - ..add(r'ArrayArrayNumber') - ..add(serializers.serialize(object.arrayArrayNumber, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])]))); - } - return result; - } - - @override - ArrayOfArrayOfNumberOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ArrayOfArrayOfNumberOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'ArrayArrayNumber': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(num)])])) as BuiltList>; - result.arrayArrayNumber.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart deleted file mode 100644 index fcbd7d393b..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_of_number_only.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'array_of_number_only.g.dart'; - -/// ArrayOfNumberOnly -/// -/// Properties: -/// * [arrayNumber] -abstract class ArrayOfNumberOnly implements Built { - @BuiltValueField(wireName: r'ArrayNumber') - BuiltList? get arrayNumber; - - ArrayOfNumberOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ArrayOfNumberOnlyBuilder b) => b; - - factory ArrayOfNumberOnly([void updates(ArrayOfNumberOnlyBuilder b)]) = _$ArrayOfNumberOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayOfNumberOnlySerializer(); -} - -class _$ArrayOfNumberOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [ArrayOfNumberOnly, _$ArrayOfNumberOnly]; - - @override - final String wireName = r'ArrayOfNumberOnly'; - - @override - Iterable serialize(Serializers serializers, ArrayOfNumberOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.arrayNumber != null) { - result - ..add(r'ArrayNumber') - ..add(serializers.serialize(object.arrayNumber, - specifiedType: const FullType(BuiltList, [FullType(num)]))); - } - return result; - } - - @override - ArrayOfNumberOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ArrayOfNumberOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'ArrayNumber': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(num)])) as BuiltList; - result.arrayNumber.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart deleted file mode 100644 index 8025d141c1..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/array_test.dart +++ /dev/null @@ -1,103 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'array_test.g.dart'; - -/// ArrayTest -/// -/// Properties: -/// * [arrayOfString] -/// * [arrayArrayOfInteger] -/// * [arrayArrayOfModel] -abstract class ArrayTest implements Built { - @BuiltValueField(wireName: r'array_of_string') - BuiltList? get arrayOfString; - - @BuiltValueField(wireName: r'array_array_of_integer') - BuiltList>? get arrayArrayOfInteger; - - @BuiltValueField(wireName: r'array_array_of_model') - BuiltList>? get arrayArrayOfModel; - - ArrayTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ArrayTestBuilder b) => b; - - factory ArrayTest([void updates(ArrayTestBuilder b)]) = _$ArrayTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ArrayTestSerializer(); -} - -class _$ArrayTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [ArrayTest, _$ArrayTest]; - - @override - final String wireName = r'ArrayTest'; - - @override - Iterable serialize(Serializers serializers, ArrayTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.arrayOfString != null) { - result - ..add(r'array_of_string') - ..add(serializers.serialize(object.arrayOfString, - specifiedType: const FullType(BuiltList, [FullType(String)]))); - } - if (object.arrayArrayOfInteger != null) { - result - ..add(r'array_array_of_integer') - ..add(serializers.serialize(object.arrayArrayOfInteger, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])]))); - } - if (object.arrayArrayOfModel != null) { - result - ..add(r'array_array_of_model') - ..add(serializers.serialize(object.arrayArrayOfModel, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])]))); - } - return result; - } - - @override - ArrayTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ArrayTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'array_of_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(String)])) as BuiltList; - result.arrayOfString.replace(valueDes); - break; - case r'array_array_of_integer': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(int)])])) as BuiltList>; - result.arrayArrayOfInteger.replace(valueDes); - break; - case r'array_array_of_model': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(BuiltList, [FullType(ReadOnlyFirst)])])) as BuiltList>; - result.arrayArrayOfModel.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart deleted file mode 100644 index 15a8f080e9..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/capitalization.dart +++ /dev/null @@ -1,147 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'capitalization.g.dart'; - -/// Capitalization -/// -/// Properties: -/// * [smallCamel] -/// * [capitalCamel] -/// * [smallSnake] -/// * [capitalSnake] -/// * [sCAETHFlowPoints] -/// * [ATT_NAME] - Name of the pet -abstract class Capitalization implements Built { - @BuiltValueField(wireName: r'smallCamel') - String? get smallCamel; - - @BuiltValueField(wireName: r'CapitalCamel') - String? get capitalCamel; - - @BuiltValueField(wireName: r'small_Snake') - String? get smallSnake; - - @BuiltValueField(wireName: r'Capital_Snake') - String? get capitalSnake; - - @BuiltValueField(wireName: r'SCA_ETH_Flow_Points') - String? get sCAETHFlowPoints; - - /// Name of the pet - @BuiltValueField(wireName: r'ATT_NAME') - String? get ATT_NAME; - - Capitalization._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CapitalizationBuilder b) => b; - - factory Capitalization([void updates(CapitalizationBuilder b)]) = _$Capitalization; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CapitalizationSerializer(); -} - -class _$CapitalizationSerializer implements StructuredSerializer { - @override - final Iterable types = const [Capitalization, _$Capitalization]; - - @override - final String wireName = r'Capitalization'; - - @override - Iterable serialize(Serializers serializers, Capitalization object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.smallCamel != null) { - result - ..add(r'smallCamel') - ..add(serializers.serialize(object.smallCamel, - specifiedType: const FullType(String))); - } - if (object.capitalCamel != null) { - result - ..add(r'CapitalCamel') - ..add(serializers.serialize(object.capitalCamel, - specifiedType: const FullType(String))); - } - if (object.smallSnake != null) { - result - ..add(r'small_Snake') - ..add(serializers.serialize(object.smallSnake, - specifiedType: const FullType(String))); - } - if (object.capitalSnake != null) { - result - ..add(r'Capital_Snake') - ..add(serializers.serialize(object.capitalSnake, - specifiedType: const FullType(String))); - } - if (object.sCAETHFlowPoints != null) { - result - ..add(r'SCA_ETH_Flow_Points') - ..add(serializers.serialize(object.sCAETHFlowPoints, - specifiedType: const FullType(String))); - } - if (object.ATT_NAME != null) { - result - ..add(r'ATT_NAME') - ..add(serializers.serialize(object.ATT_NAME, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Capitalization deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CapitalizationBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'smallCamel': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.smallCamel = valueDes; - break; - case r'CapitalCamel': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.capitalCamel = valueDes; - break; - case r'small_Snake': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.smallSnake = valueDes; - break; - case r'Capital_Snake': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.capitalSnake = valueDes; - break; - case r'SCA_ETH_Flow_Points': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.sCAETHFlowPoints = valueDes; - break; - case r'ATT_NAME': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.ATT_NAME = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart deleted file mode 100644 index 2c90578361..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat.dart +++ /dev/null @@ -1,104 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/animal.dart'; -import 'package:openapi/src/model/cat_all_of.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'cat.g.dart'; - -// ignore_for_file: unused_import - -/// Cat -/// -/// Properties: -/// * [className] -/// * [color] -/// * [declawed] -abstract class Cat implements Built { - @BuiltValueField(wireName: r'className') - String get className; - - @BuiltValueField(wireName: r'color') - String? get color; - - @BuiltValueField(wireName: r'declawed') - bool? get declawed; - - Cat._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatBuilder b) => b - ..color = 'red'; - - factory Cat([void updates(CatBuilder b)]) = _$Cat; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CatSerializer(); -} - -class _$CatSerializer implements StructuredSerializer { - @override - final Iterable types = const [Cat, _$Cat]; - - @override - final String wireName = r'Cat'; - - @override - Iterable serialize(Serializers serializers, Cat object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'className') - ..add(serializers.serialize(object.className, - specifiedType: const FullType(String))); - if (object.color != null) { - result - ..add(r'color') - ..add(serializers.serialize(object.color, - specifiedType: const FullType(String))); - } - if (object.declawed != null) { - result - ..add(r'declawed') - ..add(serializers.serialize(object.declawed, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - Cat deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CatBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'className': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.className = valueDes; - break; - case r'color': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.color = valueDes; - break; - case r'declawed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.declawed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart deleted file mode 100644 index 1734098fe2..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/cat_all_of.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'cat_all_of.g.dart'; - -/// CatAllOf -/// -/// Properties: -/// * [declawed] -abstract class CatAllOf implements Built { - @BuiltValueField(wireName: r'declawed') - bool? get declawed; - - CatAllOf._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CatAllOfBuilder b) => b; - - factory CatAllOf([void updates(CatAllOfBuilder b)]) = _$CatAllOf; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CatAllOfSerializer(); -} - -class _$CatAllOfSerializer implements StructuredSerializer { - @override - final Iterable types = const [CatAllOf, _$CatAllOf]; - - @override - final String wireName = r'CatAllOf'; - - @override - Iterable serialize(Serializers serializers, CatAllOf object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.declawed != null) { - result - ..add(r'declawed') - ..add(serializers.serialize(object.declawed, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - CatAllOf deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CatAllOfBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'declawed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.declawed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart deleted file mode 100644 index 9ee9a94a3e..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/category.dart +++ /dev/null @@ -1,85 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'category.g.dart'; - -/// Category -/// -/// Properties: -/// * [id] -/// * [name] -abstract class Category implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'name') - String get name; - - Category._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(CategoryBuilder b) => b - ..name = 'default-name'; - - factory Category([void updates(CategoryBuilder b)]) = _$Category; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$CategorySerializer(); -} - -class _$CategorySerializer implements StructuredSerializer { - @override - final Iterable types = const [Category, _$Category]; - - @override - final String wireName = r'Category'; - - @override - Iterable serialize(Serializers serializers, Category object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - return result; - } - - @override - Category deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = CategoryBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart deleted file mode 100644 index ca90835c83..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/class_model.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'class_model.g.dart'; - -/// Model for testing model with \"_class\" property -/// -/// Properties: -/// * [class_] -abstract class ClassModel implements Built { - @BuiltValueField(wireName: r'_class') - String? get class_; - - ClassModel._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ClassModelBuilder b) => b; - - factory ClassModel([void updates(ClassModelBuilder b)]) = _$ClassModel; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ClassModelSerializer(); -} - -class _$ClassModelSerializer implements StructuredSerializer { - @override - final Iterable types = const [ClassModel, _$ClassModel]; - - @override - final String wireName = r'ClassModel'; - - @override - Iterable serialize(Serializers serializers, ClassModel object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.class_ != null) { - result - ..add(r'_class') - ..add(serializers.serialize(object.class_, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ClassModel deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ClassModelBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'_class': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.class_ = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart deleted file mode 100644 index b21c7f544b..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/date.dart +++ /dev/null @@ -1,70 +0,0 @@ -/// A gregorian calendar date generated by -/// OpenAPI generator to differentiate -/// between [DateTime] and [Date] formats. -class Date implements Comparable { - final int year; - - /// January is 1. - final int month; - - /// First day is 1. - final int day; - - Date(this.year, this.month, this.day); - - /// The current date - static Date now({bool utc = false}) { - var now = DateTime.now(); - if (utc) { - now = now.toUtc(); - } - return now.toDate(); - } - - /// Convert to a [DateTime]. - DateTime toDateTime({bool utc = false}) { - if (utc) { - return DateTime.utc(year, month, day); - } else { - return DateTime(year, month, day); - } - } - - @override - int compareTo(Date other) { - int d = year.compareTo(other.year); - if (d != 0) { - return d; - } - d = month.compareTo(other.month); - if (d != 0) { - return d; - } - return day.compareTo(other.day); - } - - @override - bool operator ==(Object other) => - identical(this, other) || - other is Date && - runtimeType == other.runtimeType && - year == other.year && - month == other.month && - day == other.day; - - @override - int get hashCode => year.hashCode ^ month.hashCode ^ day.hashCode; - - @override - String toString() { - final yyyy = year.toString(); - final mm = month.toString().padLeft(2, '0'); - final dd = day.toString().padLeft(2, '0'); - - return '$yyyy-$mm-$dd'; - } -} - -extension DateTimeToDate on DateTime { - Date toDate() => Date(year, month, day); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart deleted file mode 100644 index 98db39b4f4..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/deprecated_object.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'deprecated_object.g.dart'; - -/// DeprecatedObject -/// -/// Properties: -/// * [name] -abstract class DeprecatedObject implements Built { - @BuiltValueField(wireName: r'name') - String? get name; - - DeprecatedObject._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(DeprecatedObjectBuilder b) => b; - - factory DeprecatedObject([void updates(DeprecatedObjectBuilder b)]) = _$DeprecatedObject; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DeprecatedObjectSerializer(); -} - -class _$DeprecatedObjectSerializer implements StructuredSerializer { - @override - final Iterable types = const [DeprecatedObject, _$DeprecatedObject]; - - @override - final String wireName = r'DeprecatedObject'; - - @override - Iterable serialize(Serializers serializers, DeprecatedObject object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.name != null) { - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - } - return result; - } - - @override - DeprecatedObject deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = DeprecatedObjectBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart deleted file mode 100644 index 9e36ec77bd..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog.dart +++ /dev/null @@ -1,104 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/dog_all_of.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'dog.g.dart'; - -// ignore_for_file: unused_import - -/// Dog -/// -/// Properties: -/// * [className] -/// * [color] -/// * [breed] -abstract class Dog implements Built { - @BuiltValueField(wireName: r'className') - String get className; - - @BuiltValueField(wireName: r'color') - String? get color; - - @BuiltValueField(wireName: r'breed') - String? get breed; - - Dog._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogBuilder b) => b - ..color = 'red'; - - factory Dog([void updates(DogBuilder b)]) = _$Dog; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DogSerializer(); -} - -class _$DogSerializer implements StructuredSerializer { - @override - final Iterable types = const [Dog, _$Dog]; - - @override - final String wireName = r'Dog'; - - @override - Iterable serialize(Serializers serializers, Dog object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'className') - ..add(serializers.serialize(object.className, - specifiedType: const FullType(String))); - if (object.color != null) { - result - ..add(r'color') - ..add(serializers.serialize(object.color, - specifiedType: const FullType(String))); - } - if (object.breed != null) { - result - ..add(r'breed') - ..add(serializers.serialize(object.breed, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Dog deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = DogBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'className': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.className = valueDes; - break; - case r'color': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.color = valueDes; - break; - case r'breed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.breed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart deleted file mode 100644 index 23387e4da7..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/dog_all_of.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'dog_all_of.g.dart'; - -/// DogAllOf -/// -/// Properties: -/// * [breed] -abstract class DogAllOf implements Built { - @BuiltValueField(wireName: r'breed') - String? get breed; - - DogAllOf._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(DogAllOfBuilder b) => b; - - factory DogAllOf([void updates(DogAllOfBuilder b)]) = _$DogAllOf; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$DogAllOfSerializer(); -} - -class _$DogAllOfSerializer implements StructuredSerializer { - @override - final Iterable types = const [DogAllOf, _$DogAllOf]; - - @override - final String wireName = r'DogAllOf'; - - @override - Iterable serialize(Serializers serializers, DogAllOf object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.breed != null) { - result - ..add(r'breed') - ..add(serializers.serialize(object.breed, - specifiedType: const FullType(String))); - } - return result; - } - - @override - DogAllOf deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = DogAllOfBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'breed': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.breed = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart deleted file mode 100644 index bda9790c10..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_arrays.dart +++ /dev/null @@ -1,119 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'enum_arrays.g.dart'; - -/// EnumArrays -/// -/// Properties: -/// * [justSymbol] -/// * [arrayEnum] -abstract class EnumArrays implements Built { - @BuiltValueField(wireName: r'just_symbol') - EnumArraysJustSymbolEnum? get justSymbol; - // enum justSymbolEnum { >=, $, }; - - @BuiltValueField(wireName: r'array_enum') - BuiltList? get arrayEnum; - // enum arrayEnumEnum { fish, crab, }; - - EnumArrays._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(EnumArraysBuilder b) => b; - - factory EnumArrays([void updates(EnumArraysBuilder b)]) = _$EnumArrays; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$EnumArraysSerializer(); -} - -class _$EnumArraysSerializer implements StructuredSerializer { - @override - final Iterable types = const [EnumArrays, _$EnumArrays]; - - @override - final String wireName = r'EnumArrays'; - - @override - Iterable serialize(Serializers serializers, EnumArrays object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.justSymbol != null) { - result - ..add(r'just_symbol') - ..add(serializers.serialize(object.justSymbol, - specifiedType: const FullType(EnumArraysJustSymbolEnum))); - } - if (object.arrayEnum != null) { - result - ..add(r'array_enum') - ..add(serializers.serialize(object.arrayEnum, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)]))); - } - return result; - } - - @override - EnumArrays deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = EnumArraysBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'just_symbol': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumArraysJustSymbolEnum)) as EnumArraysJustSymbolEnum; - result.justSymbol = valueDes; - break; - case r'array_enum': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(EnumArraysArrayEnumEnum)])) as BuiltList; - result.arrayEnum.replace(valueDes); - break; - } - } - return result.build(); - } -} - -class EnumArraysJustSymbolEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'>=') - static const EnumArraysJustSymbolEnum greaterThanEqual = _$enumArraysJustSymbolEnum_greaterThanEqual; - @BuiltValueEnumConst(wireName: r'$') - static const EnumArraysJustSymbolEnum dollar = _$enumArraysJustSymbolEnum_dollar; - - static Serializer get serializer => _$enumArraysJustSymbolEnumSerializer; - - const EnumArraysJustSymbolEnum._(String name): super(name); - - static BuiltSet get values => _$enumArraysJustSymbolEnumValues; - static EnumArraysJustSymbolEnum valueOf(String name) => _$enumArraysJustSymbolEnumValueOf(name); -} - -class EnumArraysArrayEnumEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'fish') - static const EnumArraysArrayEnumEnum fish = _$enumArraysArrayEnumEnum_fish; - @BuiltValueEnumConst(wireName: r'crab') - static const EnumArraysArrayEnumEnum crab = _$enumArraysArrayEnumEnum_crab; - - static Serializer get serializer => _$enumArraysArrayEnumEnumSerializer; - - const EnumArraysArrayEnumEnum._(String name): super(name); - - static BuiltSet get values => _$enumArraysArrayEnumEnumValues; - static EnumArraysArrayEnumEnum valueOf(String name) => _$enumArraysArrayEnumEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart deleted file mode 100644 index 7ca76d22fe..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/enum_test.dart +++ /dev/null @@ -1,252 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/outer_enum.dart'; -import 'package:openapi/src/model/outer_enum_default_value.dart'; -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'enum_test.g.dart'; - -/// EnumTest -/// -/// Properties: -/// * [enumString] -/// * [enumStringRequired] -/// * [enumInteger] -/// * [enumNumber] -/// * [outerEnum] -/// * [outerEnumInteger] -/// * [outerEnumDefaultValue] -/// * [outerEnumIntegerDefaultValue] -abstract class EnumTest implements Built { - @BuiltValueField(wireName: r'enum_string') - EnumTestEnumStringEnum? get enumString; - // enum enumStringEnum { UPPER, lower, , }; - - @BuiltValueField(wireName: r'enum_string_required') - EnumTestEnumStringRequiredEnum get enumStringRequired; - // enum enumStringRequiredEnum { UPPER, lower, , }; - - @BuiltValueField(wireName: r'enum_integer') - EnumTestEnumIntegerEnum? get enumInteger; - // enum enumIntegerEnum { 1, -1, }; - - @BuiltValueField(wireName: r'enum_number') - EnumTestEnumNumberEnum? get enumNumber; - // enum enumNumberEnum { 1.1, -1.2, }; - - @BuiltValueField(wireName: r'outerEnum') - OuterEnum? get outerEnum; - // enum outerEnumEnum { placed, approved, delivered, }; - - @BuiltValueField(wireName: r'outerEnumInteger') - OuterEnumInteger? get outerEnumInteger; - // enum outerEnumIntegerEnum { 0, 1, 2, }; - - @BuiltValueField(wireName: r'outerEnumDefaultValue') - OuterEnumDefaultValue? get outerEnumDefaultValue; - // enum outerEnumDefaultValueEnum { placed, approved, delivered, }; - - @BuiltValueField(wireName: r'outerEnumIntegerDefaultValue') - OuterEnumIntegerDefaultValue? get outerEnumIntegerDefaultValue; - // enum outerEnumIntegerDefaultValueEnum { 0, 1, 2, }; - - EnumTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(EnumTestBuilder b) => b; - - factory EnumTest([void updates(EnumTestBuilder b)]) = _$EnumTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$EnumTestSerializer(); -} - -class _$EnumTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [EnumTest, _$EnumTest]; - - @override - final String wireName = r'EnumTest'; - - @override - Iterable serialize(Serializers serializers, EnumTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.enumString != null) { - result - ..add(r'enum_string') - ..add(serializers.serialize(object.enumString, - specifiedType: const FullType(EnumTestEnumStringEnum))); - } - result - ..add(r'enum_string_required') - ..add(serializers.serialize(object.enumStringRequired, - specifiedType: const FullType(EnumTestEnumStringRequiredEnum))); - if (object.enumInteger != null) { - result - ..add(r'enum_integer') - ..add(serializers.serialize(object.enumInteger, - specifiedType: const FullType(EnumTestEnumIntegerEnum))); - } - if (object.enumNumber != null) { - result - ..add(r'enum_number') - ..add(serializers.serialize(object.enumNumber, - specifiedType: const FullType(EnumTestEnumNumberEnum))); - } - if (object.outerEnum != null) { - result - ..add(r'outerEnum') - ..add(serializers.serialize(object.outerEnum, - specifiedType: const FullType.nullable(OuterEnum))); - } - if (object.outerEnumInteger != null) { - result - ..add(r'outerEnumInteger') - ..add(serializers.serialize(object.outerEnumInteger, - specifiedType: const FullType(OuterEnumInteger))); - } - if (object.outerEnumDefaultValue != null) { - result - ..add(r'outerEnumDefaultValue') - ..add(serializers.serialize(object.outerEnumDefaultValue, - specifiedType: const FullType(OuterEnumDefaultValue))); - } - if (object.outerEnumIntegerDefaultValue != null) { - result - ..add(r'outerEnumIntegerDefaultValue') - ..add(serializers.serialize(object.outerEnumIntegerDefaultValue, - specifiedType: const FullType(OuterEnumIntegerDefaultValue))); - } - return result; - } - - @override - EnumTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = EnumTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'enum_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumStringEnum)) as EnumTestEnumStringEnum; - result.enumString = valueDes; - break; - case r'enum_string_required': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumStringRequiredEnum)) as EnumTestEnumStringRequiredEnum; - result.enumStringRequired = valueDes; - break; - case r'enum_integer': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumIntegerEnum)) as EnumTestEnumIntegerEnum; - result.enumInteger = valueDes; - break; - case r'enum_number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(EnumTestEnumNumberEnum)) as EnumTestEnumNumberEnum; - result.enumNumber = valueDes; - break; - case r'outerEnum': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(OuterEnum)) as OuterEnum?; - if (valueDes == null) continue; - result.outerEnum = valueDes; - break; - case r'outerEnumInteger': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumInteger)) as OuterEnumInteger; - result.outerEnumInteger = valueDes; - break; - case r'outerEnumDefaultValue': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumDefaultValue)) as OuterEnumDefaultValue; - result.outerEnumDefaultValue = valueDes; - break; - case r'outerEnumIntegerDefaultValue': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumIntegerDefaultValue)) as OuterEnumIntegerDefaultValue; - result.outerEnumIntegerDefaultValue = valueDes; - break; - } - } - return result.build(); - } -} - -class EnumTestEnumStringEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringEnum UPPER = _$enumTestEnumStringEnum_UPPER; - @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringEnum lower = _$enumTestEnumStringEnum_lower; - @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringEnum empty = _$enumTestEnumStringEnum_empty; - - static Serializer get serializer => _$enumTestEnumStringEnumSerializer; - - const EnumTestEnumStringEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumStringEnumValues; - static EnumTestEnumStringEnum valueOf(String name) => _$enumTestEnumStringEnumValueOf(name); -} - -class EnumTestEnumStringRequiredEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'UPPER') - static const EnumTestEnumStringRequiredEnum UPPER = _$enumTestEnumStringRequiredEnum_UPPER; - @BuiltValueEnumConst(wireName: r'lower') - static const EnumTestEnumStringRequiredEnum lower = _$enumTestEnumStringRequiredEnum_lower; - @BuiltValueEnumConst(wireName: r'') - static const EnumTestEnumStringRequiredEnum empty = _$enumTestEnumStringRequiredEnum_empty; - - static Serializer get serializer => _$enumTestEnumStringRequiredEnumSerializer; - - const EnumTestEnumStringRequiredEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumStringRequiredEnumValues; - static EnumTestEnumStringRequiredEnum valueOf(String name) => _$enumTestEnumStringRequiredEnumValueOf(name); -} - -class EnumTestEnumIntegerEnum extends EnumClass { - - @BuiltValueEnumConst(wireNumber: 1) - static const EnumTestEnumIntegerEnum number1 = _$enumTestEnumIntegerEnum_number1; - @BuiltValueEnumConst(wireNumber: -1) - static const EnumTestEnumIntegerEnum numberNegative1 = _$enumTestEnumIntegerEnum_numberNegative1; - - static Serializer get serializer => _$enumTestEnumIntegerEnumSerializer; - - const EnumTestEnumIntegerEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumIntegerEnumValues; - static EnumTestEnumIntegerEnum valueOf(String name) => _$enumTestEnumIntegerEnumValueOf(name); -} - -class EnumTestEnumNumberEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'1.1') - static const EnumTestEnumNumberEnum number1Period1 = _$enumTestEnumNumberEnum_number1Period1; - @BuiltValueEnumConst(wireName: r'-1.2') - static const EnumTestEnumNumberEnum numberNegative1Period2 = _$enumTestEnumNumberEnum_numberNegative1Period2; - - static Serializer get serializer => _$enumTestEnumNumberEnumSerializer; - - const EnumTestEnumNumberEnum._(String name): super(name); - - static BuiltSet get values => _$enumTestEnumNumberEnumValues; - static EnumTestEnumNumberEnum valueOf(String name) => _$enumTestEnumNumberEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart deleted file mode 100644 index 7a2090e87d..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/file_schema_test_class.dart +++ /dev/null @@ -1,88 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/model_file.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'file_schema_test_class.g.dart'; - -/// FileSchemaTestClass -/// -/// Properties: -/// * [file] -/// * [files] -abstract class FileSchemaTestClass implements Built { - @BuiltValueField(wireName: r'file') - ModelFile? get file; - - @BuiltValueField(wireName: r'files') - BuiltList? get files; - - FileSchemaTestClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FileSchemaTestClassBuilder b) => b; - - factory FileSchemaTestClass([void updates(FileSchemaTestClassBuilder b)]) = _$FileSchemaTestClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FileSchemaTestClassSerializer(); -} - -class _$FileSchemaTestClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [FileSchemaTestClass, _$FileSchemaTestClass]; - - @override - final String wireName = r'FileSchemaTestClass'; - - @override - Iterable serialize(Serializers serializers, FileSchemaTestClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.file != null) { - result - ..add(r'file') - ..add(serializers.serialize(object.file, - specifiedType: const FullType(ModelFile))); - } - if (object.files != null) { - result - ..add(r'files') - ..add(serializers.serialize(object.files, - specifiedType: const FullType(BuiltList, [FullType(ModelFile)]))); - } - return result; - } - - @override - FileSchemaTestClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = FileSchemaTestClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'file': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(ModelFile)) as ModelFile; - result.file.replace(valueDes); - break; - case r'files': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(ModelFile)])) as BuiltList; - result.files.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart deleted file mode 100644 index dd3691968d..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/foo.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'foo.g.dart'; - -/// Foo -/// -/// Properties: -/// * [bar] -abstract class Foo implements Built { - @BuiltValueField(wireName: r'bar') - String? get bar; - - Foo._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FooBuilder b) => b - ..bar = 'bar'; - - factory Foo([void updates(FooBuilder b)]) = _$Foo; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FooSerializer(); -} - -class _$FooSerializer implements StructuredSerializer { - @override - final Iterable types = const [Foo, _$Foo]; - - @override - final String wireName = r'Foo'; - - @override - Iterable serialize(Serializers serializers, Foo object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.bar != null) { - result - ..add(r'bar') - ..add(serializers.serialize(object.bar, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Foo deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = FooBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'bar': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.bar = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart deleted file mode 100644 index cf1be44ab5..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/format_test.dart +++ /dev/null @@ -1,292 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'dart:typed_data'; -import 'package:openapi/src/model/date.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'format_test.g.dart'; - -/// FormatTest -/// -/// Properties: -/// * [integer] -/// * [int32] -/// * [int64] -/// * [number] -/// * [float] -/// * [double_] -/// * [decimal] -/// * [string] -/// * [byte] -/// * [binary] -/// * [date] -/// * [dateTime] -/// * [uuid] -/// * [password] -/// * [patternWithDigits] - A string that is a 10 digit number. Can have leading zeros. -/// * [patternWithDigitsAndDelimiter] - A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. -abstract class FormatTest implements Built { - @BuiltValueField(wireName: r'integer') - int? get integer; - - @BuiltValueField(wireName: r'int32') - int? get int32; - - @BuiltValueField(wireName: r'int64') - int? get int64; - - @BuiltValueField(wireName: r'number') - num get number; - - @BuiltValueField(wireName: r'float') - double? get float; - - @BuiltValueField(wireName: r'double') - double? get double_; - - @BuiltValueField(wireName: r'decimal') - double? get decimal; - - @BuiltValueField(wireName: r'string') - String? get string; - - @BuiltValueField(wireName: r'byte') - String get byte; - - @BuiltValueField(wireName: r'binary') - Uint8List? get binary; - - @BuiltValueField(wireName: r'date') - Date get date; - - @BuiltValueField(wireName: r'dateTime') - DateTime? get dateTime; - - @BuiltValueField(wireName: r'uuid') - String? get uuid; - - @BuiltValueField(wireName: r'password') - String get password; - - /// A string that is a 10 digit number. Can have leading zeros. - @BuiltValueField(wireName: r'pattern_with_digits') - String? get patternWithDigits; - - /// A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - @BuiltValueField(wireName: r'pattern_with_digits_and_delimiter') - String? get patternWithDigitsAndDelimiter; - - FormatTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(FormatTestBuilder b) => b; - - factory FormatTest([void updates(FormatTestBuilder b)]) = _$FormatTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$FormatTestSerializer(); -} - -class _$FormatTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [FormatTest, _$FormatTest]; - - @override - final String wireName = r'FormatTest'; - - @override - Iterable serialize(Serializers serializers, FormatTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.integer != null) { - result - ..add(r'integer') - ..add(serializers.serialize(object.integer, - specifiedType: const FullType(int))); - } - if (object.int32 != null) { - result - ..add(r'int32') - ..add(serializers.serialize(object.int32, - specifiedType: const FullType(int))); - } - if (object.int64 != null) { - result - ..add(r'int64') - ..add(serializers.serialize(object.int64, - specifiedType: const FullType(int))); - } - result - ..add(r'number') - ..add(serializers.serialize(object.number, - specifiedType: const FullType(num))); - if (object.float != null) { - result - ..add(r'float') - ..add(serializers.serialize(object.float, - specifiedType: const FullType(double))); - } - if (object.double_ != null) { - result - ..add(r'double') - ..add(serializers.serialize(object.double_, - specifiedType: const FullType(double))); - } - if (object.decimal != null) { - result - ..add(r'decimal') - ..add(serializers.serialize(object.decimal, - specifiedType: const FullType(double))); - } - if (object.string != null) { - result - ..add(r'string') - ..add(serializers.serialize(object.string, - specifiedType: const FullType(String))); - } - result - ..add(r'byte') - ..add(serializers.serialize(object.byte, - specifiedType: const FullType(String))); - if (object.binary != null) { - result - ..add(r'binary') - ..add(serializers.serialize(object.binary, - specifiedType: const FullType(Uint8List))); - } - result - ..add(r'date') - ..add(serializers.serialize(object.date, - specifiedType: const FullType(Date))); - if (object.dateTime != null) { - result - ..add(r'dateTime') - ..add(serializers.serialize(object.dateTime, - specifiedType: const FullType(DateTime))); - } - if (object.uuid != null) { - result - ..add(r'uuid') - ..add(serializers.serialize(object.uuid, - specifiedType: const FullType(String))); - } - result - ..add(r'password') - ..add(serializers.serialize(object.password, - specifiedType: const FullType(String))); - if (object.patternWithDigits != null) { - result - ..add(r'pattern_with_digits') - ..add(serializers.serialize(object.patternWithDigits, - specifiedType: const FullType(String))); - } - if (object.patternWithDigitsAndDelimiter != null) { - result - ..add(r'pattern_with_digits_and_delimiter') - ..add(serializers.serialize(object.patternWithDigitsAndDelimiter, - specifiedType: const FullType(String))); - } - return result; - } - - @override - FormatTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = FormatTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'integer': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.integer = valueDes; - break; - case r'int32': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.int32 = valueDes; - break; - case r'int64': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.int64 = valueDes; - break; - case r'number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.number = valueDes; - break; - case r'float': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(double)) as double; - result.float = valueDes; - break; - case r'double': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(double)) as double; - result.double_ = valueDes; - break; - case r'decimal': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(double)) as double; - result.decimal = valueDes; - break; - case r'string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.string = valueDes; - break; - case r'byte': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.byte = valueDes; - break; - case r'binary': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Uint8List)) as Uint8List; - result.binary = valueDes; - break; - case r'date': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Date)) as Date; - result.date = valueDes; - break; - case r'dateTime': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DateTime)) as DateTime; - result.dateTime = valueDes; - break; - case r'uuid': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.uuid = valueDes; - break; - case r'password': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.password = valueDes; - break; - case r'pattern_with_digits': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.patternWithDigits = valueDes; - break; - case r'pattern_with_digits_and_delimiter': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.patternWithDigitsAndDelimiter = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart deleted file mode 100644 index 21b44ece26..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/has_only_read_only.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'has_only_read_only.g.dart'; - -/// HasOnlyReadOnly -/// -/// Properties: -/// * [bar] -/// * [foo] -abstract class HasOnlyReadOnly implements Built { - @BuiltValueField(wireName: r'bar') - String? get bar; - - @BuiltValueField(wireName: r'foo') - String? get foo; - - HasOnlyReadOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(HasOnlyReadOnlyBuilder b) => b; - - factory HasOnlyReadOnly([void updates(HasOnlyReadOnlyBuilder b)]) = _$HasOnlyReadOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HasOnlyReadOnlySerializer(); -} - -class _$HasOnlyReadOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [HasOnlyReadOnly, _$HasOnlyReadOnly]; - - @override - final String wireName = r'HasOnlyReadOnly'; - - @override - Iterable serialize(Serializers serializers, HasOnlyReadOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.bar != null) { - result - ..add(r'bar') - ..add(serializers.serialize(object.bar, - specifiedType: const FullType(String))); - } - if (object.foo != null) { - result - ..add(r'foo') - ..add(serializers.serialize(object.foo, - specifiedType: const FullType(String))); - } - return result; - } - - @override - HasOnlyReadOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = HasOnlyReadOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'bar': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.bar = valueDes; - break; - case r'foo': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.foo = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart deleted file mode 100644 index e589cb7bd3..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/health_check_result.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'health_check_result.g.dart'; - -/// Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. -/// -/// Properties: -/// * [nullableMessage] -abstract class HealthCheckResult implements Built { - @BuiltValueField(wireName: r'NullableMessage') - String? get nullableMessage; - - HealthCheckResult._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(HealthCheckResultBuilder b) => b; - - factory HealthCheckResult([void updates(HealthCheckResultBuilder b)]) = _$HealthCheckResult; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$HealthCheckResultSerializer(); -} - -class _$HealthCheckResultSerializer implements StructuredSerializer { - @override - final Iterable types = const [HealthCheckResult, _$HealthCheckResult]; - - @override - final String wireName = r'HealthCheckResult'; - - @override - Iterable serialize(Serializers serializers, HealthCheckResult object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.nullableMessage != null) { - result - ..add(r'NullableMessage') - ..add(serializers.serialize(object.nullableMessage, - specifiedType: const FullType.nullable(String))); - } - return result; - } - - @override - HealthCheckResult deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = HealthCheckResultBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'NullableMessage': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(String)) as String?; - if (valueDes == null) continue; - result.nullableMessage = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart deleted file mode 100644 index b611f8beb6..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/inline_response_default.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/foo.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'inline_response_default.g.dart'; - -/// InlineResponseDefault -/// -/// Properties: -/// * [string] -abstract class InlineResponseDefault implements Built { - @BuiltValueField(wireName: r'string') - Foo? get string; - - InlineResponseDefault._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(InlineResponseDefaultBuilder b) => b; - - factory InlineResponseDefault([void updates(InlineResponseDefaultBuilder b)]) = _$InlineResponseDefault; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$InlineResponseDefaultSerializer(); -} - -class _$InlineResponseDefaultSerializer implements StructuredSerializer { - @override - final Iterable types = const [InlineResponseDefault, _$InlineResponseDefault]; - - @override - final String wireName = r'InlineResponseDefault'; - - @override - Iterable serialize(Serializers serializers, InlineResponseDefault object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.string != null) { - result - ..add(r'string') - ..add(serializers.serialize(object.string, - specifiedType: const FullType(Foo))); - } - return result; - } - - @override - InlineResponseDefault deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = InlineResponseDefaultBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Foo)) as Foo; - result.string.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart deleted file mode 100644 index e5ae30f229..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/map_test.dart +++ /dev/null @@ -1,133 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'map_test.g.dart'; - -/// MapTest -/// -/// Properties: -/// * [mapMapOfString] -/// * [mapOfEnumString] -/// * [directMap] -/// * [indirectMap] -abstract class MapTest implements Built { - @BuiltValueField(wireName: r'map_map_of_string') - BuiltMap>? get mapMapOfString; - - @BuiltValueField(wireName: r'map_of_enum_string') - BuiltMap? get mapOfEnumString; - // enum mapOfEnumStringEnum { UPPER, lower, }; - - @BuiltValueField(wireName: r'direct_map') - BuiltMap? get directMap; - - @BuiltValueField(wireName: r'indirect_map') - BuiltMap? get indirectMap; - - MapTest._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(MapTestBuilder b) => b; - - factory MapTest([void updates(MapTestBuilder b)]) = _$MapTest; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$MapTestSerializer(); -} - -class _$MapTestSerializer implements StructuredSerializer { - @override - final Iterable types = const [MapTest, _$MapTest]; - - @override - final String wireName = r'MapTest'; - - @override - Iterable serialize(Serializers serializers, MapTest object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.mapMapOfString != null) { - result - ..add(r'map_map_of_string') - ..add(serializers.serialize(object.mapMapOfString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])]))); - } - if (object.mapOfEnumString != null) { - result - ..add(r'map_of_enum_string') - ..add(serializers.serialize(object.mapOfEnumString, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)]))); - } - if (object.directMap != null) { - result - ..add(r'direct_map') - ..add(serializers.serialize(object.directMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]))); - } - if (object.indirectMap != null) { - result - ..add(r'indirect_map') - ..add(serializers.serialize(object.indirectMap, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)]))); - } - return result; - } - - @override - MapTest deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = MapTestBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'map_map_of_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(BuiltMap, [FullType(String), FullType(String)])])) as BuiltMap>; - result.mapMapOfString.replace(valueDes); - break; - case r'map_of_enum_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(MapTestMapOfEnumStringEnum)])) as BuiltMap; - result.mapOfEnumString.replace(valueDes); - break; - case r'direct_map': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])) as BuiltMap; - result.directMap.replace(valueDes); - break; - case r'indirect_map': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(bool)])) as BuiltMap; - result.indirectMap.replace(valueDes); - break; - } - } - return result.build(); - } -} - -class MapTestMapOfEnumStringEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'UPPER') - static const MapTestMapOfEnumStringEnum UPPER = _$mapTestMapOfEnumStringEnum_UPPER; - @BuiltValueEnumConst(wireName: r'lower') - static const MapTestMapOfEnumStringEnum lower = _$mapTestMapOfEnumStringEnum_lower; - - static Serializer get serializer => _$mapTestMapOfEnumStringEnumSerializer; - - const MapTestMapOfEnumStringEnum._(String name): super(name); - - static BuiltSet get values => _$mapTestMapOfEnumStringEnumValues; - static MapTestMapOfEnumStringEnum valueOf(String name) => _$mapTestMapOfEnumStringEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart deleted file mode 100644 index 27c6993cc7..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/mixed_properties_and_additional_properties_class.dart +++ /dev/null @@ -1,103 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'mixed_properties_and_additional_properties_class.g.dart'; - -/// MixedPropertiesAndAdditionalPropertiesClass -/// -/// Properties: -/// * [uuid] -/// * [dateTime] -/// * [map] -abstract class MixedPropertiesAndAdditionalPropertiesClass implements Built { - @BuiltValueField(wireName: r'uuid') - String? get uuid; - - @BuiltValueField(wireName: r'dateTime') - DateTime? get dateTime; - - @BuiltValueField(wireName: r'map') - BuiltMap? get map; - - MixedPropertiesAndAdditionalPropertiesClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(MixedPropertiesAndAdditionalPropertiesClassBuilder b) => b; - - factory MixedPropertiesAndAdditionalPropertiesClass([void updates(MixedPropertiesAndAdditionalPropertiesClassBuilder b)]) = _$MixedPropertiesAndAdditionalPropertiesClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$MixedPropertiesAndAdditionalPropertiesClassSerializer(); -} - -class _$MixedPropertiesAndAdditionalPropertiesClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [MixedPropertiesAndAdditionalPropertiesClass, _$MixedPropertiesAndAdditionalPropertiesClass]; - - @override - final String wireName = r'MixedPropertiesAndAdditionalPropertiesClass'; - - @override - Iterable serialize(Serializers serializers, MixedPropertiesAndAdditionalPropertiesClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.uuid != null) { - result - ..add(r'uuid') - ..add(serializers.serialize(object.uuid, - specifiedType: const FullType(String))); - } - if (object.dateTime != null) { - result - ..add(r'dateTime') - ..add(serializers.serialize(object.dateTime, - specifiedType: const FullType(DateTime))); - } - if (object.map != null) { - result - ..add(r'map') - ..add(serializers.serialize(object.map, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)]))); - } - return result; - } - - @override - MixedPropertiesAndAdditionalPropertiesClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = MixedPropertiesAndAdditionalPropertiesClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'uuid': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.uuid = valueDes; - break; - case r'dateTime': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DateTime)) as DateTime; - result.dateTime = valueDes; - break; - case r'map': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType(Animal)])) as BuiltMap; - result.map.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart deleted file mode 100644 index 7392f71fe8..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model200_response.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model200_response.g.dart'; - -/// Model for testing model name starting with number -/// -/// Properties: -/// * [name] -/// * [class_] -abstract class Model200Response implements Built { - @BuiltValueField(wireName: r'name') - int? get name; - - @BuiltValueField(wireName: r'class') - String? get class_; - - Model200Response._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(Model200ResponseBuilder b) => b; - - factory Model200Response([void updates(Model200ResponseBuilder b)]) = _$Model200Response; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$Model200ResponseSerializer(); -} - -class _$Model200ResponseSerializer implements StructuredSerializer { - @override - final Iterable types = const [Model200Response, _$Model200Response]; - - @override - final String wireName = r'Model200Response'; - - @override - Iterable serialize(Serializers serializers, Model200Response object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.name != null) { - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(int))); - } - if (object.class_ != null) { - result - ..add(r'class') - ..add(serializers.serialize(object.class_, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Model200Response deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = Model200ResponseBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.name = valueDes; - break; - case r'class': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.class_ = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart deleted file mode 100644 index 23c30a77f2..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_client.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_client.g.dart'; - -/// ModelClient -/// -/// Properties: -/// * [client] -abstract class ModelClient implements Built { - @BuiltValueField(wireName: r'client') - String? get client; - - ModelClient._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelClientBuilder b) => b; - - factory ModelClient([void updates(ModelClientBuilder b)]) = _$ModelClient; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelClientSerializer(); -} - -class _$ModelClientSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelClient, _$ModelClient]; - - @override - final String wireName = r'ModelClient'; - - @override - Iterable serialize(Serializers serializers, ModelClient object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.client != null) { - result - ..add(r'client') - ..add(serializers.serialize(object.client, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ModelClient deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelClientBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'client': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.client = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart deleted file mode 100644 index ba6ca8c45d..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_enum_class.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_enum_class.g.dart'; - -class ModelEnumClass extends EnumClass { - - @BuiltValueEnumConst(wireName: r'_abc') - static const ModelEnumClass abc = _$abc; - @BuiltValueEnumConst(wireName: r'-efg') - static const ModelEnumClass efg = _$efg; - @BuiltValueEnumConst(wireName: r'(xyz)') - static const ModelEnumClass leftParenthesisXyzRightParenthesis = _$leftParenthesisXyzRightParenthesis; - - static Serializer get serializer => _$modelEnumClassSerializer; - - const ModelEnumClass._(String name): super(name); - - static BuiltSet get values => _$values; - static ModelEnumClass valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class ModelEnumClassMixin = Object with _$ModelEnumClassMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart deleted file mode 100644 index aa7b5ecfed..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_file.dart +++ /dev/null @@ -1,72 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_file.g.dart'; - -/// Must be named `File` for test. -/// -/// Properties: -/// * [sourceURI] - Test capitalization -abstract class ModelFile implements Built { - /// Test capitalization - @BuiltValueField(wireName: r'sourceURI') - String? get sourceURI; - - ModelFile._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelFileBuilder b) => b; - - factory ModelFile([void updates(ModelFileBuilder b)]) = _$ModelFile; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelFileSerializer(); -} - -class _$ModelFileSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelFile, _$ModelFile]; - - @override - final String wireName = r'ModelFile'; - - @override - Iterable serialize(Serializers serializers, ModelFile object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.sourceURI != null) { - result - ..add(r'sourceURI') - ..add(serializers.serialize(object.sourceURI, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ModelFile deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelFileBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'sourceURI': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.sourceURI = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart deleted file mode 100644 index 87e10153b1..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_list.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_list.g.dart'; - -/// ModelList -/// -/// Properties: -/// * [n123list] -abstract class ModelList implements Built { - @BuiltValueField(wireName: r'123-list') - String? get n123list; - - ModelList._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelListBuilder b) => b; - - factory ModelList([void updates(ModelListBuilder b)]) = _$ModelList; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelListSerializer(); -} - -class _$ModelListSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelList, _$ModelList]; - - @override - final String wireName = r'ModelList'; - - @override - Iterable serialize(Serializers serializers, ModelList object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.n123list != null) { - result - ..add(r'123-list') - ..add(serializers.serialize(object.n123list, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ModelList deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelListBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'123-list': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.n123list = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart deleted file mode 100644 index c63e0464fa..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/model_return.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'model_return.g.dart'; - -/// Model for testing reserved words -/// -/// Properties: -/// * [return_] -abstract class ModelReturn implements Built { - @BuiltValueField(wireName: r'return') - int? get return_; - - ModelReturn._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ModelReturnBuilder b) => b; - - factory ModelReturn([void updates(ModelReturnBuilder b)]) = _$ModelReturn; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ModelReturnSerializer(); -} - -class _$ModelReturnSerializer implements StructuredSerializer { - @override - final Iterable types = const [ModelReturn, _$ModelReturn]; - - @override - final String wireName = r'ModelReturn'; - - @override - Iterable serialize(Serializers serializers, ModelReturn object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.return_ != null) { - result - ..add(r'return') - ..add(serializers.serialize(object.return_, - specifiedType: const FullType(int))); - } - return result; - } - - @override - ModelReturn deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ModelReturnBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'return': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.return_ = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart deleted file mode 100644 index 78f9f8e545..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/name.dart +++ /dev/null @@ -1,114 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'name.g.dart'; - -/// Model for testing model name same as property name -/// -/// Properties: -/// * [name] -/// * [snakeCase] -/// * [property] -/// * [n123number] -abstract class Name implements Built { - @BuiltValueField(wireName: r'name') - int get name; - - @BuiltValueField(wireName: r'snake_case') - int? get snakeCase; - - @BuiltValueField(wireName: r'property') - String? get property; - - @BuiltValueField(wireName: r'123Number') - int? get n123number; - - Name._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(NameBuilder b) => b; - - factory Name([void updates(NameBuilder b)]) = _$Name; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NameSerializer(); -} - -class _$NameSerializer implements StructuredSerializer { - @override - final Iterable types = const [Name, _$Name]; - - @override - final String wireName = r'Name'; - - @override - Iterable serialize(Serializers serializers, Name object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(int))); - if (object.snakeCase != null) { - result - ..add(r'snake_case') - ..add(serializers.serialize(object.snakeCase, - specifiedType: const FullType(int))); - } - if (object.property != null) { - result - ..add(r'property') - ..add(serializers.serialize(object.property, - specifiedType: const FullType(String))); - } - if (object.n123number != null) { - result - ..add(r'123Number') - ..add(serializers.serialize(object.n123number, - specifiedType: const FullType(int))); - } - return result; - } - - @override - Name deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = NameBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.name = valueDes; - break; - case r'snake_case': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.snakeCase = valueDes; - break; - case r'property': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.property = valueDes; - break; - case r'123Number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.n123number = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart deleted file mode 100644 index efddc42e30..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/nullable_class.dart +++ /dev/null @@ -1,249 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/date.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'nullable_class.g.dart'; - -/// NullableClass -/// -/// Properties: -/// * [integerProp] -/// * [numberProp] -/// * [booleanProp] -/// * [stringProp] -/// * [dateProp] -/// * [datetimeProp] -/// * [arrayNullableProp] -/// * [arrayAndItemsNullableProp] -/// * [arrayItemsNullable] -/// * [objectNullableProp] -/// * [objectAndItemsNullableProp] -/// * [objectItemsNullable] -abstract class NullableClass implements Built { - @BuiltValueField(wireName: r'integer_prop') - int? get integerProp; - - @BuiltValueField(wireName: r'number_prop') - num? get numberProp; - - @BuiltValueField(wireName: r'boolean_prop') - bool? get booleanProp; - - @BuiltValueField(wireName: r'string_prop') - String? get stringProp; - - @BuiltValueField(wireName: r'date_prop') - Date? get dateProp; - - @BuiltValueField(wireName: r'datetime_prop') - DateTime? get datetimeProp; - - @BuiltValueField(wireName: r'array_nullable_prop') - BuiltList? get arrayNullableProp; - - @BuiltValueField(wireName: r'array_and_items_nullable_prop') - BuiltList? get arrayAndItemsNullableProp; - - @BuiltValueField(wireName: r'array_items_nullable') - BuiltList? get arrayItemsNullable; - - @BuiltValueField(wireName: r'object_nullable_prop') - BuiltMap? get objectNullableProp; - - @BuiltValueField(wireName: r'object_and_items_nullable_prop') - BuiltMap? get objectAndItemsNullableProp; - - @BuiltValueField(wireName: r'object_items_nullable') - BuiltMap? get objectItemsNullable; - - NullableClass._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(NullableClassBuilder b) => b; - - factory NullableClass([void updates(NullableClassBuilder b)]) = _$NullableClass; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NullableClassSerializer(); -} - -class _$NullableClassSerializer implements StructuredSerializer { - @override - final Iterable types = const [NullableClass, _$NullableClass]; - - @override - final String wireName = r'NullableClass'; - - @override - Iterable serialize(Serializers serializers, NullableClass object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.integerProp != null) { - result - ..add(r'integer_prop') - ..add(serializers.serialize(object.integerProp, - specifiedType: const FullType.nullable(int))); - } - if (object.numberProp != null) { - result - ..add(r'number_prop') - ..add(serializers.serialize(object.numberProp, - specifiedType: const FullType.nullable(num))); - } - if (object.booleanProp != null) { - result - ..add(r'boolean_prop') - ..add(serializers.serialize(object.booleanProp, - specifiedType: const FullType.nullable(bool))); - } - if (object.stringProp != null) { - result - ..add(r'string_prop') - ..add(serializers.serialize(object.stringProp, - specifiedType: const FullType.nullable(String))); - } - if (object.dateProp != null) { - result - ..add(r'date_prop') - ..add(serializers.serialize(object.dateProp, - specifiedType: const FullType.nullable(Date))); - } - if (object.datetimeProp != null) { - result - ..add(r'datetime_prop') - ..add(serializers.serialize(object.datetimeProp, - specifiedType: const FullType.nullable(DateTime))); - } - if (object.arrayNullableProp != null) { - result - ..add(r'array_nullable_prop') - ..add(serializers.serialize(object.arrayNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)]))); - } - if (object.arrayAndItemsNullableProp != null) { - result - ..add(r'array_and_items_nullable_prop') - ..add(serializers.serialize(object.arrayAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)]))); - } - if (object.arrayItemsNullable != null) { - result - ..add(r'array_items_nullable') - ..add(serializers.serialize(object.arrayItemsNullable, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)]))); - } - if (object.objectNullableProp != null) { - result - ..add(r'object_nullable_prop') - ..add(serializers.serialize(object.objectNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)]))); - } - if (object.objectAndItemsNullableProp != null) { - result - ..add(r'object_and_items_nullable_prop') - ..add(serializers.serialize(object.objectAndItemsNullableProp, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]))); - } - if (object.objectItemsNullable != null) { - result - ..add(r'object_items_nullable') - ..add(serializers.serialize(object.objectItemsNullable, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)]))); - } - return result; - } - - @override - NullableClass deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = NullableClassBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'integer_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(int)) as int?; - if (valueDes == null) continue; - result.integerProp = valueDes; - break; - case r'number_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(num)) as num?; - if (valueDes == null) continue; - result.numberProp = valueDes; - break; - case r'boolean_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(bool)) as bool?; - if (valueDes == null) continue; - result.booleanProp = valueDes; - break; - case r'string_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(String)) as String?; - if (valueDes == null) continue; - result.stringProp = valueDes; - break; - case r'date_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(Date)) as Date?; - if (valueDes == null) continue; - result.dateProp = valueDes; - break; - case r'datetime_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(DateTime)) as DateTime?; - if (valueDes == null) continue; - result.datetimeProp = valueDes; - break; - case r'array_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltList, [FullType(JsonObject)])) as BuiltList?; - if (valueDes == null) continue; - result.arrayNullableProp.replace(valueDes); - break; - case r'array_and_items_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltList, [FullType.nullable(JsonObject)])) as BuiltList?; - if (valueDes == null) continue; - result.arrayAndItemsNullableProp.replace(valueDes); - break; - case r'array_items_nullable': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType.nullable(JsonObject)])) as BuiltList; - result.arrayItemsNullable.replace(valueDes); - break; - case r'object_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType(JsonObject)])) as BuiltMap?; - if (valueDes == null) continue; - result.objectNullableProp.replace(valueDes); - break; - case r'object_and_items_nullable_prop': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType.nullable(BuiltMap, [FullType(String), FullType.nullable(JsonObject)])) as BuiltMap?; - if (valueDes == null) continue; - result.objectAndItemsNullableProp.replace(valueDes); - break; - case r'object_items_nullable': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltMap, [FullType(String), FullType.nullable(JsonObject)])) as BuiltMap; - result.objectItemsNullable.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart deleted file mode 100644 index e90cc9b934..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/number_only.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'number_only.g.dart'; - -/// NumberOnly -/// -/// Properties: -/// * [justNumber] -abstract class NumberOnly implements Built { - @BuiltValueField(wireName: r'JustNumber') - num? get justNumber; - - NumberOnly._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(NumberOnlyBuilder b) => b; - - factory NumberOnly([void updates(NumberOnlyBuilder b)]) = _$NumberOnly; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$NumberOnlySerializer(); -} - -class _$NumberOnlySerializer implements StructuredSerializer { - @override - final Iterable types = const [NumberOnly, _$NumberOnly]; - - @override - final String wireName = r'NumberOnly'; - - @override - Iterable serialize(Serializers serializers, NumberOnly object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.justNumber != null) { - result - ..add(r'JustNumber') - ..add(serializers.serialize(object.justNumber, - specifiedType: const FullType(num))); - } - return result; - } - - @override - NumberOnly deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = NumberOnlyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'JustNumber': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.justNumber = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart deleted file mode 100644 index 881ede54d0..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/object_with_deprecated_fields.dart +++ /dev/null @@ -1,118 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/deprecated_object.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'object_with_deprecated_fields.g.dart'; - -/// ObjectWithDeprecatedFields -/// -/// Properties: -/// * [uuid] -/// * [id] -/// * [deprecatedRef] -/// * [bars] -abstract class ObjectWithDeprecatedFields implements Built { - @BuiltValueField(wireName: r'uuid') - String? get uuid; - - @BuiltValueField(wireName: r'id') - num? get id; - - @BuiltValueField(wireName: r'deprecatedRef') - DeprecatedObject? get deprecatedRef; - - @BuiltValueField(wireName: r'bars') - BuiltList? get bars; - - ObjectWithDeprecatedFields._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ObjectWithDeprecatedFieldsBuilder b) => b; - - factory ObjectWithDeprecatedFields([void updates(ObjectWithDeprecatedFieldsBuilder b)]) = _$ObjectWithDeprecatedFields; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ObjectWithDeprecatedFieldsSerializer(); -} - -class _$ObjectWithDeprecatedFieldsSerializer implements StructuredSerializer { - @override - final Iterable types = const [ObjectWithDeprecatedFields, _$ObjectWithDeprecatedFields]; - - @override - final String wireName = r'ObjectWithDeprecatedFields'; - - @override - Iterable serialize(Serializers serializers, ObjectWithDeprecatedFields object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.uuid != null) { - result - ..add(r'uuid') - ..add(serializers.serialize(object.uuid, - specifiedType: const FullType(String))); - } - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(num))); - } - if (object.deprecatedRef != null) { - result - ..add(r'deprecatedRef') - ..add(serializers.serialize(object.deprecatedRef, - specifiedType: const FullType(DeprecatedObject))); - } - if (object.bars != null) { - result - ..add(r'bars') - ..add(serializers.serialize(object.bars, - specifiedType: const FullType(BuiltList, [FullType(String)]))); - } - return result; - } - - @override - ObjectWithDeprecatedFields deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ObjectWithDeprecatedFieldsBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'uuid': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.uuid = valueDes; - break; - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.id = valueDes; - break; - case r'deprecatedRef': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DeprecatedObject)) as DeprecatedObject; - result.deprecatedRef.replace(valueDes); - break; - case r'bars': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(String)])) as BuiltList; - result.bars.replace(valueDes); - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart deleted file mode 100644 index 3f9aed7265..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/order.dart +++ /dev/null @@ -1,170 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'order.g.dart'; - -/// Order -/// -/// Properties: -/// * [id] -/// * [petId] -/// * [quantity] -/// * [shipDate] -/// * [status] - Order Status -/// * [complete] -abstract class Order implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'petId') - int? get petId; - - @BuiltValueField(wireName: r'quantity') - int? get quantity; - - @BuiltValueField(wireName: r'shipDate') - DateTime? get shipDate; - - /// Order Status - @BuiltValueField(wireName: r'status') - OrderStatusEnum? get status; - // enum statusEnum { placed, approved, delivered, }; - - @BuiltValueField(wireName: r'complete') - bool? get complete; - - Order._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(OrderBuilder b) => b - ..complete = false; - - factory Order([void updates(OrderBuilder b)]) = _$Order; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OrderSerializer(); -} - -class _$OrderSerializer implements StructuredSerializer { - @override - final Iterable types = const [Order, _$Order]; - - @override - final String wireName = r'Order'; - - @override - Iterable serialize(Serializers serializers, Order object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.petId != null) { - result - ..add(r'petId') - ..add(serializers.serialize(object.petId, - specifiedType: const FullType(int))); - } - if (object.quantity != null) { - result - ..add(r'quantity') - ..add(serializers.serialize(object.quantity, - specifiedType: const FullType(int))); - } - if (object.shipDate != null) { - result - ..add(r'shipDate') - ..add(serializers.serialize(object.shipDate, - specifiedType: const FullType(DateTime))); - } - if (object.status != null) { - result - ..add(r'status') - ..add(serializers.serialize(object.status, - specifiedType: const FullType(OrderStatusEnum))); - } - if (object.complete != null) { - result - ..add(r'complete') - ..add(serializers.serialize(object.complete, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - Order deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = OrderBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'petId': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.petId = valueDes; - break; - case r'quantity': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.quantity = valueDes; - break; - case r'shipDate': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(DateTime)) as DateTime; - result.shipDate = valueDes; - break; - case r'status': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OrderStatusEnum)) as OrderStatusEnum; - result.status = valueDes; - break; - case r'complete': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.complete = valueDes; - break; - } - } - return result.build(); - } -} - -class OrderStatusEnum extends EnumClass { - - /// Order Status - @BuiltValueEnumConst(wireName: r'placed') - static const OrderStatusEnum placed = _$orderStatusEnum_placed; - /// Order Status - @BuiltValueEnumConst(wireName: r'approved') - static const OrderStatusEnum approved = _$orderStatusEnum_approved; - /// Order Status - @BuiltValueEnumConst(wireName: r'delivered') - static const OrderStatusEnum delivered = _$orderStatusEnum_delivered; - - static Serializer get serializer => _$orderStatusEnumSerializer; - - const OrderStatusEnum._(String name): super(name); - - static BuiltSet get values => _$orderStatusEnumValues; - static OrderStatusEnum valueOf(String name) => _$orderStatusEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart deleted file mode 100644 index 0715bdff30..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_composite.dart +++ /dev/null @@ -1,101 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_composite.g.dart'; - -/// OuterComposite -/// -/// Properties: -/// * [myNumber] -/// * [myString] -/// * [myBoolean] -abstract class OuterComposite implements Built { - @BuiltValueField(wireName: r'my_number') - num? get myNumber; - - @BuiltValueField(wireName: r'my_string') - String? get myString; - - @BuiltValueField(wireName: r'my_boolean') - bool? get myBoolean; - - OuterComposite._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(OuterCompositeBuilder b) => b; - - factory OuterComposite([void updates(OuterCompositeBuilder b)]) = _$OuterComposite; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterCompositeSerializer(); -} - -class _$OuterCompositeSerializer implements StructuredSerializer { - @override - final Iterable types = const [OuterComposite, _$OuterComposite]; - - @override - final String wireName = r'OuterComposite'; - - @override - Iterable serialize(Serializers serializers, OuterComposite object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.myNumber != null) { - result - ..add(r'my_number') - ..add(serializers.serialize(object.myNumber, - specifiedType: const FullType(num))); - } - if (object.myString != null) { - result - ..add(r'my_string') - ..add(serializers.serialize(object.myString, - specifiedType: const FullType(String))); - } - if (object.myBoolean != null) { - result - ..add(r'my_boolean') - ..add(serializers.serialize(object.myBoolean, - specifiedType: const FullType(bool))); - } - return result; - } - - @override - OuterComposite deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = OuterCompositeBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'my_number': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(num)) as num; - result.myNumber = valueDes; - break; - case r'my_string': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.myString = valueDes; - break; - case r'my_boolean': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(bool)) as bool; - result.myBoolean = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart deleted file mode 100644 index 6476ca57d4..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum.g.dart'; - -class OuterEnum extends EnumClass { - - @BuiltValueEnumConst(wireName: r'placed') - static const OuterEnum placed = _$placed; - @BuiltValueEnumConst(wireName: r'approved') - static const OuterEnum approved = _$approved; - @BuiltValueEnumConst(wireName: r'delivered') - static const OuterEnum delivered = _$delivered; - - static Serializer get serializer => _$outerEnumSerializer; - - const OuterEnum._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnum valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumMixin = Object with _$OuterEnumMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart deleted file mode 100644 index af04c76ed4..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_default_value.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum_default_value.g.dart'; - -class OuterEnumDefaultValue extends EnumClass { - - @BuiltValueEnumConst(wireName: r'placed') - static const OuterEnumDefaultValue placed = _$placed; - @BuiltValueEnumConst(wireName: r'approved') - static const OuterEnumDefaultValue approved = _$approved; - @BuiltValueEnumConst(wireName: r'delivered') - static const OuterEnumDefaultValue delivered = _$delivered; - - static Serializer get serializer => _$outerEnumDefaultValueSerializer; - - const OuterEnumDefaultValue._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnumDefaultValue valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumDefaultValueMixin = Object with _$OuterEnumDefaultValueMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart deleted file mode 100644 index c3b4b7d8f5..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum_integer.g.dart'; - -class OuterEnumInteger extends EnumClass { - - @BuiltValueEnumConst(wireNumber: 0) - static const OuterEnumInteger number0 = _$number0; - @BuiltValueEnumConst(wireNumber: 1) - static const OuterEnumInteger number1 = _$number1; - @BuiltValueEnumConst(wireNumber: 2) - static const OuterEnumInteger number2 = _$number2; - - static Serializer get serializer => _$outerEnumIntegerSerializer; - - const OuterEnumInteger._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnumInteger valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerMixin = Object with _$OuterEnumIntegerMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart deleted file mode 100644 index cf71a02176..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_enum_integer_default_value.dart +++ /dev/null @@ -1,35 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_enum_integer_default_value.g.dart'; - -class OuterEnumIntegerDefaultValue extends EnumClass { - - @BuiltValueEnumConst(wireNumber: 0) - static const OuterEnumIntegerDefaultValue number0 = _$number0; - @BuiltValueEnumConst(wireNumber: 1) - static const OuterEnumIntegerDefaultValue number1 = _$number1; - @BuiltValueEnumConst(wireNumber: 2) - static const OuterEnumIntegerDefaultValue number2 = _$number2; - - static Serializer get serializer => _$outerEnumIntegerDefaultValueSerializer; - - const OuterEnumIntegerDefaultValue._(String name): super(name); - - static BuiltSet get values => _$values; - static OuterEnumIntegerDefaultValue valueOf(String name) => _$valueOf(name); -} - -/// Optionally, enum_class can generate a mixin to go with your enum for use -/// with Angular. It exposes your enum constants as getters. So, if you mix it -/// in to your Dart component class, the values become available to the -/// corresponding Angular template. -/// -/// Trigger mixin generation by writing a line like this one next to your enum. -abstract class OuterEnumIntegerDefaultValueMixin = Object with _$OuterEnumIntegerDefaultValueMixin; - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart deleted file mode 100644 index 91524a285b..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/outer_object_with_enum_property.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'outer_object_with_enum_property.g.dart'; - -/// OuterObjectWithEnumProperty -/// -/// Properties: -/// * [value] -abstract class OuterObjectWithEnumProperty implements Built { - @BuiltValueField(wireName: r'value') - OuterEnumInteger get value; - // enum valueEnum { 0, 1, 2, }; - - OuterObjectWithEnumProperty._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(OuterObjectWithEnumPropertyBuilder b) => b; - - factory OuterObjectWithEnumProperty([void updates(OuterObjectWithEnumPropertyBuilder b)]) = _$OuterObjectWithEnumProperty; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$OuterObjectWithEnumPropertySerializer(); -} - -class _$OuterObjectWithEnumPropertySerializer implements StructuredSerializer { - @override - final Iterable types = const [OuterObjectWithEnumProperty, _$OuterObjectWithEnumProperty]; - - @override - final String wireName = r'OuterObjectWithEnumProperty'; - - @override - Iterable serialize(Serializers serializers, OuterObjectWithEnumProperty object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - result - ..add(r'value') - ..add(serializers.serialize(object.value, - specifiedType: const FullType(OuterEnumInteger))); - return result; - } - - @override - OuterObjectWithEnumProperty deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = OuterObjectWithEnumPropertyBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'value': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(OuterEnumInteger)) as OuterEnumInteger; - result.value = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart deleted file mode 100644 index 4aea3f370f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/pet.dart +++ /dev/null @@ -1,167 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_collection/built_collection.dart'; -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'pet.g.dart'; - -/// Pet -/// -/// Properties: -/// * [id] -/// * [category] -/// * [name] -/// * [photoUrls] -/// * [tags] -/// * [status] - pet status in the store -abstract class Pet implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'category') - Category? get category; - - @BuiltValueField(wireName: r'name') - String get name; - - @BuiltValueField(wireName: r'photoUrls') - BuiltSet get photoUrls; - - @BuiltValueField(wireName: r'tags') - BuiltList? get tags; - - /// pet status in the store - @BuiltValueField(wireName: r'status') - PetStatusEnum? get status; - // enum statusEnum { available, pending, sold, }; - - Pet._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(PetBuilder b) => b; - - factory Pet([void updates(PetBuilder b)]) = _$Pet; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$PetSerializer(); -} - -class _$PetSerializer implements StructuredSerializer { - @override - final Iterable types = const [Pet, _$Pet]; - - @override - final String wireName = r'Pet'; - - @override - Iterable serialize(Serializers serializers, Pet object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.category != null) { - result - ..add(r'category') - ..add(serializers.serialize(object.category, - specifiedType: const FullType(Category))); - } - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - result - ..add(r'photoUrls') - ..add(serializers.serialize(object.photoUrls, - specifiedType: const FullType(BuiltSet, [FullType(String)]))); - if (object.tags != null) { - result - ..add(r'tags') - ..add(serializers.serialize(object.tags, - specifiedType: const FullType(BuiltList, [FullType(Tag)]))); - } - if (object.status != null) { - result - ..add(r'status') - ..add(serializers.serialize(object.status, - specifiedType: const FullType(PetStatusEnum))); - } - return result; - } - - @override - Pet deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = PetBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'category': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(Category)) as Category; - result.category.replace(valueDes); - break; - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - case r'photoUrls': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltSet, [FullType(String)])) as BuiltSet; - result.photoUrls.replace(valueDes); - break; - case r'tags': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(BuiltList, [FullType(Tag)])) as BuiltList; - result.tags.replace(valueDes); - break; - case r'status': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(PetStatusEnum)) as PetStatusEnum; - result.status = valueDes; - break; - } - } - return result.build(); - } -} - -class PetStatusEnum extends EnumClass { - - /// pet status in the store - @BuiltValueEnumConst(wireName: r'available') - static const PetStatusEnum available = _$petStatusEnum_available; - /// pet status in the store - @BuiltValueEnumConst(wireName: r'pending') - static const PetStatusEnum pending = _$petStatusEnum_pending; - /// pet status in the store - @BuiltValueEnumConst(wireName: r'sold') - static const PetStatusEnum sold = _$petStatusEnum_sold; - - static Serializer get serializer => _$petStatusEnumSerializer; - - const PetStatusEnum._(String name): super(name); - - static BuiltSet get values => _$petStatusEnumValues; - static PetStatusEnum valueOf(String name) => _$petStatusEnumValueOf(name); -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart deleted file mode 100644 index b9f108fb62..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/read_only_first.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'read_only_first.g.dart'; - -/// ReadOnlyFirst -/// -/// Properties: -/// * [bar] -/// * [baz] -abstract class ReadOnlyFirst implements Built { - @BuiltValueField(wireName: r'bar') - String? get bar; - - @BuiltValueField(wireName: r'baz') - String? get baz; - - ReadOnlyFirst._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(ReadOnlyFirstBuilder b) => b; - - factory ReadOnlyFirst([void updates(ReadOnlyFirstBuilder b)]) = _$ReadOnlyFirst; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$ReadOnlyFirstSerializer(); -} - -class _$ReadOnlyFirstSerializer implements StructuredSerializer { - @override - final Iterable types = const [ReadOnlyFirst, _$ReadOnlyFirst]; - - @override - final String wireName = r'ReadOnlyFirst'; - - @override - Iterable serialize(Serializers serializers, ReadOnlyFirst object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.bar != null) { - result - ..add(r'bar') - ..add(serializers.serialize(object.bar, - specifiedType: const FullType(String))); - } - if (object.baz != null) { - result - ..add(r'baz') - ..add(serializers.serialize(object.baz, - specifiedType: const FullType(String))); - } - return result; - } - - @override - ReadOnlyFirst deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = ReadOnlyFirstBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'bar': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.bar = valueDes; - break; - case r'baz': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.baz = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart deleted file mode 100644 index dcfe12bb06..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/special_model_name.dart +++ /dev/null @@ -1,71 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'special_model_name.g.dart'; - -/// SpecialModelName -/// -/// Properties: -/// * [dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket] -abstract class SpecialModelName implements Built { - @BuiltValueField(wireName: r'$special[property.name]') - int? get dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket; - - SpecialModelName._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(SpecialModelNameBuilder b) => b; - - factory SpecialModelName([void updates(SpecialModelNameBuilder b)]) = _$SpecialModelName; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$SpecialModelNameSerializer(); -} - -class _$SpecialModelNameSerializer implements StructuredSerializer { - @override - final Iterable types = const [SpecialModelName, _$SpecialModelName]; - - @override - final String wireName = r'SpecialModelName'; - - @override - Iterable serialize(Serializers serializers, SpecialModelName object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket != null) { - result - ..add(r'$special[property.name]') - ..add(serializers.serialize(object.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket, - specifiedType: const FullType(int))); - } - return result; - } - - @override - SpecialModelName deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = SpecialModelNameBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'$special[property.name]': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart deleted file mode 100644 index 5a7ed38d94..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/tag.dart +++ /dev/null @@ -1,86 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'tag.g.dart'; - -/// Tag -/// -/// Properties: -/// * [id] -/// * [name] -abstract class Tag implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'name') - String? get name; - - Tag._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(TagBuilder b) => b; - - factory Tag([void updates(TagBuilder b)]) = _$Tag; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$TagSerializer(); -} - -class _$TagSerializer implements StructuredSerializer { - @override - final Iterable types = const [Tag, _$Tag]; - - @override - final String wireName = r'Tag'; - - @override - Iterable serialize(Serializers serializers, Tag object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.name != null) { - result - ..add(r'name') - ..add(serializers.serialize(object.name, - specifiedType: const FullType(String))); - } - return result; - } - - @override - Tag deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = TagBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'name': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.name = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart deleted file mode 100644 index d590c20bdc..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/model/user.dart +++ /dev/null @@ -1,177 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -import 'package:built_value/built_value.dart'; -import 'package:built_value/serializer.dart'; - -part 'user.g.dart'; - -/// User -/// -/// Properties: -/// * [id] -/// * [username] -/// * [firstName] -/// * [lastName] -/// * [email] -/// * [password] -/// * [phone] -/// * [userStatus] - User Status -abstract class User implements Built { - @BuiltValueField(wireName: r'id') - int? get id; - - @BuiltValueField(wireName: r'username') - String? get username; - - @BuiltValueField(wireName: r'firstName') - String? get firstName; - - @BuiltValueField(wireName: r'lastName') - String? get lastName; - - @BuiltValueField(wireName: r'email') - String? get email; - - @BuiltValueField(wireName: r'password') - String? get password; - - @BuiltValueField(wireName: r'phone') - String? get phone; - - /// User Status - @BuiltValueField(wireName: r'userStatus') - int? get userStatus; - - User._(); - - @BuiltValueHook(initializeBuilder: true) - static void _defaults(UserBuilder b) => b; - - factory User([void updates(UserBuilder b)]) = _$User; - - @BuiltValueSerializer(custom: true) - static Serializer get serializer => _$UserSerializer(); -} - -class _$UserSerializer implements StructuredSerializer { - @override - final Iterable types = const [User, _$User]; - - @override - final String wireName = r'User'; - - @override - Iterable serialize(Serializers serializers, User object, - {FullType specifiedType = FullType.unspecified}) { - final result = []; - if (object.id != null) { - result - ..add(r'id') - ..add(serializers.serialize(object.id, - specifiedType: const FullType(int))); - } - if (object.username != null) { - result - ..add(r'username') - ..add(serializers.serialize(object.username, - specifiedType: const FullType(String))); - } - if (object.firstName != null) { - result - ..add(r'firstName') - ..add(serializers.serialize(object.firstName, - specifiedType: const FullType(String))); - } - if (object.lastName != null) { - result - ..add(r'lastName') - ..add(serializers.serialize(object.lastName, - specifiedType: const FullType(String))); - } - if (object.email != null) { - result - ..add(r'email') - ..add(serializers.serialize(object.email, - specifiedType: const FullType(String))); - } - if (object.password != null) { - result - ..add(r'password') - ..add(serializers.serialize(object.password, - specifiedType: const FullType(String))); - } - if (object.phone != null) { - result - ..add(r'phone') - ..add(serializers.serialize(object.phone, - specifiedType: const FullType(String))); - } - if (object.userStatus != null) { - result - ..add(r'userStatus') - ..add(serializers.serialize(object.userStatus, - specifiedType: const FullType(int))); - } - return result; - } - - @override - User deserialize(Serializers serializers, Iterable serialized, - {FullType specifiedType = FullType.unspecified}) { - final result = UserBuilder(); - - final iterator = serialized.iterator; - while (iterator.moveNext()) { - final key = iterator.current as String; - iterator.moveNext(); - final Object? value = iterator.current; - - switch (key) { - case r'id': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.id = valueDes; - break; - case r'username': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.username = valueDes; - break; - case r'firstName': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.firstName = valueDes; - break; - case r'lastName': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.lastName = valueDes; - break; - case r'email': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.email = valueDes; - break; - case r'password': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.password = valueDes; - break; - case r'phone': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(String)) as String; - result.phone = valueDes; - break; - case r'userStatus': - final valueDes = serializers.deserialize(value, - specifiedType: const FullType(int)) as int; - result.userStatus = valueDes; - break; - } - } - return result.build(); - } -} - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart deleted file mode 100644 index 5ee82d7b50..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/lib/src/serializers.dart +++ /dev/null @@ -1,146 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// - -// ignore_for_file: unused_import - -import 'package:built_collection/built_collection.dart'; -import 'package:built_value/json_object.dart'; -import 'package:built_value/serializer.dart'; -import 'package:built_value/standard_json_plugin.dart'; -import 'package:built_value/iso_8601_date_time_serializer.dart'; -import 'package:openapi/src/date_serializer.dart'; -import 'package:openapi/src/model/date.dart'; - -import 'package:openapi/src/model/additional_properties_class.dart'; -import 'package:openapi/src/model/animal.dart'; -import 'package:openapi/src/model/api_response.dart'; -import 'package:openapi/src/model/array_of_array_of_number_only.dart'; -import 'package:openapi/src/model/array_of_number_only.dart'; -import 'package:openapi/src/model/array_test.dart'; -import 'package:openapi/src/model/capitalization.dart'; -import 'package:openapi/src/model/cat.dart'; -import 'package:openapi/src/model/cat_all_of.dart'; -import 'package:openapi/src/model/category.dart'; -import 'package:openapi/src/model/class_model.dart'; -import 'package:openapi/src/model/deprecated_object.dart'; -import 'package:openapi/src/model/dog.dart'; -import 'package:openapi/src/model/dog_all_of.dart'; -import 'package:openapi/src/model/enum_arrays.dart'; -import 'package:openapi/src/model/enum_test.dart'; -import 'package:openapi/src/model/file_schema_test_class.dart'; -import 'package:openapi/src/model/foo.dart'; -import 'package:openapi/src/model/format_test.dart'; -import 'package:openapi/src/model/has_only_read_only.dart'; -import 'package:openapi/src/model/health_check_result.dart'; -import 'package:openapi/src/model/inline_response_default.dart'; -import 'package:openapi/src/model/map_test.dart'; -import 'package:openapi/src/model/mixed_properties_and_additional_properties_class.dart'; -import 'package:openapi/src/model/model200_response.dart'; -import 'package:openapi/src/model/model_client.dart'; -import 'package:openapi/src/model/model_enum_class.dart'; -import 'package:openapi/src/model/model_file.dart'; -import 'package:openapi/src/model/model_list.dart'; -import 'package:openapi/src/model/model_return.dart'; -import 'package:openapi/src/model/name.dart'; -import 'package:openapi/src/model/nullable_class.dart'; -import 'package:openapi/src/model/number_only.dart'; -import 'package:openapi/src/model/object_with_deprecated_fields.dart'; -import 'package:openapi/src/model/order.dart'; -import 'package:openapi/src/model/outer_composite.dart'; -import 'package:openapi/src/model/outer_enum.dart'; -import 'package:openapi/src/model/outer_enum_default_value.dart'; -import 'package:openapi/src/model/outer_enum_integer.dart'; -import 'package:openapi/src/model/outer_enum_integer_default_value.dart'; -import 'package:openapi/src/model/outer_object_with_enum_property.dart'; -import 'package:openapi/src/model/pet.dart'; -import 'package:openapi/src/model/read_only_first.dart'; -import 'package:openapi/src/model/special_model_name.dart'; -import 'package:openapi/src/model/tag.dart'; -import 'package:openapi/src/model/user.dart'; - -part 'serializers.g.dart'; - -@SerializersFor([ - AdditionalPropertiesClass, - Animal, - ApiResponse, - ArrayOfArrayOfNumberOnly, - ArrayOfNumberOnly, - ArrayTest, - Capitalization, - Cat, - CatAllOf, - Category, - ClassModel, - DeprecatedObject, - Dog, - DogAllOf, - EnumArrays, - EnumTest, - FileSchemaTestClass, - Foo, - FormatTest, - HasOnlyReadOnly, - HealthCheckResult, - InlineResponseDefault, - MapTest, - MixedPropertiesAndAdditionalPropertiesClass, - Model200Response, - ModelClient, - ModelEnumClass, - ModelFile, - ModelList, - ModelReturn, - Name, - NullableClass, - NumberOnly, - ObjectWithDeprecatedFields, - Order, - OuterComposite, - OuterEnum, - OuterEnumDefaultValue, - OuterEnumInteger, - OuterEnumIntegerDefaultValue, - OuterObjectWithEnumProperty, - Pet, - ReadOnlyFirst, - SpecialModelName, - Tag, - User, -]) -Serializers serializers = (_$serializers.toBuilder() - ..addBuilderFactory( - const FullType(BuiltMap, [FullType(String), FullType(String)]), - () => MapBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltList, [FullType(User)]), - () => ListBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltSet, [FullType(String)]), - () => SetBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltSet, [FullType(Pet)]), - () => SetBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltList, [FullType(Pet)]), - () => ListBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltMap, [FullType(String), FullType(int)]), - () => MapBuilder(), - ) - ..addBuilderFactory( - const FullType(BuiltList, [FullType(String)]), - () => ListBuilder(), - ) - ..add(const DateSerializer()) - ..add(Iso8601DateTimeSerializer())) - .build(); - -Serializers standardSerializers = - (serializers.toBuilder()..addPlugin(StandardJsonPlugin())).build(); diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml deleted file mode 100644 index 6963cf3c0f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pom.xml +++ /dev/null @@ -1,88 +0,0 @@ - - 4.0.0 - org.openapitools - DartDioNextDioHttpPetstoreClientLibFakeTests - pom - 1.0.0-SNAPSHOT - DartDioNext DioHttp Petstore Client Lib Fake - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pub-get - pre-integration-test - - exec - - - pub - - get - - - - - pub-run-build-runner - pre-integration-test - - exec - - - pub - - run - build_runner - build - - - - - dart-analyze - integration-test - - exec - - - dart - - analyze - --fatal-infos - - - - - dart-test - integration-test - - exec - - - dart - - test - - - - - - - - diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml deleted file mode 100644 index 1ba7418109..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/pubspec.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: openapi -version: 1.0.0 -description: OpenAPI API client -homepage: homepage - -environment: - sdk: '>=2.12.0 <3.0.0' - -dependencies: - dio_http: '>=5.0.0 <6.0.0' - built_value: '>=8.1.0 <9.0.0' - built_collection: '>=5.1.0 <6.0.0' - -dev_dependencies: - built_value_generator: '>=8.1.0 <9.0.0' - build_runner: any - test: '>=1.16.0 <1.17.0' diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart deleted file mode 100644 index c231e6dc28..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/additional_properties_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for AdditionalPropertiesClass -void main() { - final instance = AdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() - - group(AdditionalPropertiesClass, () { - // BuiltMap mapProperty - test('to test the property `mapProperty`', () async { - // TODO - }); - - // BuiltMap> mapOfMapProperty - test('to test the property `mapOfMapProperty`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart deleted file mode 100644 index 875bb42a10..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/animal_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Animal -void main() { - final instance = AnimalBuilder(); - // TODO add properties to the builder and call build() - - group(Animal, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart deleted file mode 100644 index ddafef2a83..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/another_fake_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for AnotherFakeApi -void main() { - final instance = Openapi().getAnotherFakeApi(); - - group(AnotherFakeApi, () { - // To test special tags - // - // To test special tags and operation ID starting with number - // - //Future call123testSpecialTags(ModelClient modelClient) async - test('test call123testSpecialTags', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart deleted file mode 100644 index cf1a744cd6..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/api_response_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ApiResponse -void main() { - final instance = ApiResponseBuilder(); - // TODO add properties to the builder and call build() - - group(ApiResponse, () { - // int code - test('to test the property `code`', () async { - // TODO - }); - - // String type - test('to test the property `type`', () async { - // TODO - }); - - // String message - test('to test the property `message`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart deleted file mode 100644 index a679a6c422..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfArrayOfNumberOnly -void main() { - final instance = ArrayOfArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(ArrayOfArrayOfNumberOnly, () { - // BuiltList> arrayArrayNumber - test('to test the property `arrayArrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart deleted file mode 100644 index cc648bc115..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_of_number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayOfNumberOnly -void main() { - final instance = ArrayOfNumberOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(ArrayOfNumberOnly, () { - // BuiltList arrayNumber - test('to test the property `arrayNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart deleted file mode 100644 index 210216f224..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/array_test_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ArrayTest -void main() { - final instance = ArrayTestBuilder(); - // TODO add properties to the builder and call build() - - group(ArrayTest, () { - // BuiltList arrayOfString - test('to test the property `arrayOfString`', () async { - // TODO - }); - - // BuiltList> arrayArrayOfInteger - test('to test the property `arrayArrayOfInteger`', () async { - // TODO - }); - - // BuiltList> arrayArrayOfModel - test('to test the property `arrayArrayOfModel`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart deleted file mode 100644 index 23e04b0001..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/capitalization_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Capitalization -void main() { - final instance = CapitalizationBuilder(); - // TODO add properties to the builder and call build() - - group(Capitalization, () { - // String smallCamel - test('to test the property `smallCamel`', () async { - // TODO - }); - - // String capitalCamel - test('to test the property `capitalCamel`', () async { - // TODO - }); - - // String smallSnake - test('to test the property `smallSnake`', () async { - // TODO - }); - - // String capitalSnake - test('to test the property `capitalSnake`', () async { - // TODO - }); - - // String sCAETHFlowPoints - test('to test the property `sCAETHFlowPoints`', () async { - // TODO - }); - - // Name of the pet - // String ATT_NAME - test('to test the property `ATT_NAME`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart deleted file mode 100644 index afdac82ad1..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_all_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for CatAllOf -void main() { - final instance = CatAllOfBuilder(); - // TODO add properties to the builder and call build() - - group(CatAllOf, () { - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart deleted file mode 100644 index b8fc252acc..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/cat_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Cat -void main() { - final instance = CatBuilder(); - // TODO add properties to the builder and call build() - - group(Cat, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // bool declawed - test('to test the property `declawed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart deleted file mode 100644 index 70f5fb5e02..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/category_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Category -void main() { - final instance = CategoryBuilder(); - // TODO add properties to the builder and call build() - - group(Category, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String name (default value: 'default-name') - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart deleted file mode 100644 index 92f95f186c..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/class_model_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ClassModel -void main() { - final instance = ClassModelBuilder(); - // TODO add properties to the builder and call build() - - group(ClassModel, () { - // String class_ - test('to test the property `class_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart deleted file mode 100644 index eef4c41652..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/default_api_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for DefaultApi -void main() { - final instance = Openapi().getDefaultApi(); - - group(DefaultApi, () { - //Future fooGet() async - test('test fooGet', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart deleted file mode 100644 index 98ab991b2b..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/deprecated_object_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DeprecatedObject -void main() { - final instance = DeprecatedObjectBuilder(); - // TODO add properties to the builder and call build() - - group(DeprecatedObject, () { - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart deleted file mode 100644 index 7b58b3a275..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_all_of_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for DogAllOf -void main() { - final instance = DogAllOfBuilder(); - // TODO add properties to the builder and call build() - - group(DogAllOf, () { - // String breed - test('to test the property `breed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart deleted file mode 100644 index f57fcdc413..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/dog_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Dog -void main() { - final instance = DogBuilder(); - // TODO add properties to the builder and call build() - - group(Dog, () { - // String className - test('to test the property `className`', () async { - // TODO - }); - - // String color (default value: 'red') - test('to test the property `color`', () async { - // TODO - }); - - // String breed - test('to test the property `breed`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart deleted file mode 100644 index 438c36db07..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_arrays_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumArrays -void main() { - final instance = EnumArraysBuilder(); - // TODO add properties to the builder and call build() - - group(EnumArrays, () { - // String justSymbol - test('to test the property `justSymbol`', () async { - // TODO - }); - - // BuiltList arrayEnum - test('to test the property `arrayEnum`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart deleted file mode 100644 index b5f3aeb7fb..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/enum_test_test.dart +++ /dev/null @@ -1,51 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for EnumTest -void main() { - final instance = EnumTestBuilder(); - // TODO add properties to the builder and call build() - - group(EnumTest, () { - // String enumString - test('to test the property `enumString`', () async { - // TODO - }); - - // String enumStringRequired - test('to test the property `enumStringRequired`', () async { - // TODO - }); - - // int enumInteger - test('to test the property `enumInteger`', () async { - // TODO - }); - - // double enumNumber - test('to test the property `enumNumber`', () async { - // TODO - }); - - // OuterEnum outerEnum - test('to test the property `outerEnum`', () async { - // TODO - }); - - // OuterEnumInteger outerEnumInteger - test('to test the property `outerEnumInteger`', () async { - // TODO - }); - - // OuterEnumDefaultValue outerEnumDefaultValue - test('to test the property `outerEnumDefaultValue`', () async { - // TODO - }); - - // OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue - test('to test the property `outerEnumIntegerDefaultValue`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart deleted file mode 100644 index 1eff7d0447..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_api_test.dart +++ /dev/null @@ -1,136 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FakeApi -void main() { - final instance = Openapi().getFakeApi(); - - group(FakeApi, () { - // Health check endpoint - // - //Future fakeHealthGet() async - test('test fakeHealthGet', () async { - // TODO - }); - - // test http signature authentication - // - //Future fakeHttpSignatureTest(Pet pet, { String query1, String header1 }) async - test('test fakeHttpSignatureTest', () async { - // TODO - }); - - // Test serialization of outer boolean types - // - //Future fakeOuterBooleanSerialize({ bool body }) async - test('test fakeOuterBooleanSerialize', () async { - // TODO - }); - - // Test serialization of object with outer number type - // - //Future fakeOuterCompositeSerialize({ OuterComposite outerComposite }) async - test('test fakeOuterCompositeSerialize', () async { - // TODO - }); - - // Test serialization of outer number types - // - //Future fakeOuterNumberSerialize({ num body }) async - test('test fakeOuterNumberSerialize', () async { - // TODO - }); - - // Test serialization of outer string types - // - //Future fakeOuterStringSerialize({ String body }) async - test('test fakeOuterStringSerialize', () async { - // TODO - }); - - // Test serialization of enum (int) properties with examples - // - //Future fakePropertyEnumIntegerSerialize(OuterObjectWithEnumProperty outerObjectWithEnumProperty) async - test('test fakePropertyEnumIntegerSerialize', () async { - // TODO - }); - - // For this test, the body has to be a binary file. - // - //Future testBodyWithBinary(MultipartFile body) async - test('test testBodyWithBinary', () async { - // TODO - }); - - // For this test, the body for this request must reference a schema named `File`. - // - //Future testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) async - test('test testBodyWithFileSchema', () async { - // TODO - }); - - //Future testBodyWithQueryParams(String query, User user) async - test('test testBodyWithQueryParams', () async { - // TODO - }); - - // To test \"client\" model - // - // To test \"client\" model - // - //Future testClientModel(ModelClient modelClient) async - test('test testClientModel', () async { - // TODO - }); - - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - // - // Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - // - //Future testEndpointParameters(num number, double double_, String patternWithoutDelimiter, String byte, { int integer, int int32, int int64, double float, String string, Uint8List binary, Date date, DateTime dateTime, String password, String callback }) async - test('test testEndpointParameters', () async { - // TODO - }); - - // To test enum parameters - // - // To test enum parameters - // - //Future testEnumParameters({ BuiltList enumHeaderStringArray, String enumHeaderString, BuiltList enumQueryStringArray, String enumQueryString, int enumQueryInteger, double enumQueryDouble, BuiltList enumFormStringArray, String enumFormString }) async - test('test testEnumParameters', () async { - // TODO - }); - - // Fake endpoint to test group parameters (optional) - // - // Fake endpoint to test group parameters (optional) - // - //Future testGroupParameters(int requiredStringGroup, bool requiredBooleanGroup, int requiredInt64Group, { int stringGroup, bool booleanGroup, int int64Group }) async - test('test testGroupParameters', () async { - // TODO - }); - - // test inline additionalProperties - // - //Future testInlineAdditionalProperties(BuiltMap requestBody) async - test('test testInlineAdditionalProperties', () async { - // TODO - }); - - // test json serialization of form data - // - //Future testJsonFormData(String param, String param2) async - test('test testJsonFormData', () async { - // TODO - }); - - // To test the collection format in query parameters - // - //Future testQueryParameterCollectionFormat(BuiltList pipe, BuiltList ioutil, BuiltList http, BuiltList url, BuiltList context, String allowEmpty, { BuiltMap language }) async - test('test testQueryParameterCollectionFormat', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart deleted file mode 100644 index 3075147f52..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/fake_classname_tags123_api_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for FakeClassnameTags123Api -void main() { - final instance = Openapi().getFakeClassnameTags123Api(); - - group(FakeClassnameTags123Api, () { - // To test class name in snake case - // - // To test class name in snake case - // - //Future testClassname(ModelClient modelClient) async - test('test testClassname', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart deleted file mode 100644 index ca8695bd4a..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/file_schema_test_class_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FileSchemaTestClass -void main() { - final instance = FileSchemaTestClassBuilder(); - // TODO add properties to the builder and call build() - - group(FileSchemaTestClass, () { - // ModelFile file - test('to test the property `file`', () async { - // TODO - }); - - // BuiltList files - test('to test the property `files`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart deleted file mode 100644 index 205237788a..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/foo_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Foo -void main() { - final instance = FooBuilder(); - // TODO add properties to the builder and call build() - - group(Foo, () { - // String bar (default value: 'bar') - test('to test the property `bar`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart deleted file mode 100644 index 558c3aa4b6..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/format_test_test.dart +++ /dev/null @@ -1,93 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for FormatTest -void main() { - final instance = FormatTestBuilder(); - // TODO add properties to the builder and call build() - - group(FormatTest, () { - // int integer - test('to test the property `integer`', () async { - // TODO - }); - - // int int32 - test('to test the property `int32`', () async { - // TODO - }); - - // int int64 - test('to test the property `int64`', () async { - // TODO - }); - - // num number - test('to test the property `number`', () async { - // TODO - }); - - // double float - test('to test the property `float`', () async { - // TODO - }); - - // double double_ - test('to test the property `double_`', () async { - // TODO - }); - - // double decimal - test('to test the property `decimal`', () async { - // TODO - }); - - // String string - test('to test the property `string`', () async { - // TODO - }); - - // String byte - test('to test the property `byte`', () async { - // TODO - }); - - // Uint8List binary - test('to test the property `binary`', () async { - // TODO - }); - - // Date date - test('to test the property `date`', () async { - // TODO - }); - - // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); - - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // String password - test('to test the property `password`', () async { - // TODO - }); - - // A string that is a 10 digit number. Can have leading zeros. - // String patternWithDigits - test('to test the property `patternWithDigits`', () async { - // TODO - }); - - // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - // String patternWithDigitsAndDelimiter - test('to test the property `patternWithDigitsAndDelimiter`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart deleted file mode 100644 index c345222147..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/has_only_read_only_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HasOnlyReadOnly -void main() { - final instance = HasOnlyReadOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(HasOnlyReadOnly, () { - // String bar - test('to test the property `bar`', () async { - // TODO - }); - - // String foo - test('to test the property `foo`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart deleted file mode 100644 index fda0c92182..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/health_check_result_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for HealthCheckResult -void main() { - final instance = HealthCheckResultBuilder(); - // TODO add properties to the builder and call build() - - group(HealthCheckResult, () { - // String nullableMessage - test('to test the property `nullableMessage`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart deleted file mode 100644 index 56fbf1d0b1..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/inline_response_default_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for InlineResponseDefault -void main() { - final instance = InlineResponseDefaultBuilder(); - // TODO add properties to the builder and call build() - - group(InlineResponseDefault, () { - // Foo string - test('to test the property `string`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart deleted file mode 100644 index 56a27610ee..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/map_test_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MapTest -void main() { - final instance = MapTestBuilder(); - // TODO add properties to the builder and call build() - - group(MapTest, () { - // BuiltMap> mapMapOfString - test('to test the property `mapMapOfString`', () async { - // TODO - }); - - // BuiltMap mapOfEnumString - test('to test the property `mapOfEnumString`', () async { - // TODO - }); - - // BuiltMap directMap - test('to test the property `directMap`', () async { - // TODO - }); - - // BuiltMap indirectMap - test('to test the property `indirectMap`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart deleted file mode 100644 index 85b113387a..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/mixed_properties_and_additional_properties_class_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for MixedPropertiesAndAdditionalPropertiesClass -void main() { - final instance = MixedPropertiesAndAdditionalPropertiesClassBuilder(); - // TODO add properties to the builder and call build() - - group(MixedPropertiesAndAdditionalPropertiesClass, () { - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // DateTime dateTime - test('to test the property `dateTime`', () async { - // TODO - }); - - // BuiltMap map - test('to test the property `map`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart deleted file mode 100644 index 39ff6ec59c..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model200_response_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Model200Response -void main() { - final instance = Model200ResponseBuilder(); - // TODO add properties to the builder and call build() - - group(Model200Response, () { - // int name - test('to test the property `name`', () async { - // TODO - }); - - // String class_ - test('to test the property `class_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart deleted file mode 100644 index f494dfd084..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_client_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelClient -void main() { - final instance = ModelClientBuilder(); - // TODO add properties to the builder and call build() - - group(ModelClient, () { - // String client - test('to test the property `client`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart deleted file mode 100644 index 03e5855bf0..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_enum_class_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelEnumClass -void main() { - - group(ModelEnumClass, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart deleted file mode 100644 index 4f13977262..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_file_test.dart +++ /dev/null @@ -1,17 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelFile -void main() { - final instance = ModelFileBuilder(); - // TODO add properties to the builder and call build() - - group(ModelFile, () { - // Test capitalization - // String sourceURI - test('to test the property `sourceURI`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart deleted file mode 100644 index d35e02fe0c..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_list_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelList -void main() { - final instance = ModelListBuilder(); - // TODO add properties to the builder and call build() - - group(ModelList, () { - // String n123list - test('to test the property `n123list`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart deleted file mode 100644 index eedfe7eb28..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/model_return_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ModelReturn -void main() { - final instance = ModelReturnBuilder(); - // TODO add properties to the builder and call build() - - group(ModelReturn, () { - // int return_ - test('to test the property `return_`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart deleted file mode 100644 index 6b2329bb08..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/name_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Name -void main() { - final instance = NameBuilder(); - // TODO add properties to the builder and call build() - - group(Name, () { - // int name - test('to test the property `name`', () async { - // TODO - }); - - // int snakeCase - test('to test the property `snakeCase`', () async { - // TODO - }); - - // String property - test('to test the property `property`', () async { - // TODO - }); - - // int n123number - test('to test the property `n123number`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart deleted file mode 100644 index 1a6767dbb2..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/nullable_class_test.dart +++ /dev/null @@ -1,71 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NullableClass -void main() { - final instance = NullableClassBuilder(); - // TODO add properties to the builder and call build() - - group(NullableClass, () { - // int integerProp - test('to test the property `integerProp`', () async { - // TODO - }); - - // num numberProp - test('to test the property `numberProp`', () async { - // TODO - }); - - // bool booleanProp - test('to test the property `booleanProp`', () async { - // TODO - }); - - // String stringProp - test('to test the property `stringProp`', () async { - // TODO - }); - - // Date dateProp - test('to test the property `dateProp`', () async { - // TODO - }); - - // DateTime datetimeProp - test('to test the property `datetimeProp`', () async { - // TODO - }); - - // BuiltList arrayNullableProp - test('to test the property `arrayNullableProp`', () async { - // TODO - }); - - // BuiltList arrayAndItemsNullableProp - test('to test the property `arrayAndItemsNullableProp`', () async { - // TODO - }); - - // BuiltList arrayItemsNullable - test('to test the property `arrayItemsNullable`', () async { - // TODO - }); - - // BuiltMap objectNullableProp - test('to test the property `objectNullableProp`', () async { - // TODO - }); - - // BuiltMap objectAndItemsNullableProp - test('to test the property `objectAndItemsNullableProp`', () async { - // TODO - }); - - // BuiltMap objectItemsNullable - test('to test the property `objectItemsNullable`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart deleted file mode 100644 index 7167d78a49..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/number_only_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for NumberOnly -void main() { - final instance = NumberOnlyBuilder(); - // TODO add properties to the builder and call build() - - group(NumberOnly, () { - // num justNumber - test('to test the property `justNumber`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart deleted file mode 100644 index cd04ed4d48..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/object_with_deprecated_fields_test.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ObjectWithDeprecatedFields -void main() { - final instance = ObjectWithDeprecatedFieldsBuilder(); - // TODO add properties to the builder and call build() - - group(ObjectWithDeprecatedFields, () { - // String uuid - test('to test the property `uuid`', () async { - // TODO - }); - - // num id - test('to test the property `id`', () async { - // TODO - }); - - // DeprecatedObject deprecatedRef - test('to test the property `deprecatedRef`', () async { - // TODO - }); - - // BuiltList bars - test('to test the property `bars`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart deleted file mode 100644 index 7ff992230b..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/order_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Order -void main() { - final instance = OrderBuilder(); - // TODO add properties to the builder and call build() - - group(Order, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // int petId - test('to test the property `petId`', () async { - // TODO - }); - - // int quantity - test('to test the property `quantity`', () async { - // TODO - }); - - // DateTime shipDate - test('to test the property `shipDate`', () async { - // TODO - }); - - // Order Status - // String status - test('to test the property `status`', () async { - // TODO - }); - - // bool complete (default value: false) - test('to test the property `complete`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart deleted file mode 100644 index dac257d9a0..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_composite_test.dart +++ /dev/null @@ -1,26 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterComposite -void main() { - final instance = OuterCompositeBuilder(); - // TODO add properties to the builder and call build() - - group(OuterComposite, () { - // num myNumber - test('to test the property `myNumber`', () async { - // TODO - }); - - // String myString - test('to test the property `myString`', () async { - // TODO - }); - - // bool myBoolean - test('to test the property `myBoolean`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart deleted file mode 100644 index 502c8326be..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumDefaultValue -void main() { - - group(OuterEnumDefaultValue, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart deleted file mode 100644 index c535fe8ac3..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_default_value_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumIntegerDefaultValue -void main() { - - group(OuterEnumIntegerDefaultValue, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart deleted file mode 100644 index d945bc8c48..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_integer_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnumInteger -void main() { - - group(OuterEnumInteger, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart deleted file mode 100644 index 8e11eb02fb..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_enum_test.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterEnum -void main() { - - group(OuterEnum, () { - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart deleted file mode 100644 index d6d763c5d9..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/outer_object_with_enum_property_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for OuterObjectWithEnumProperty -void main() { - final instance = OuterObjectWithEnumPropertyBuilder(); - // TODO add properties to the builder and call build() - - group(OuterObjectWithEnumProperty, () { - // OuterEnumInteger value - test('to test the property `value`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart deleted file mode 100644 index c4bf8d6996..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_api_test.dart +++ /dev/null @@ -1,80 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for PetApi -void main() { - final instance = Openapi().getPetApi(); - - group(PetApi, () { - // Add a new pet to the store - // - //Future addPet(Pet pet) async - test('test addPet', () async { - // TODO - }); - - // Deletes a pet - // - //Future deletePet(int petId, { String apiKey }) async - test('test deletePet', () async { - // TODO - }); - - // Finds Pets by status - // - // Multiple status values can be provided with comma separated strings - // - //Future> findPetsByStatus(BuiltList status) async - test('test findPetsByStatus', () async { - // TODO - }); - - // Finds Pets by tags - // - // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - // - //Future> findPetsByTags(BuiltSet tags) async - test('test findPetsByTags', () async { - // TODO - }); - - // Find pet by ID - // - // Returns a single pet - // - //Future getPetById(int petId) async - test('test getPetById', () async { - // TODO - }); - - // Update an existing pet - // - //Future updatePet(Pet pet) async - test('test updatePet', () async { - // TODO - }); - - // Updates a pet in the store with form data - // - //Future updatePetWithForm(int petId, { String name, String status }) async - test('test updatePetWithForm', () async { - // TODO - }); - - // uploads an image - // - //Future uploadFile(int petId, { String additionalMetadata, MultipartFile file }) async - test('test uploadFile', () async { - // TODO - }); - - // uploads an image (required) - // - //Future uploadFileWithRequiredFile(int petId, MultipartFile requiredFile, { String additionalMetadata }) async - test('test uploadFileWithRequiredFile', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart deleted file mode 100644 index b2bac5351d..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/pet_test.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Pet -void main() { - final instance = PetBuilder(); - // TODO add properties to the builder and call build() - - group(Pet, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // Category category - test('to test the property `category`', () async { - // TODO - }); - - // String name - test('to test the property `name`', () async { - // TODO - }); - - // BuiltSet photoUrls - test('to test the property `photoUrls`', () async { - // TODO - }); - - // BuiltList tags - test('to test the property `tags`', () async { - // TODO - }); - - // pet status in the store - // String status - test('to test the property `status`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart deleted file mode 100644 index 550d3d793e..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/read_only_first_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for ReadOnlyFirst -void main() { - final instance = ReadOnlyFirstBuilder(); - // TODO add properties to the builder and call build() - - group(ReadOnlyFirst, () { - // String bar - test('to test the property `bar`', () async { - // TODO - }); - - // String baz - test('to test the property `baz`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart deleted file mode 100644 index 08a4592a1e..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/special_model_name_test.dart +++ /dev/null @@ -1,16 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for SpecialModelName -void main() { - final instance = SpecialModelNameBuilder(); - // TODO add properties to the builder and call build() - - group(SpecialModelName, () { - // int dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket - test('to test the property `dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart deleted file mode 100644 index 9eac725762..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/store_api_test.dart +++ /dev/null @@ -1,45 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for StoreApi -void main() { - final instance = Openapi().getStoreApi(); - - group(StoreApi, () { - // Delete purchase order by ID - // - // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - // - //Future deleteOrder(String orderId) async - test('test deleteOrder', () async { - // TODO - }); - - // Returns pet inventories by status - // - // Returns a map of status codes to quantities - // - //Future> getInventory() async - test('test getInventory', () async { - // TODO - }); - - // Find purchase order by ID - // - // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - // - //Future getOrderById(int orderId) async - test('test getOrderById', () async { - // TODO - }); - - // Place an order for a pet - // - //Future placeOrder(Order order) async - test('test placeOrder', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart deleted file mode 100644 index 6f7c63b8f0..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/tag_test.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for Tag -void main() { - final instance = TagBuilder(); - // TODO add properties to the builder and call build() - - group(Tag, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String name - test('to test the property `name`', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart deleted file mode 100644 index 01eaad61fc..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_api_test.dart +++ /dev/null @@ -1,73 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - - -/// tests for UserApi -void main() { - final instance = Openapi().getUserApi(); - - group(UserApi, () { - // Create user - // - // This can only be done by the logged in user. - // - //Future createUser(User user) async - test('test createUser', () async { - // TODO - }); - - // Creates list of users with given input array - // - //Future createUsersWithArrayInput(BuiltList user) async - test('test createUsersWithArrayInput', () async { - // TODO - }); - - // Creates list of users with given input array - // - //Future createUsersWithListInput(BuiltList user) async - test('test createUsersWithListInput', () async { - // TODO - }); - - // Delete user - // - // This can only be done by the logged in user. - // - //Future deleteUser(String username) async - test('test deleteUser', () async { - // TODO - }); - - // Get user by user name - // - //Future getUserByName(String username) async - test('test getUserByName', () async { - // TODO - }); - - // Logs user into the system - // - //Future loginUser(String username, String password) async - test('test loginUser', () async { - // TODO - }); - - // Logs out current logged in user session - // - //Future logoutUser() async - test('test logoutUser', () async { - // TODO - }); - - // Updated user - // - // This can only be done by the logged in user. - // - //Future updateUser(String username, User user) async - test('test updateUser', () async { - // TODO - }); - - }); -} diff --git a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart b/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart deleted file mode 100644 index 1e6a1bc23f..0000000000 --- a/samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake/test/user_test.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:test/test.dart'; -import 'package:openapi/openapi.dart'; - -// tests for User -void main() { - final instance = UserBuilder(); - // TODO add properties to the builder and call build() - - group(User, () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // String username - test('to test the property `username`', () async { - // TODO - }); - - // String firstName - test('to test the property `firstName`', () async { - // TODO - }); - - // String lastName - test('to test the property `lastName`', () async { - // TODO - }); - - // String email - test('to test the property `email`', () async { - // TODO - }); - - // String password - test('to test the property `password`', () async { - // TODO - }); - - // String phone - test('to test the property `phone`', () async { - // TODO - }); - - // User Status - // int userStatus - test('to test the property `userStatus`', () async { - // TODO - }); - - }); -} From acadba4bfb49dd4785e23b67ef8e0784cf9014a9 Mon Sep 17 00:00:00 2001 From: Tal Kirshboim Date: Fri, 17 Dec 2021 05:12:47 +0100 Subject: [PATCH 31/54] Declare Kotlin API classes as open (#11129) --- .../libraries/multiplatform/api.mustache | 4 ++-- .../org/openapitools/client/apis/PetApi.kt | 18 +++++++++--------- .../org/openapitools/client/apis/StoreApi.kt | 10 +++++----- .../org/openapitools/client/apis/UserApi.kt | 18 +++++++++--------- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache index c523b913d2..7449f13a4c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/multiplatform/api.mustache @@ -16,7 +16,7 @@ import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* {{#operations}} -{{#nonPublicApi}}internal {{/nonPublicApi}}class {{classname}}( +{{#nonPublicApi}}internal {{/nonPublicApi}}open class {{classname}}( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -33,7 +33,7 @@ import kotlinx.serialization.encoding.* {{#returnType}} @Suppress("UNCHECKED_CAST") {{/returnType}} - suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> { + open suspend fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}): HttpResponse<{{{returnType}}}{{^returnType}}Unit{{/returnType}}> { val localVariableAuthNames = listOf({{#authMethods}}"{{name}}"{{^-last}}, {{/-last}}{{/authMethods}}) diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt index 1cdbc9d105..d8bd813cbe 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/PetApi.kt @@ -34,7 +34,7 @@ import kotlinx.serialization.* import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* -class PetApi( +open class PetApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -47,7 +47,7 @@ class PetApi( * @param body Pet object that needs to be added to the store * @return void */ - suspend fun addPet(body: Pet): HttpResponse { + open suspend fun addPet(body: Pet): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -80,7 +80,7 @@ class PetApi( * @param apiKey (optional) * @return void */ - suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): HttpResponse { + open suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -114,7 +114,7 @@ class PetApi( * @return kotlin.collections.List */ @Suppress("UNCHECKED_CAST") - suspend fun findPetsByStatus(status: kotlin.collections.List): HttpResponse> { + open suspend fun findPetsByStatus(status: kotlin.collections.List): HttpResponse> { val localVariableAuthNames = listOf("petstore_auth") @@ -158,7 +158,7 @@ class PetApi( * @return kotlin.collections.List */ @Suppress("UNCHECKED_CAST") - suspend fun findPetsByTags(tags: kotlin.collections.List): HttpResponse> { + open suspend fun findPetsByTags(tags: kotlin.collections.List): HttpResponse> { val localVariableAuthNames = listOf("petstore_auth") @@ -202,7 +202,7 @@ class PetApi( * @return Pet */ @Suppress("UNCHECKED_CAST") - suspend fun getPetById(petId: kotlin.Long): HttpResponse { + open suspend fun getPetById(petId: kotlin.Long): HttpResponse { val localVariableAuthNames = listOf("api_key") @@ -234,7 +234,7 @@ class PetApi( * @param body Pet object that needs to be added to the store * @return void */ - suspend fun updatePet(body: Pet): HttpResponse { + open suspend fun updatePet(body: Pet): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -268,7 +268,7 @@ class PetApi( * @param status Updated status of the pet (optional) * @return void */ - suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): HttpResponse { + open suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") @@ -306,7 +306,7 @@ class PetApi( * @return ModelApiResponse */ @Suppress("UNCHECKED_CAST") - suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { + open suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: io.ktor.client.request.forms.InputProvider?): HttpResponse { val localVariableAuthNames = listOf("petstore_auth") diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt index ab2acfc425..057d82fce9 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -33,7 +33,7 @@ import kotlinx.serialization.* import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* -class StoreApi( +open class StoreApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -46,7 +46,7 @@ class StoreApi( * @param orderId ID of the order that needs to be deleted * @return void */ - suspend fun deleteOrder(orderId: kotlin.String): HttpResponse { + open suspend fun deleteOrder(orderId: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -78,7 +78,7 @@ class StoreApi( * @return kotlin.collections.Map */ @Suppress("UNCHECKED_CAST") - suspend fun getInventory(): HttpResponse> { + open suspend fun getInventory(): HttpResponse> { val localVariableAuthNames = listOf("api_key") @@ -121,7 +121,7 @@ class StoreApi( * @return Order */ @Suppress("UNCHECKED_CAST") - suspend fun getOrderById(orderId: kotlin.Long): HttpResponse { + open suspend fun getOrderById(orderId: kotlin.Long): HttpResponse { val localVariableAuthNames = listOf() @@ -154,7 +154,7 @@ class StoreApi( * @return Order */ @Suppress("UNCHECKED_CAST") - suspend fun placeOrder(body: Order): HttpResponse { + open suspend fun placeOrder(body: Order): HttpResponse { val localVariableAuthNames = listOf() diff --git a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt index 83832e3cfa..12e3221175 100644 --- a/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/UserApi.kt @@ -33,7 +33,7 @@ import kotlinx.serialization.* import kotlinx.serialization.descriptors.* import kotlinx.serialization.encoding.* -class UserApi( +open class UserApi( baseUrl: String = ApiClient.BASE_URL, httpClientEngine: HttpClientEngine? = null, httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, @@ -46,7 +46,7 @@ class UserApi( * @param body Created user object * @return void */ - suspend fun createUser(body: User): HttpResponse { + open suspend fun createUser(body: User): HttpResponse { val localVariableAuthNames = listOf() @@ -78,7 +78,7 @@ class UserApi( * @param body List of user object * @return void */ - suspend fun createUsersWithArrayInput(body: kotlin.collections.List): HttpResponse { + open suspend fun createUsersWithArrayInput(body: kotlin.collections.List): HttpResponse { val localVariableAuthNames = listOf() @@ -119,7 +119,7 @@ class UserApi( * @param body List of user object * @return void */ - suspend fun createUsersWithListInput(body: kotlin.collections.List): HttpResponse { + open suspend fun createUsersWithListInput(body: kotlin.collections.List): HttpResponse { val localVariableAuthNames = listOf() @@ -160,7 +160,7 @@ class UserApi( * @param username The name that needs to be deleted * @return void */ - suspend fun deleteUser(username: kotlin.String): HttpResponse { + open suspend fun deleteUser(username: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -193,7 +193,7 @@ class UserApi( * @return User */ @Suppress("UNCHECKED_CAST") - suspend fun getUserByName(username: kotlin.String): HttpResponse { + open suspend fun getUserByName(username: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -227,7 +227,7 @@ class UserApi( * @return kotlin.String */ @Suppress("UNCHECKED_CAST") - suspend fun loginUser(username: kotlin.String, password: kotlin.String): HttpResponse { + open suspend fun loginUser(username: kotlin.String, password: kotlin.String): HttpResponse { val localVariableAuthNames = listOf() @@ -260,7 +260,7 @@ class UserApi( * * @return void */ - suspend fun logoutUser(): HttpResponse { + open suspend fun logoutUser(): HttpResponse { val localVariableAuthNames = listOf() @@ -293,7 +293,7 @@ class UserApi( * @param body Updated user object * @return void */ - suspend fun updateUser(username: kotlin.String, body: User): HttpResponse { + open suspend fun updateUser(username: kotlin.String, body: User): HttpResponse { val localVariableAuthNames = listOf() From 1e3dd1f7c8ac580f5e4637b716ed6865ba7f9118 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCgmann?= Date: Fri, 17 Dec 2021 05:14:20 +0100 Subject: [PATCH 32/54] [Swift5] replace special characters in Swift enum var name (#11131) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * replace replaceSpecialCharacters in enum var names * test special characters in enum var names * ./bin/utils/export_docs_generators.sh * bring back replacement check for whole string * Revert "./bin/utils/export_docs_generators.sh" This reverts commit 63dfd33dd309739831d4f833f29817b28bdb45fe. Co-authored-by: Michael Brügmann --- .../languages/Swift5ClientCodegen.java | 75 ++++++++++++++----- .../swift5/Swift5ClientCodegenTest.java | 10 +++ 2 files changed, 65 insertions(+), 20 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 2cd6ebd8dd..4610b7ded0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -988,20 +988,22 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig return "empty"; } - Pattern startWithNumberPattern = Pattern.compile("^\\d+"); - Matcher startWithNumberMatcher = startWithNumberPattern.matcher(name); - if (startWithNumberMatcher.find()) { - String startingNumbers = startWithNumberMatcher.group(0); - String nameWithoutStartingNumbers = name.substring(startingNumbers.length()); + // Reserved Name + String nameLowercase = StringUtils.lowerCase(name); + if (isReservedWord(nameLowercase)) { + return escapeReservedWord(nameLowercase); + } - return "_" + startingNumbers + camelize(nameWithoutStartingNumbers, true); + // Prefix with underscore if name starts with number + if (name.matches("\\d.*")) { + return "_" + replaceSpecialCharacters(camelize(name, true)); } // for symbol, e.g. $, # if (getSymbolName(name) != null) { return camelize(WordUtils.capitalizeFully(getSymbolName(name).toUpperCase(Locale.ROOT)), true); } - + // Camelize only when we have a structure defined below Boolean camelized = false; if (name.matches("[A-Z][a-z0-9]+[a-zA-Z0-9]*")) { @@ -1009,34 +1011,67 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig camelized = true; } - // Reserved Name - String nameLowercase = StringUtils.lowerCase(name); - if (isReservedWord(nameLowercase)) { - return escapeReservedWord(nameLowercase); - } - // Check for numerical conversions if ("Int".equals(datatype) || "Int32".equals(datatype) || "Int64".equals(datatype) || "Float".equals(datatype) || "Double".equals(datatype)) { String varName = "number" + camelize(name); - varName = varName.replaceAll("-", "minus"); - varName = varName.replaceAll("\\+", "plus"); - varName = varName.replaceAll("\\.", "dot"); - return varName; + return replaceSpecialCharacters(varName); } // If we have already camelized the word, don't progress // any further if (camelized) { - return name; + return replaceSpecialCharacters(name); } char[] separators = {'-', '_', ' ', ':', '(', ')'}; - return camelize(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators) - .replaceAll("[-_ :\\(\\)]", ""), + return camelize(replaceSpecialCharacters(WordUtils.capitalizeFully(StringUtils.lowerCase(name), separators) + .replaceAll("[-_ :\\(\\)]", "")), true); } + private String replaceSpecialCharacters(String name) { + for (Map.Entry specialCharacters : specialCharReplacements.entrySet()) { + String specialChar = specialCharacters.getKey(); + String replacement = specialCharacters.getValue(); + // Underscore is the only special character we'll allow + if (!specialChar.equals("_") && name.contains(specialChar)) { + name = replaceCharacters(name, specialChar, replacement); + } + } + + // Fallback, replace unknowns with underscore. + name = name.replaceAll("\\W+", "_"); + + return name; + } + + private String replaceCharacters(String word, String oldValue, String newValue) { + if (!word.contains(oldValue)) { + return word; + } + if (word.equals(oldValue)) { + return newValue; + } + int i = word.indexOf(oldValue); + String start = word.substring(0, i); + String end = recurseOnEndOfWord(word, oldValue, newValue, i); + return start + newValue + end; + } + + private String recurseOnEndOfWord(String word, String oldValue, String newValue, int lastReplacedValue) { + String end = word.substring(lastReplacedValue + 1); + if (!end.isEmpty()) { + end = titleCase(end); + end = replaceCharacters(end, oldValue, newValue); + } + return end; + } + + private String titleCase(final String input) { + return input.substring(0, 1).toUpperCase(Locale.ROOT) + input.substring(1); + } + @Override public String toEnumName(CodegenProperty property) { String enumName = toModelName(property.name); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java index 8073f7065d..0f7e127371 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5ClientCodegenTest.java @@ -95,6 +95,16 @@ public class Swift5ClientCodegenTest { Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName123", null), "_123entryName123"); } + @Test(enabled = true) + public void testSpecialCharacters() throws Exception { + Assert.assertEquals(swiftCodegen.toEnumVarName("1:1", null), "_1Colon1"); + Assert.assertEquals(swiftCodegen.toEnumVarName("1:One", null), "_1ColonOne"); + Assert.assertEquals(swiftCodegen.toEnumVarName("Apple&Swift", null), "appleAmpersandSwift"); + Assert.assertEquals(swiftCodegen.toEnumVarName("$", null), "dollar"); + Assert.assertEquals(swiftCodegen.toEnumVarName("+1", null), "plus1"); + Assert.assertEquals(swiftCodegen.toEnumVarName(">=", null), "greaterThanOrEqualTo"); + } + @Test(description = "returns Data when response format is binary", enabled = true) public void binaryDataTest() { // TODO update json file From 490377c7b0697f2936081ac87b3d9cffbc1be8d3 Mon Sep 17 00:00:00 2001 From: Hui Yu Date: Fri, 17 Dec 2021 13:01:37 +0800 Subject: [PATCH 33/54] [C][Client] Support custom data type e.g.IntOrString (#11074) --- .../resources/C-libcurl/model-body.mustache | 53 +++++++++++++++++++ .../resources/C-libcurl/model-header.mustache | 10 ++++ .../resources/C-libcurl/model_doc.mustache | 2 +- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache index 3a513e9c2c..1f28e05e90 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-body.mustache @@ -136,6 +136,11 @@ char* {{name}}{{classname}}_ToString({{projectName}}_{{classVarName}}_{{enumName {{datatype}}_t *{{name}}{{^-last}},{{/-last}} {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{datatype}} *{{name}}{{^-last}},{{/-last}} {{/isUuid}} @@ -220,6 +225,14 @@ void {{classname}}_free({{classname}}_t *{{classname}}) { } {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + if ({{{classname}}}->{{{name}}}) { + {{{complexType}}}_free({{{classname}}}->{{{name}}}); + {{classname}}->{{name}} = NULL; + } + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} if ({{{classname}}}->{{{name}}}) { free({{{classname}}}->{{{name}}}); @@ -398,6 +411,18 @@ cJSON *{{classname}}_convertToJSON({{classname}}_t *{{classname}}) { } {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + cJSON *{{{name}}}_local_JSON = {{complexType}}_convertToJSON({{{classname}}}->{{{name}}}); + if({{{name}}}_local_JSON == NULL) { + goto fail; // custom + } + cJSON_AddItemToObject(item, "{{{baseName}}}", {{{name}}}_local_JSON); + if(item->child == NULL) { + goto fail; + } + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} if(cJSON_AddStringToObject(item, "{{{baseName}}}", {{{classname}}}->{{{name}}}) == NULL) { goto fail; //uuid @@ -528,6 +553,7 @@ fail: {{classname}}_t *{{classname}}_local_var = NULL; {{#vars}} + {{^isContainer}} {{^isPrimitiveType}} {{#isModel}} {{^isEnum}} @@ -536,7 +562,15 @@ fail: {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + // define the local variable for {{{classname}}}->{{{name}}} + {{complexType}}_t *{{name}}_local_nonprim = NULL; + + {{/isFreeFormObject}} + {{/isModel}} {{/isPrimitiveType}} + {{/isContainer}} {{/vars}} {{#vars}} // {{{classname}}}->{{{name}}} @@ -629,6 +663,12 @@ fail: {{{name}}}_local_nonprim = {{complexType}}{{#isFreeFormObject}}object{{/isFreeFormObject}}_parseFromJSON({{{name}}}); //nonprimitive {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{^required}}if ({{{name}}}) { {{/required}} + {{{name}}}_local_nonprim = {{complexType}}_parseFromJSON({{{name}}}); //custom + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{^required}}if ({{{name}}}) { {{/required}} if(!cJSON_IsString({{{name}}})) @@ -779,6 +819,11 @@ fail: {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{^required}}{{{name}}} ? {{/required}}{{{name}}}_local_nonprim{{^required}} : NULL{{/required}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{^required}}{{{name}}} ? {{/required}}strdup({{{name}}}->valuestring){{^required}} : NULL{{/required}}{{^-last}},{{/-last}} {{/isUuid}} @@ -849,6 +894,14 @@ end: } {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + if ({{{name}}}_local_nonprim) { + {{complexType}}_free({{{name}}}_local_nonprim); + {{{name}}}_local_nonprim = NULL; + } + {{/isFreeFormObject}} + {{/isModel}} {{/isPrimitiveType}} {{/isContainer}} {{/vars}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache index 5bdff9f1db..81aee8c17a 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model-header.mustache @@ -86,6 +86,11 @@ typedef struct {{classname}}_t { struct {{datatype}}_t *{{name}}; //model {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{datatype}}_t *{{name}}; // custom + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{datatype}} *{{name}}; // uuid {{/isUuid}} @@ -156,6 +161,11 @@ typedef struct {{classname}}_t { {{datatype}}_t *{{name}}{{^-last}},{{/-last}} {{/isEnum}} {{/isModel}} + {{^isModel}} + {{^isFreeFormObject}} + {{datatype}}_t *{{name}}{{^-last}},{{/-last}} + {{/isFreeFormObject}} + {{/isModel}} {{#isUuid}} {{datatype}} *{{name}}{{^-last}},{{/-last}} {{/isUuid}} diff --git a/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache b/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache index 77f14ca235..823834d7ae 100644 --- a/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/C-libcurl/model_doc.mustache @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- {{#vars}} -**{{name}}** | {{^isContainer}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isEnum}}{{^isEnum}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isEnum}}{{/isModel}}{{#isUuid}}**{{datatype}} \***{{/isUuid}}{{#isEmail}}**{{datatype}} \***{{/isEmail}}{{#isFreeFormObject}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isNumeric}}**{{datatype}}**{{/isNumeric}}{{#isBoolean}}**{{datatype}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{datatype}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{datatype}} \***{{/isByteArray}}{{#isBinary}}**{{datatype}}**{{/isBinary}}{{#isDate}}**{{datatype}} \***{{/isDate}}{{#isDateTime}}**{{datatype}} \***{{/isDateTime}}{{/isPrimitiveType}}{{/isContainer}}{{#isContainer}}{{#isArray}}{{#isPrimitiveType}}**{{datatype}}_t \***{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isPrimitiveType}}{{/isArray}}{{#isMap}}**{{datatype}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +**{{name}}** | {{^isContainer}}{{^isPrimitiveType}}{{#isModel}}{{#isEnum}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isEnum}}{{^isEnum}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isEnum}}{{/isModel}}{{^isModel}}{{^isFreeFormObject}}**{{datatype}}_t \***{{/isFreeFormObject}}{{/isModel}}{{#isUuid}}**{{datatype}} \***{{/isUuid}}{{#isEmail}}**{{datatype}} \***{{/isEmail}}{{#isFreeFormObject}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isFreeFormObject}}{{/isPrimitiveType}}{{#isPrimitiveType}}{{#isNumeric}}**{{datatype}}**{{/isNumeric}}{{#isBoolean}}**{{datatype}}**{{/isBoolean}}{{#isEnum}}{{#isString}}**{{projectName}}_{{classVarName}}_{{enumName}}_e**{{/isString}}{{/isEnum}}{{^isEnum}}{{#isString}}**{{datatype}} \***{{/isString}}{{/isEnum}}{{#isByteArray}}**{{datatype}} \***{{/isByteArray}}{{#isBinary}}**{{datatype}}**{{/isBinary}}{{#isDate}}**{{datatype}} \***{{/isDate}}{{#isDateTime}}**{{datatype}} \***{{/isDateTime}}{{/isPrimitiveType}}{{/isContainer}}{{#isContainer}}{{#isArray}}{{#isPrimitiveType}}**{{datatype}}_t \***{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}_t**]({{complexType}}.md) \*{{/isPrimitiveType}}{{/isArray}}{{#isMap}}**{{datatype}}**{{/isMap}}{{/isContainer}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) From 7dbcac3b6c0679764dcb9f7dd277e5fde5ab16ba Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Fri, 17 Dec 2021 10:24:21 +0300 Subject: [PATCH 34/54] [php-slim4] Switch to Packaged Body Parsing Middleware (#9562) * Remove custom JSON parsing middleware * Enable packaged Body Parsing Middleware Ref: https://www.slimframework.com/docs/v4/middleware/body-parsing.html * Refresh samples --- .../languages/PhpSlim4ServerCodegen.java | 3 -- .../php-slim4-server/SlimRouter.mustache | 3 +- .../resources/php-slim4-server/index.mustache | 3 ++ .../json_body_parser_middleware.mustache | 51 ------------------- .../php-slim4/.openapi-generator/FILES | 1 - .../petstore/php-slim4/lib/SlimRouter.php | 3 +- .../petstore/php-slim4/public/index.php | 3 ++ 7 files changed, 8 insertions(+), 59 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java index 6f0f9e7264..088334c55d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java @@ -213,12 +213,9 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist")); supportingFiles.add(new SupportingFile("phpcs.xml.mustache", "", "phpcs.xml.dist")); - // Slim 4 doesn't parse JSON body anymore we need to add suggested middleware - // ref: https://www.slimframework.com/docs/v4/objects/request.html#the-request-body supportingFiles.add(new SupportingFile("htaccess_deny_all", "config", ".htaccess")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "dev", "example.inc.php")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "prod", "example.inc.php")); - supportingFiles.add(new SupportingFile("json_body_parser_middleware.mustache", toSrcPath(invokerPackage + "\\Middleware", srcBasePath), "JsonBodyParserMiddleware.php")); supportingFiles.add(new SupportingFile("base_model.mustache", toSrcPath(invokerPackage, srcBasePath), "BaseModel.php")); supportingFiles.add(new SupportingFile("base_model_test.mustache", toSrcPath(invokerPackage, testBasePath), "BaseModelTest.php")); } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache index 84ebd5b2d4..ded9ca8cfa 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache @@ -17,7 +17,6 @@ use InvalidArgumentException; use Dyorg\TokenAuthentication; use Dyorg\TokenAuthentication\TokenSearch; use Psr\Http\Message\ServerRequestInterface; -use {{invokerPackage}}\Middleware\JsonBodyParserMiddleware; use OpenAPIServer\Mock\OpenApiDataMocker; use OpenAPIServer\Mock\OpenApiDataMockerRouteMiddleware; {{#isSlimPsr7}} @@ -185,7 +184,7 @@ class SlimRouter $message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?"; throw new HttpNotImplementedException($request, $message); }; - $middlewares = [new JsonBodyParserMiddleware()]; + $middlewares = []; if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) { $callback = "\\{$operation['apiPackage']}\\{$operation['userClassname']}:{$operation['operationId']}"; diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache index 66f3962685..305f7cf8b5 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache @@ -28,6 +28,9 @@ if (is_array($prodConfig = @include(__DIR__ . '/../config/prod/config.inc.php')) $router = new SlimRouter($config); $app = $router->getSlimApp(); +// Parse json, form data and xml +$app->addBodyParsingMiddleware(); + /** * The routing middleware should be added before the ErrorMiddleware * Otherwise exceptions thrown from it will not be handled diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache deleted file mode 100644 index 509ec7247c..0000000000 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/json_body_parser_middleware.mustache +++ /dev/null @@ -1,51 +0,0 @@ -licenseInfo}} - -/** - * NOTE: This class is auto generated by the openapi generator program. - * https://github.com/openapitools/openapi-generator - * Do not edit the class manually. - */{{#apiInfo}} -namespace {{invokerPackage}}\Middleware; - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Server\MiddlewareInterface; -use Psr\Http\Server\RequestHandlerInterface; - -/** - * JsonBodyParserMiddleware Class Doc Comment - * - * @package {{invokerPackage}}\Middleware - * @author OpenAPI Generator team - * @link https://github.com/openapitools/openapi-generator - */ -final class JsonBodyParserMiddleware implements MiddlewareInterface -{ - - /** - * Parse incoming JSON input into a native PHP format - * Copied from Slim4 guide - * @ref https://www.slimframework.com/docs/v4/objects/request.html#the-request-body - * - * @param ServerRequestInterface $request HTTP request - * @param RequestHandlerInterface $handler Request handler - * - * @return ResponseInterface HTTP response - */ - public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface - { - $contentType = $request->getHeaderLine('Content-Type'); - - if (strstr($contentType, 'application/json')) { - $contents = json_decode(file_get_contents('php://input'), true); - if (json_last_error() === JSON_ERROR_NONE) { - $request = $request->withParsedBody($contents); - } - } - - return $handler->handle($request); - } -} -{{/apiInfo}} diff --git a/samples/server/petstore/php-slim4/.openapi-generator/FILES b/samples/server/petstore/php-slim4/.openapi-generator/FILES index 7009058611..40c7067f10 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/FILES +++ b/samples/server/petstore/php-slim4/.openapi-generator/FILES @@ -9,7 +9,6 @@ lib/Api/AbstractStoreApi.php lib/Api/AbstractUserApi.php lib/Auth/AbstractAuthenticator.php lib/BaseModel.php -lib/Middleware/JsonBodyParserMiddleware.php lib/Model/ApiResponse.php lib/Model/Category.php lib/Model/Order.php diff --git a/samples/server/petstore/php-slim4/lib/SlimRouter.php b/samples/server/petstore/php-slim4/lib/SlimRouter.php index c0b9c2bda9..1f81b223d2 100644 --- a/samples/server/petstore/php-slim4/lib/SlimRouter.php +++ b/samples/server/petstore/php-slim4/lib/SlimRouter.php @@ -30,7 +30,6 @@ use InvalidArgumentException; use Dyorg\TokenAuthentication; use Dyorg\TokenAuthentication\TokenSearch; use Psr\Http\Message\ServerRequestInterface; -use OpenAPIServer\Middleware\JsonBodyParserMiddleware; use OpenAPIServer\Mock\OpenApiDataMocker; use OpenAPIServer\Mock\OpenApiDataMockerRouteMiddleware; use Slim\Psr7\Factory\ResponseFactory; @@ -890,7 +889,7 @@ class SlimRouter $message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?"; throw new HttpNotImplementedException($request, $message); }; - $middlewares = [new JsonBodyParserMiddleware()]; + $middlewares = []; if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) { $callback = "\\{$operation['apiPackage']}\\{$operation['userClassname']}:{$operation['operationId']}"; diff --git a/samples/server/petstore/php-slim4/public/index.php b/samples/server/petstore/php-slim4/public/index.php index 07ab220a08..9993535af7 100644 --- a/samples/server/petstore/php-slim4/public/index.php +++ b/samples/server/petstore/php-slim4/public/index.php @@ -40,6 +40,9 @@ if (is_array($prodConfig = @include(__DIR__ . '/../config/prod/config.inc.php')) $router = new SlimRouter($config); $app = $router->getSlimApp(); +// Parse json, form data and xml +$app->addBodyParsingMiddleware(); + /** * The routing middleware should be added before the ErrorMiddleware * Otherwise exceptions thrown from it will not be handled From d65bf8d1a6dffafe4389041d9205f11e85c754fa Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Fri, 17 Dec 2021 11:11:06 +0300 Subject: [PATCH 35/54] [php-slim4] Partial generation (#11069) * Update tests folder I forgot to update tests folder in latest PR. Fixing my mistake. * Implement part generation --- .../languages/PhpSlim4ServerCodegen.java | 22 ++++++- .../php-slim4-server/README.mustache | 6 ++ .../php-slim4-server/composer.mustache | 8 +++ .../php-slim4-server/phpunit.xml.mustache | 4 ++ .../Middleware/JsonBodyParserMiddleware.php | 63 ------------------- .../php-slim4/tests/Api/PetApiTest.php | 2 +- .../php-slim4/tests/Api/StoreApiTest.php | 2 +- .../php-slim4/tests/Api/UserApiTest.php | 2 +- .../php-slim4/tests/Model/ApiResponseTest.php | 2 +- .../php-slim4/tests/Model/CategoryTest.php | 2 +- .../php-slim4/tests/Model/OrderTest.php | 2 +- .../php-slim4/tests/Model/PetTest.php | 2 +- .../php-slim4/tests/Model/TagTest.php | 2 +- .../php-slim4/tests/Model/UserTest.php | 2 +- 14 files changed, 46 insertions(+), 75 deletions(-) delete mode 100644 samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java index 088334c55d..7e318dee20 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java @@ -158,6 +158,10 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { public void processOpts() { super.processOpts(); + Boolean generateModels = additionalProperties.containsKey(CodegenConstants.GENERATE_MODELS) && Boolean.TRUE.equals(additionalProperties.get(CodegenConstants.GENERATE_MODELS)); + Boolean generateApiTests = additionalProperties.containsKey(CodegenConstants.GENERATE_API_TESTS) && Boolean.TRUE.equals(additionalProperties.get(CodegenConstants.GENERATE_API_TESTS)); + Boolean generateModelTests = additionalProperties.containsKey(CodegenConstants.GENERATE_MODEL_TESTS) && Boolean.TRUE.equals(additionalProperties.get(CodegenConstants.GENERATE_MODEL_TESTS)); + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { // Update the invokerPackage for the default authPackage authPackage = invokerPackage + "\\" + authDirName; @@ -210,14 +214,26 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { supportingFiles.add(new SupportingFile("index.mustache", "public", "index.php")); supportingFiles.add(new SupportingFile(".htaccess", "public", ".htaccess")); supportingFiles.add(new SupportingFile("SlimRouter.mustache", toSrcPath(invokerPackage, srcBasePath), "SlimRouter.php")); - supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist")); + + // don't generate phpunit config when tests generation disabled + if (Boolean.TRUE.equals(generateApiTests) || Boolean.TRUE.equals(generateModelTests)) { + supportingFiles.add(new SupportingFile("phpunit.xml.mustache", "", "phpunit.xml.dist")); + additionalProperties.put("generateTests", Boolean.TRUE); + } + supportingFiles.add(new SupportingFile("phpcs.xml.mustache", "", "phpcs.xml.dist")); supportingFiles.add(new SupportingFile("htaccess_deny_all", "config", ".htaccess")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "dev", "example.inc.php")); supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "prod", "example.inc.php")); - supportingFiles.add(new SupportingFile("base_model.mustache", toSrcPath(invokerPackage, srcBasePath), "BaseModel.php")); - supportingFiles.add(new SupportingFile("base_model_test.mustache", toSrcPath(invokerPackage, testBasePath), "BaseModelTest.php")); + + if (Boolean.TRUE.equals(generateModels)) { + supportingFiles.add(new SupportingFile("base_model.mustache", toSrcPath(invokerPackage, srcBasePath), "BaseModel.php")); + } + + if (Boolean.TRUE.equals(generateModelTests)) { + supportingFiles.add(new SupportingFile("base_model_test.mustache", toSrcPath(invokerPackage, testBasePath), "BaseModelTest.php")); + } } @Override diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache index 9435bf7f24..d85b12e3bd 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache @@ -46,6 +46,7 @@ $ php -S localhost:8888 -t php-slim-server/public > It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. > It is not intended to be a full-featured web server. It should not be used on a public network. +{{#generateTests}} ## Tests ### PHPUnit @@ -59,9 +60,14 @@ How to write tests read at [2. Writing Tests for PHPUnit - PHPUnit 8.5 Manual](h Command | Target ---- | ---- `$ composer test` | All tests +{{#generateApiTests}} `$ composer test-apis` | Apis tests +{{/generateApiTests}} +{{#generateModelTests}} `$ composer test-models` | Models tests +{{/generateModelTests}} +{{/generateTests}} #### Config Package contains fully functional config `./phpunit.xml.dist` file. Create `./phpunit.xml` in root folder to override it. diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache index 803a0c140c..e514b055f5 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache @@ -29,7 +29,9 @@ {{/isZendDiactoros}} }, "require-dev": { + {{#generateTests}} "phpunit/phpunit": "^8.0 || ^9.0", + {{/generateTests}} "overtrue/phplint": "^2.0.2", "squizlabs/php_codesniffer": "^3.5" }, @@ -43,11 +45,17 @@ "psr-4": { "{{escapedInvokerPackage}}\\": "{{testBasePath}}/" } }, "scripts": { + {{#generateTests}} "test": [ "phpunit" ], + {{#generateApiTests}} "test-apis": "phpunit --testsuite Apis", + {{/generateApiTests}} + {{#generateModelTests}} "test-models": "phpunit --testsuite Models", + {{/generateModelTests}} + {{/generateTests}} "phpcs": "phpcs", "phplint": "phplint ./ --exclude=vendor" } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache index 026da14ad2..ce86808786 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/phpunit.xml.mustache @@ -8,13 +8,17 @@ + {{#generateApiTests}} {{apiTestPath}} + {{/generateApiTests}} + {{#generateModelTests}} ./{{testBasePath}}/BaseModelTest.php {{modelTestPath}} + {{/generateModelTests}} diff --git a/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php b/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php deleted file mode 100644 index b1199ffd84..0000000000 --- a/samples/server/petstore/php-slim4/lib/Middleware/JsonBodyParserMiddleware.php +++ /dev/null @@ -1,63 +0,0 @@ -getHeaderLine('Content-Type'); - - if (strstr($contentType, 'application/json')) { - $contents = json_decode(file_get_contents('php://input'), true); - if (json_last_error() === JSON_ERROR_NONE) { - $request = $request->withParsedBody($contents); - } - } - - return $handler->handle($request); - } -} diff --git a/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php b/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php index 2eaed45a50..57f84475b1 100644 --- a/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php +++ b/samples/server/petstore/php-slim4/tests/Api/PetApiTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php b/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php index b6d114045d..6bbf53f33a 100644 --- a/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php +++ b/samples/server/petstore/php-slim4/tests/Api/StoreApiTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php b/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php index cee6da4398..2b22f5a59f 100644 --- a/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php +++ b/samples/server/petstore/php-slim4/tests/Api/UserApiTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php b/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php index 0190bd0490..512c9d55ae 100644 --- a/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/ApiResponseTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php b/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php index e951b3673d..c97b1ce833 100644 --- a/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/CategoryTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/OrderTest.php b/samples/server/petstore/php-slim4/tests/Model/OrderTest.php index 4275ab148c..5526532919 100644 --- a/samples/server/petstore/php-slim4/tests/Model/OrderTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/OrderTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/PetTest.php b/samples/server/petstore/php-slim4/tests/Model/PetTest.php index d1ef40bc9d..c7fcbb8251 100644 --- a/samples/server/petstore/php-slim4/tests/Model/PetTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/PetTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/TagTest.php b/samples/server/petstore/php-slim4/tests/Model/TagTest.php index e5bf71c622..a5b8e1355c 100644 --- a/samples/server/petstore/php-slim4/tests/Model/TagTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/TagTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team diff --git a/samples/server/petstore/php-slim4/tests/Model/UserTest.php b/samples/server/petstore/php-slim4/tests/Model/UserTest.php index 563fbaae4a..3146ca6f62 100644 --- a/samples/server/petstore/php-slim4/tests/Model/UserTest.php +++ b/samples/server/petstore/php-slim4/tests/Model/UserTest.php @@ -2,7 +2,7 @@ /** * OpenAPI Petstore - * PHP version 7.2 + * PHP version 7.4 * * @package OpenAPIServer * @author OpenAPI Generator team From b72eba90cddddafd1def4189215d2bd306901901 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Sat, 18 Dec 2021 23:22:55 +0800 Subject: [PATCH 36/54] [java][okhttp-gson-nextgen] better oneOf implementation (#11146) * add validJsonObject method * add check for null * fix list model generation * fix optional fields validation * add tests * fix variable naming * update tests * add fromJson in oneOf, add tests * convert JSON to static * remove trailing space * add fromString methods to all models * add toJson, fix anyOf template * remove workarounds * undo changes to tests * skip file schema test * add new file --- bin/configs/java-okhttp-gson-nextgen.yaml | 3 +- .../okhttp-gson-nextgen/JSON.mustache | 58 +- .../okhttp-gson-nextgen/anyof_model.mustache | 53 +- .../okhttp-gson-nextgen/oneof_model.mustache | 50 +- .../okhttp-gson-nextgen/pojo.mustache | 140 +- .../java/spring/SpringCodegenTest.java | 4 +- ...th-http-signature-okhttp-gson-nextgen.yaml | 2184 +++++++++++++++++ ...sting-with-http-signature-okhttp-gson.yaml | 39 + .../java-micronaut-client/docs/ModelFile.md | 17 + .../java-micronaut-client/docs/ModelList.md | 16 + .../org/openapitools/model/ModelFile.java | 100 + .../org/openapitools/model/ModelList.java | 99 + .../openapitools/model/ModelFileSpec.groovy | 30 + .../openapitools/model/ModelListSpec.groovy | 30 + .../java/apache-httpclient/docs/ModelFile.md | 14 + .../java/apache-httpclient/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../openapitools/client/model/ModelFile.java | 110 + .../openapitools/client/model/ModelList.java | 109 + .../client/model/ModelFileTest.java | 48 + .../client/model/ModelListTest.java | 48 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 48 + .../client/model/ModelListTest.java | 48 + .../java/google-api-client/docs/ModelFile.md | 14 + .../java/google-api-client/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/jersey1/docs/ModelFile.md | 14 + .../petstore/java/jersey1/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../docs/ModelFile.md | 14 + .../docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 113 + .../openapitools/client/model/ModelList.java | 112 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/jersey2-java8/docs/ModelFile.md | 14 + .../java/jersey2-java8/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 113 + .../openapitools/client/model/ModelList.java | 112 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/native-async/docs/ModelFile.md | 14 + .../java/native-async/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 112 + .../openapitools/client/model/ModelList.java | 111 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/native/docs/ModelFile.md | 14 + .../petstore/java/native/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 112 + .../openapitools/client/model/ModelList.java | 111 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../docs/ModelFile.md | 14 + .../docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java} | 28 +- .../client/model/ModelListTest.java | 51 + .../.openapi-generator/FILES | 4 +- .../java/okhttp-gson-nextgen/README.md | 3 +- .../java/okhttp-gson-nextgen/api/openapi.yaml | 74 +- .../java/okhttp-gson-nextgen/docs/FakeApi.md | 58 - .../okhttp-gson-nextgen/docs/ModelFile.md | 14 + .../okhttp-gson-nextgen/docs/ModelList.md | 13 + .../docs/PetWithRequiredTags.md | 28 + .../java/org/openapitools/client/JSON.java | 48 +- .../org/openapitools/client/api/FakeApi.java | 110 - .../model/AdditionalPropertiesClass.java | 61 +- .../org/openapitools/client/model/Animal.java | 67 + .../org/openapitools/client/model/Apple.java | 61 +- .../openapitools/client/model/AppleReq.java | 75 +- .../model/ArrayOfArrayOfNumberOnly.java | 61 +- .../client/model/ArrayOfNumberOnly.java | 61 +- .../openapitools/client/model/ArrayTest.java | 61 +- .../org/openapitools/client/model/Banana.java | 61 +- .../openapitools/client/model/BananaReq.java | 75 +- .../openapitools/client/model/BasquePig.java | 75 +- .../client/model/Capitalization.java | 61 +- .../org/openapitools/client/model/Cat.java | 75 +- .../openapitools/client/model/CatAllOf.java | 61 +- .../openapitools/client/model/Category.java | 75 +- .../openapitools/client/model/ClassModel.java | 61 +- .../org/openapitools/client/model/Client.java | 61 +- .../client/model/ComplexQuadrilateral.java | 75 +- .../openapitools/client/model/DanishPig.java | 75 +- .../client/model/DeprecatedObject.java | 61 +- .../org/openapitools/client/model/Dog.java | 75 +- .../openapitools/client/model/DogAllOf.java | 61 +- .../openapitools/client/model/Drawing.java | 80 +- .../openapitools/client/model/EnumArrays.java | 61 +- .../openapitools/client/model/EnumTest.java | 75 +- .../client/model/EquilateralTriangle.java | 75 +- .../org/openapitools/client/model/Foo.java | 61 +- .../openapitools/client/model/FormatTest.java | 75 +- .../org/openapitools/client/model/Fruit.java | 59 +- .../openapitools/client/model/FruitReq.java | 59 +- .../openapitools/client/model/GmFruit.java | 64 +- .../client/model/GrandparentAnimal.java | 63 + .../client/model/HasOnlyReadOnly.java | 61 +- .../client/model/HealthCheckResult.java | 61 +- .../client/model/InlineResponseDefault.java | 65 +- .../client/model/IsoscelesTriangle.java | 75 +- .../org/openapitools/client/model/Mammal.java | 70 +- .../openapitools/client/model/MapTest.java | 61 +- ...ropertiesAndAdditionalPropertiesClass.java | 61 +- .../client/model/Model200Response.java | 61 +- .../client/model/ModelApiResponse.java | 61 +- .../openapitools/client/model/ModelFile.java | 204 ++ ...ileSchemaTestClass.java => ModelList.java} | 155 +- .../client/model/ModelReturn.java | 61 +- .../org/openapitools/client/model/Name.java | 75 +- .../client/model/NullableClass.java | 61 +- .../client/model/NullableShape.java | 59 +- .../openapitools/client/model/NumberOnly.java | 61 +- .../model/ObjectWithDeprecatedFields.java | 65 +- .../org/openapitools/client/model/Order.java | 61 +- .../client/model/OuterComposite.java | 61 +- .../openapitools/client/model/ParentPet.java | 75 +- .../org/openapitools/client/model/Pet.java | 86 +- .../client/model/PetWithRequiredTags.java | 437 ++++ .../org/openapitools/client/model/Pig.java | 59 +- .../client/model/Quadrilateral.java | 59 +- .../client/model/QuadrilateralInterface.java | 75 +- .../client/model/ReadOnlyFirst.java | 61 +- .../client/model/ScaleneTriangle.java | 75 +- .../org/openapitools/client/model/Shape.java | 59 +- .../client/model/ShapeInterface.java | 75 +- .../client/model/ShapeOrNull.java | 59 +- .../client/model/SimpleQuadrilateral.java | 75 +- .../client/model/SpecialModelName.java | 61 +- .../org/openapitools/client/model/Tag.java | 61 +- .../openapitools/client/model/Triangle.java | 70 +- .../client/model/TriangleInterface.java | 75 +- .../org/openapitools/client/model/User.java | 61 +- .../org/openapitools/client/model/Whale.java | 75 +- .../org/openapitools/client/model/Zebra.java | 75 +- .../org/openapitools/client/JSONTest.java | 54 +- .../openapitools/client/api/FakeApiTest.java | 16 - .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../client/model/PetWithRequiredTagsTest.java | 95 + .../docs/ModelFile.md | 18 + .../docs/ModelList.md | 17 + .../openapitools/client/model/ModelFile.java | 124 + .../openapitools/client/model/ModelList.java | 123 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/okhttp-gson/docs/ModelFile.md | 14 + .../java/okhttp-gson/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../rest-assured-jackson/docs/ModelFile.md | 14 + .../rest-assured-jackson/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 112 + .../openapitools/client/model/ModelList.java | 111 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/rest-assured/docs/ModelFile.md | 14 + .../java/rest-assured/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 104 + .../openapitools/client/model/ModelList.java | 103 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../petstore/java/resteasy/docs/ModelFile.md | 14 + .../petstore/java/resteasy/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../resttemplate-withXml/docs/ModelFile.md | 14 + .../resttemplate-withXml/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 117 + .../openapitools/client/model/ModelList.java | 116 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/resttemplate/docs/ModelFile.md | 14 + .../java/resttemplate/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/retrofit2-play26/docs/ModelFile.md | 14 + .../java/retrofit2-play26/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 111 + .../openapitools/client/model/ModelList.java | 110 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/retrofit2/docs/ModelFile.md | 14 + .../petstore/java/retrofit2/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/retrofit2rx2/docs/ModelFile.md | 14 + .../java/retrofit2rx2/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/retrofit2rx3/docs/ModelFile.md | 14 + .../java/retrofit2rx3/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 101 + .../openapitools/client/model/ModelList.java | 100 + .../client/model/ModelFileTest.java | 51 + .../client/model/ModelListTest.java | 51 + .../java/vertx-no-nullable/docs/ModelFile.md | 14 + .../java/vertx-no-nullable/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/vertx/docs/ModelFile.md | 14 + .../petstore/java/vertx/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../petstore/java/webclient/docs/ModelFile.md | 14 + .../petstore/java/webclient/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 109 + .../openapitools/client/model/ModelList.java | 108 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../java/jersey2-java8/docs/ModelFile.md | 14 + .../java/jersey2-java8/docs/ModelList.md | 13 + .../openapitools/client/model/ModelFile.java | 113 + .../openapitools/client/model/ModelList.java | 112 + .../client/model/ModelFileTest.java | 50 + .../client/model/ModelListTest.java | 50 + .../org/openapitools/model/ModelFile.java | 75 + .../org/openapitools/model/ModelList.java | 74 + .../app/apimodels/ModelFile.java | 75 + .../app/apimodels/ModelList.java | 75 + 247 files changed, 16330 insertions(+), 1135 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml create mode 100644 samples/client/petstore/java-micronaut-client/docs/ModelFile.md create mode 100644 samples/client/petstore/java-micronaut-client/docs/ModelList.md create mode 100644 samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java create mode 100644 samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java create mode 100644 samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy create mode 100644 samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy create mode 100644 samples/client/petstore/java/apache-httpclient/docs/ModelFile.md create mode 100644 samples/client/petstore/java/apache-httpclient/docs/ModelList.md create mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/google-api-client/docs/ModelFile.md create mode 100644 samples/client/petstore/java/google-api-client/docs/ModelList.md create mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/jersey1/docs/ModelFile.md create mode 100644 samples/client/petstore/java/jersey1/docs/ModelList.md create mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/docs/ModelFile.md create mode 100644 samples/client/petstore/java/jersey2-java8/docs/ModelList.md create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/native-async/docs/ModelFile.md create mode 100644 samples/client/petstore/java/native-async/docs/ModelList.md create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/native/docs/ModelFile.md create mode 100644 samples/client/petstore/java/native/docs/ModelList.md create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java rename samples/client/petstore/java/{okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java => okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java} (63%) create mode 100644 samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java rename samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/{FileSchemaTestClass.java => ModelList.java} (50%) create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/docs/ModelFile.md create mode 100644 samples/client/petstore/java/okhttp-gson/docs/ModelList.md create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md create mode 100644 samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/rest-assured/docs/ModelFile.md create mode 100644 samples/client/petstore/java/rest-assured/docs/ModelList.md create mode 100644 samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/resteasy/docs/ModelFile.md create mode 100644 samples/client/petstore/java/resteasy/docs/ModelList.md create mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/resttemplate/docs/ModelFile.md create mode 100644 samples/client/petstore/java/resttemplate/docs/ModelList.md create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2-play26/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2rx2/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md create mode 100644 samples/client/petstore/java/retrofit2rx3/docs/ModelList.md create mode 100644 samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md create mode 100644 samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/vertx/docs/ModelFile.md create mode 100644 samples/client/petstore/java/vertx/docs/ModelList.md create mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/client/petstore/java/webclient/docs/ModelFile.md create mode 100644 samples/client/petstore/java/webclient/docs/ModelList.md create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java create mode 100644 samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java create mode 100644 samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java create mode 100644 samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java diff --git a/bin/configs/java-okhttp-gson-nextgen.yaml b/bin/configs/java-okhttp-gson-nextgen.yaml index b6b12f86bd..724edc9d90 100644 --- a/bin/configs/java-okhttp-gson-nextgen.yaml +++ b/bin/configs/java-okhttp-gson-nextgen.yaml @@ -1,8 +1,7 @@ generatorName: java outputDir: samples/client/petstore/java/okhttp-gson-nextgen library: okhttp-gson-nextgen -#inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: petstore-okhttp-gson-nextgen diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache index 56477b8dc1..32bef199e1 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/JSON.mustache @@ -50,19 +50,19 @@ import java.util.HashMap; * backward-compatibility */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); {{#joda}} - private DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static DateTimeTypeAdapter dateTimeTypeAdapter = new DateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); {{/joda}} {{#jsr310}} - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); {{/jsr310}} - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { @@ -116,7 +116,7 @@ public class JSON { return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) @@ -146,7 +146,7 @@ public class JSON { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -155,11 +155,11 @@ public class JSON { * * @param gson Gson */ - public void setGson(Gson gson) { - this.gson = gson; + public static void setGson(Gson gson) { + JSON.gson = gson; } - public void setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; } @@ -169,7 +169,7 @@ public class JSON { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -182,7 +182,7 @@ public class JSON { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); @@ -206,7 +206,7 @@ public class JSON { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -235,7 +235,7 @@ public class JSON { /** * Gson TypeAdapter for Joda DateTime type */ - public class DateTimeTypeAdapter extends TypeAdapter { + public static class DateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -278,7 +278,7 @@ public class JSON { /** * Gson TypeAdapter for Joda LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -316,11 +316,11 @@ public class JSON { } } - public void setDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setDateTimeFormat(DateTimeFormatter dateFormat) { dateTimeTypeAdapter.setFormat(dateFormat); } - public void setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } @@ -329,7 +329,7 @@ public class JSON { /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ - public class OffsetDateTimeTypeAdapter extends TypeAdapter { + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -373,7 +373,7 @@ public class JSON { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -411,11 +411,11 @@ public class JSON { } } - public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } - public void setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } @@ -425,7 +425,7 @@ public class JSON { * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used * (more efficient than SimpleDateFormat). */ - public class SqlDateTypeAdapter extends TypeAdapter { + public static class SqlDateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -478,7 +478,7 @@ public class JSON { * Gson TypeAdapter for java.util.Date type * If the dateFormat is null, ISO8601Utils will be used. */ - public class DateTypeAdapter extends TypeAdapter { + public static class DateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -531,11 +531,11 @@ public class JSON { } } - public void setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); } - public void setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache index 2b41e44940..fae56fd292 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/anyof_model.mustache @@ -90,14 +90,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/discriminator}} {{/useOneOfDiscriminatorLookup}} - {{#anyOf}} // deserialize {{{.}}} try { - deserialized = adapter{{.}}.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + {{.}}.validateJsonObject(jsonObject); log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); {{classname}} ret = new {{classname}}(); - ret.setActualInstance(deserialized); + ret.setActualInstance(adapter{{.}}.fromJsonTree(jsonObject)); return ret; } catch (Exception e) { // deserialization failed, continue @@ -105,7 +105,8 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} - throw new IOException(String.format("Failed deserialization for {{classname}} as data doesn't match anyOf schmeas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObject.toString())); + + throw new IOException(String.format("Failed deserialization for {{classname}}: no class matched. JSON: %s", jsonObject.toString())); } }.nullSafe(); } @@ -188,4 +189,48 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/anyOf}} + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to {{classname}} + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate anyOf schemas one by one + int validCount = 0; + {{#anyOf}} + // validate the json string with {{{.}}} + try { + {{{.}}}.validateJsonObject(jsonObj); + return; // return earlier as at least one schema is valid with respect to the Json object + //validCount++; + } catch (Exception e) { + // continue to the next one + } + {{/anyOf}} + if (validCount == 0) { + throw new IOException(String.format("The JSON string is invalid for {{classname}} with anyOf schemas: {{#anyOf}}{{{.}}}{{^-last}}, {{/-last}}{{/anyOf}}. JSON: %s", jsonObj.toString())); + } + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache index a9300854de..ce88e9a78a 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/oneof_model.mustache @@ -91,11 +91,14 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/discriminator}} {{/useOneOfDiscriminatorLookup}} int match = 0; + TypeAdapter actualAdapter = elementAdapter; {{#oneOf}} // deserialize {{{.}}} try { - deserialized = adapter{{.}}.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + {{.}}.validateJsonObject(jsonObject); + actualAdapter = adapter{{.}}; match++; log.log(Level.FINER, "Input data matches schema '{{{.}}}'"); } catch (Exception e) { @@ -106,7 +109,7 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im {{/oneOf}} if (match == 1) { {{classname}} ret = new {{classname}}(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -193,4 +196,47 @@ public class {{classname}} extends AbstractOpenApiSchema{{#vendorExtensions.x-im } {{/oneOf}} + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to {{classname}} + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + {{#oneOf}} + // validate the json string with {{{.}}} + try { + {{{.}}}.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + {{/oneOf}} + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for {{classname}} with oneOf schemas: {{#oneOf}}{{{.}}}{{^-last}}, {{/-last}}{{/oneOf}}. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache index f7ad1e3a05..b30ce069f0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson-nextgen/pojo.mustache @@ -1,5 +1,6 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -14,6 +15,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import {{invokerPackage}}.JSON; + /** * {{description}}{{^description}}{{classname}}{{/description}}{{#isDeprecated}} * @deprecated{{/isDeprecated}} @@ -379,7 +382,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } }; {{/parcelableModel}} -{{^hasChildren}} + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -397,6 +400,95 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/requiredVars}} } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to {{classname}} + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if ({{classname}}.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in {{{classname}}} is not found in the empty JSON string", {{classname}}.openapiRequiredFields.toString())); + } + } + {{^hasChildren}} + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!{{classname}}.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `{{classname}}` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + {{#requiredVars}} + {{#-first}} + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : {{classname}}.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + {{/-first}} + {{/requiredVars}} + {{/hasChildren}} + {{^discriminator}} + {{#vars}} + {{#isArray}} + {{#items.isModel}} + JsonArray jsonArray{{name}} = jsonObj.getAsJsonArray("{{{baseName}}}"); + {{#isRequired}} + // validate the required field `{{{baseName}}}` (array) + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); + }; + {{/isRequired}} + {{^isRequired}} + // validate the optional field `{{{baseName}}}` (array) + if (jsonArray{{name}} != null) { + for (int i = 0; i < jsonArray{{name}}.size(); i++) { + {{{items.dataType}}}.validateJsonObject(jsonArray{{name}}.get(i).getAsJsonObject()); + }; + } + {{/isRequired}} + {{/items.isModel}} + {{/isArray}} + {{^isContainer}} + {{#isModel}} + {{#isRequired}} + // validate the required field `{{{baseName}}}` + {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); + {{/isRequired}} + {{^isRequired}} + // validate the optional field `{{{baseName}}}` + if (jsonObj.getAsJsonObject("{{{baseName}}}") != null) { + {{{dataType}}}.validateJsonObject(jsonObj.getAsJsonObject("{{{baseName}}}")); + } + {{/isRequired}} + {{/isModel}} + {{/isContainer}} + {{/vars}} + {{/discriminator}} + {{#hasChildren}} + {{#discriminator}} + + String discriminatorValue = jsonObj.get("{{{propertyBaseName}}}").getAsString(); + switch (discriminatorValue) { + {{#mappedModels}} + case "{{mappingName}}": + {{modelName}}.validateJsonObject(jsonObj); + break; + {{/mappedModels}} + default: + throw new IllegalArgumentException(String.format("The value of the `{{{propertyBaseName}}}` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + {{/discriminator}} + {{/hasChildren}} + } + +{{^hasChildren}} public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -417,31 +509,33 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens @Override public {{classname}} read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!{{classname}}.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `{{classname}}` properties"); - } - } - - {{#requiredVars}} - {{#-first}} - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : {{classname}}.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - {{/-first}} - {{/requiredVars}} - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } {{/hasChildren}} -} \ No newline at end of file + + /** + * Create an instance of {{classname}} given an JSON string + * + * @param jsonString JSON string + * @return An instance of {{classname}} + * @throws IOException if the JSON string is invalid with respect to {{classname}} + */ + public static {{{classname}}} fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, {{{classname}}}.class); + } + + /** + * Convert an instance of {{classname}} to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 8ba2950c2d..a1d9b8ce85 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -542,8 +542,8 @@ public class SpringCodegenTest { // Check that the api handles the array and the file final File multipartApi = files.get("MultipartApi.java"); assertFileContains(multipartApi.toPath(), - "List files", - "MultipartFile file"); + "List files", + "MultipartFile file"); } @Test diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml new file mode 100644 index 0000000000..2ea7d82e8c --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson-nextgen.yaml @@ -0,0 +1,2184 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generated exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Someting wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' +# /fake/body-with-file-schema: +# put: +# tags: +# - fake +# description: >- +# For this test, the body for this request much reference a schema named +# `File`. +# operationId: testBodyWithFileSchema +# responses: +# '200': +# description: Success +# requestBody: +# content: +# application/json: +# schema: +# $ref: '#/components/schemas/FileSchemaTestClass' +# required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/array-of-enums: + get: + tags: + - fake + summary: Array of Enums + operationId: getArrayOfEnums + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + examples: + simple-list: + summary: Simple list example + description: Should not get into code examples + value: + - username: foo + - username: bar + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + example: '2020-02-02T20:20:20.000222Z' + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + anyTypeProp: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + See https://github.com/OAI/OpenAPI-Specification/issues/1389 + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' + anyTypePropNullable: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + The 'nullable' attribute does not change the allowed values. + nullable: true + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + int64: + type: integer + format: int64 + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_integer_only: + type: integer + enum: + - 2 + - -2 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean +# FileSchemaTestClass: +# type: object +# properties: +# file: +# $ref: '#/components/schemas/File' +# files: +# type: array +# items: +# $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + '_special_model.name_': + type: string + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + additionalProperties: false + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + required: + - className + DanishPig: + type: object + properties: + className: + type: string + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + additionalProperties: false + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + additionalProperties: false + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + NullableShape: + description: The value may be a shape or the 'null' value. + The 'nullable' attribute was introduced in OAS schema >= 3.0 + and has been deprecated in OAS schema >= 3.1. + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + nullable: true + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + additionalProperties: false + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + #ChildCat: + # allOf: + # - $ref: '#/components/schemas/ParentPet' + # - type: object + # properties: + # name: + # type: string + # pet_type: + # x-enum-as-string: true + # type: string + # enum: + # - ChildCat + # default: ChildCat + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/OuterEnum' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + PetWithRequiredTags: + type: object + required: + - name + - photoUrls + - tags + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet diff --git a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml index 92b32a4767..3ae78d049c 100644 --- a/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature-okhttp-gson.yaml @@ -2143,3 +2143,42 @@ components: deprecated: true items: $ref: '#/components/schemas/Bar' + PetWithRequiredTags: + type: object + required: + - name + - photoUrls + - tags + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelFile.md b/samples/client/petstore/java-micronaut-client/docs/ModelFile.md new file mode 100644 index 0000000000..014716aba6 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/docs/ModelFile.md @@ -0,0 +1,17 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | `String` | Test capitalization | [optional property] + + + + + + diff --git a/samples/client/petstore/java-micronaut-client/docs/ModelList.md b/samples/client/petstore/java-micronaut-client/docs/ModelList.md new file mode 100644 index 0000000000..6468645316 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/docs/ModelList.md @@ -0,0 +1,16 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | `String` | | [optional property] + + + + + + diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java new file mode 100644 index 0000000000..7112952184 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelFile.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") +@Introspected +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceURI() { + return sourceURI; + } + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java new file mode 100644 index 0000000000..9aa652a72e --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/main/java/org/openapitools/model/ModelList.java @@ -0,0 +1,99 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package org.openapitools.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.*; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import io.micronaut.core.annotation.*; +import javax.annotation.Generated; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@Generated(value="org.openapitools.codegen.languages.JavaMicronautClientCodegen") +@Introspected +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String get123list() { + return _123list; + } + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy new file mode 100644 index 0000000000..437aa0a889 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelFileSpec.groovy @@ -0,0 +1,30 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for ModelFile + */ +@MicronautTest +public class ModelFileSpec extends Specification { + private final ModelFile model = new ModelFile() + + /** + * Model tests for ModelFile + */ + void 'ModelFile test'() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + void 'ModelFile property sourceURI test'() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy new file mode 100644 index 0000000000..90939aa976 --- /dev/null +++ b/samples/client/petstore/java-micronaut-client/src/test/groovy/org/openapitools/model/ModelListSpec.groovy @@ -0,0 +1,30 @@ +package org.openapitools.model + +import io.swagger.annotations.ApiModel +import io.swagger.annotations.ApiModelProperty +import io.micronaut.test.extensions.spock.annotation.MicronautTest +import spock.lang.Specification +import jakarta.inject.Inject + +/** + * Model tests for ModelList + */ +@MicronautTest +public class ModelListSpec extends Specification { + private final ModelList model = new ModelList() + + /** + * Model tests for ModelList + */ + void 'ModelList test'() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + void 'ModelList property _123list test'() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/docs/ModelFile.md b/samples/client/petstore/java/apache-httpclient/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/apache-httpclient/docs/ModelList.md b/samples/client/petstore/java/apache-httpclient/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/apache-httpclient/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..e441f435fb --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.concurrent.Immutable +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..ea6f663582 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.concurrent.Immutable +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..2617cb1bae --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..e2c3bb9a10 --- /dev/null +++ b/samples/client/petstore/java/feign-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..2617cb1bae --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelFile + */ +class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..e2c3bb9a10 --- /dev/null +++ b/samples/client/petstore/java/feign/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,48 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.jupiter.api.Test; + + +/** + * Model tests for ModelList + */ +class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/google-api-client/docs/ModelFile.md b/samples/client/petstore/java/google-api-client/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/google-api-client/docs/ModelList.md b/samples/client/petstore/java/google-api-client/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/jersey1/docs/ModelFile.md b/samples/client/petstore/java/jersey1/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/jersey1/docs/ModelList.md b/samples/client/petstore/java/jersey1/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..0de39ec2ab --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..19025e8ec4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelFile.md b/samples/client/petstore/java/jersey2-java8/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelList.md b/samples/client/petstore/java/jersey2-java8/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..0de39ec2ab --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..19025e8ec4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/native-async/docs/ModelFile.md b/samples/client/petstore/java/native-async/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/native-async/docs/ModelList.md b/samples/client/petstore/java/native-async/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/native-async/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..2a6605d18c --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..2db90d8dc1 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/native-async/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/native/docs/ModelFile.md b/samples/client/petstore/java/native/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/native/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/native/docs/ModelList.md b/samples/client/petstore/java/native/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/native/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..2a6605d18c --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..2db90d8dc1 --- /dev/null +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..111a748cef --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..2ba46fefd4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java similarity index 63% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java rename to samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java index 0ca3662120..132012d4c3 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -21,41 +21,31 @@ import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import org.junit.Assert; import org.junit.Ignore; import org.junit.Test; /** - * Model tests for FileSchemaTestClass + * Model tests for ModelFile */ -public class FileSchemaTestClassTest { - private final FileSchemaTestClass model = new FileSchemaTestClass(); +public class ModelFileTest { + private final ModelFile model = new ModelFile(); /** - * Model tests for FileSchemaTestClass + * Model tests for ModelFile */ @Test - public void testFileSchemaTestClass() { - // TODO: test FileSchemaTestClass + public void testModelFile() { + // TODO: test ModelFile } /** - * Test the property 'file' + * Test the property 'sourceURI' */ @Test - public void fileTest() { - // TODO: test file - } - - /** - * Test the property 'files' - */ - @Test - public void filesTest() { - // TODO: test files + public void sourceURITest() { + // TODO: test sourceURI } } diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES index 39148a7980..4b91a46442 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/FILES @@ -34,7 +34,6 @@ docs/EnumTest.md docs/EquilateralTriangle.md docs/FakeApi.md docs/FakeClassnameTags123Api.md -docs/FileSchemaTestClass.md docs/Foo.md docs/FormatTest.md docs/Fruit.md @@ -65,6 +64,7 @@ docs/OuterEnumIntegerDefaultValue.md docs/ParentPet.md docs/Pet.md docs/PetApi.md +docs/PetWithRequiredTags.md docs/Pig.md docs/Quadrilateral.md docs/QuadrilateralInterface.md @@ -147,7 +147,6 @@ src/main/java/org/openapitools/client/model/EnumArrays.java src/main/java/org/openapitools/client/model/EnumClass.java src/main/java/org/openapitools/client/model/EnumTest.java src/main/java/org/openapitools/client/model/EquilateralTriangle.java -src/main/java/org/openapitools/client/model/FileSchemaTestClass.java src/main/java/org/openapitools/client/model/Foo.java src/main/java/org/openapitools/client/model/FormatTest.java src/main/java/org/openapitools/client/model/Fruit.java @@ -177,6 +176,7 @@ src/main/java/org/openapitools/client/model/OuterEnumInteger.java src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java src/main/java/org/openapitools/client/model/ParentPet.java src/main/java/org/openapitools/client/model/Pet.java +src/main/java/org/openapitools/client/model/PetWithRequiredTags.java src/main/java/org/openapitools/client/model/Pig.java src/main/java/org/openapitools/client/model/Quadrilateral.java src/main/java/org/openapitools/client/model/QuadrilateralInterface.java diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/README.md b/samples/client/petstore/java/okhttp-gson-nextgen/README.md index 6110aea0fa..865b6ae5aa 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/README.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/README.md @@ -121,7 +121,6 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | *FakeApi* | [**getArrayOfEnums**](docs/FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums -*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | *FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -182,7 +181,6 @@ Class | Method | HTTP request | Description - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [EquilateralTriangle](docs/EquilateralTriangle.md) - - [FileSchemaTestClass](docs/FileSchemaTestClass.md) - [Foo](docs/Foo.md) - [FormatTest](docs/FormatTest.md) - [Fruit](docs/Fruit.md) @@ -212,6 +210,7 @@ Class | Method | HTTP request | Description - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) - [ParentPet](docs/ParentPet.md) - [Pet](docs/Pet.md) + - [PetWithRequiredTags](docs/PetWithRequiredTags.md) - [Pig](docs/Pig.md) - [Quadrilateral](docs/Quadrilateral.md) - [QuadrilateralInterface](docs/QuadrilateralInterface.md) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml index 8e64d05d5f..ecee30d7d0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml +++ b/samples/client/petstore/java/okhttp-gson-nextgen/api/openapi.yaml @@ -1107,24 +1107,6 @@ paths: - $another-fake? x-contentType: application/json x-accepts: application/json - /fake/body-with-file-schema: - put: - description: For this test, the body for this request much reference a schema - named `File`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - description: Success - tags: - - fake - x-contentType: application/json - x-accepts: application/json /fake/test-query-parameters: put: description: To test the collection format in query parameters @@ -1934,25 +1916,8 @@ components: additionalProperties: type: boolean type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object File: description: Must be named `File` for test. - example: - sourceURI: sourceURI properties: sourceURI: description: Test capitalization @@ -2279,6 +2244,45 @@ components: $ref: '#/components/schemas/Bar' type: array type: object + PetWithRequiredTags: + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + - tags + type: object + xml: + name: Pet inline_response_default: example: string: diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md index bee5368024..505117ba63 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/FakeApi.md @@ -10,7 +10,6 @@ Method | HTTP request | Description [**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | [**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | [**getArrayOfEnums**](FakeApi.md#getArrayOfEnums) | **GET** /fake/array-of-enums | Array of Enums -[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema | [**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | [**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model [**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 @@ -357,63 +356,6 @@ No authorization required |-------------|-------------|------------------| **200** | Got named array of enums | - | - -# **testBodyWithFileSchema** -> testBodyWithFileSchema(fileSchemaTestClass) - - - -For this test, the body for this request much reference a schema named `File`. - -### Example -```java -// Import classes: -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.Configuration; -import org.openapitools.client.models.*; -import org.openapitools.client.api.FakeApi; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = Configuration.getDefaultApiClient(); - defaultClient.setBasePath("http://petstore.swagger.io:80/v2"); - - FakeApi apiInstance = new FakeApi(defaultClient); - FileSchemaTestClass fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | - try { - apiInstance.testBodyWithFileSchema(fileSchemaTestClass); - } catch (ApiException e) { - - } - } -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Success | - | - # **testBodyWithQueryParams** > testBodyWithQueryParams(query, user) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md new file mode 100644 index 0000000000..16525294cc --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/docs/PetWithRequiredTags.md @@ -0,0 +1,28 @@ + + +# PetWithRequiredTags + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**name** | **String** | | +**photoUrls** | **List<String>** | | +**tags** | [**List<Tag>**](Tag.md) | | +**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] + + + +## Enum: StatusEnum + +Name | Value +---- | ----- +AVAILABLE | "available" +PENDING | "pending" +SOLD | "sold" + + + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java index 40146a3e6f..584a6e970c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/JSON.java @@ -47,13 +47,13 @@ import java.util.HashMap; * backward-compatibility */ public class JSON { - private Gson gson; - private boolean isLenientOnJson = false; - private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); - private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); - private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); - private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); - private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); @SuppressWarnings("unchecked") public static GsonBuilder createGson() { @@ -213,7 +213,7 @@ public class JSON { return clazz; } - public JSON() { + { gson = createGson() .registerTypeAdapter(Date.class, dateTypeAdapter) .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) @@ -244,7 +244,6 @@ public class JSON { .registerTypeAdapterFactory(new org.openapitools.client.model.EnumArrays.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.EnumTest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.EquilateralTriangle.CustomTypeAdapterFactory()) - .registerTypeAdapterFactory(new org.openapitools.client.model.FileSchemaTestClass.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Foo.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.FormatTest.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Fruit.CustomTypeAdapterFactory()) @@ -269,6 +268,7 @@ public class JSON { .registerTypeAdapterFactory(new org.openapitools.client.model.OuterComposite.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.ParentPet.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pet.CustomTypeAdapterFactory()) + .registerTypeAdapterFactory(new org.openapitools.client.model.PetWithRequiredTags.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Pig.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.Quadrilateral.CustomTypeAdapterFactory()) .registerTypeAdapterFactory(new org.openapitools.client.model.QuadrilateralInterface.CustomTypeAdapterFactory()) @@ -293,7 +293,7 @@ public class JSON { * * @return Gson */ - public Gson getGson() { + public static Gson getGson() { return gson; } @@ -302,11 +302,11 @@ public class JSON { * * @param gson Gson */ - public void setGson(Gson gson) { - this.gson = gson; + public static void setGson(Gson gson) { + JSON.gson = gson; } - public void setLenientOnJson(boolean lenientOnJson) { + public static void setLenientOnJson(boolean lenientOnJson) { isLenientOnJson = lenientOnJson; } @@ -316,7 +316,7 @@ public class JSON { * @param obj Object * @return String representation of the JSON */ - public String serialize(Object obj) { + public static String serialize(Object obj) { return gson.toJson(obj); } @@ -329,7 +329,7 @@ public class JSON { * @return The deserialized Java object */ @SuppressWarnings("unchecked") - public T deserialize(String body, Type returnType) { + public static T deserialize(String body, Type returnType) { try { if (isLenientOnJson) { JsonReader jsonReader = new JsonReader(new StringReader(body)); @@ -353,7 +353,7 @@ public class JSON { /** * Gson TypeAdapter for Byte Array type */ - public class ByteArrayAdapter extends TypeAdapter { + public static class ByteArrayAdapter extends TypeAdapter { @Override public void write(JsonWriter out, byte[] value) throws IOException { @@ -381,7 +381,7 @@ public class JSON { /** * Gson TypeAdapter for JSR310 OffsetDateTime type */ - public class OffsetDateTimeTypeAdapter extends TypeAdapter { + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -425,7 +425,7 @@ public class JSON { /** * Gson TypeAdapter for JSR310 LocalDate type */ - public class LocalDateTypeAdapter extends TypeAdapter { + public static class LocalDateTypeAdapter extends TypeAdapter { private DateTimeFormatter formatter; @@ -463,11 +463,11 @@ public class JSON { } } - public void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { offsetDateTimeTypeAdapter.setFormat(dateFormat); } - public void setLocalDateFormat(DateTimeFormatter dateFormat) { + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { localDateTypeAdapter.setFormat(dateFormat); } @@ -476,7 +476,7 @@ public class JSON { * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used * (more efficient than SimpleDateFormat). */ - public class SqlDateTypeAdapter extends TypeAdapter { + public static class SqlDateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -529,7 +529,7 @@ public class JSON { * Gson TypeAdapter for java.util.Date type * If the dateFormat is null, ISO8601Utils will be used. */ - public class DateTypeAdapter extends TypeAdapter { + public static class DateTypeAdapter extends TypeAdapter { private DateFormat dateFormat; @@ -582,11 +582,11 @@ public class JSON { } } - public void setDateFormat(DateFormat dateFormat) { + public static void setDateFormat(DateFormat dateFormat) { dateTypeAdapter.setFormat(dateFormat); } - public void setSqlDateFormat(DateFormat dateFormat) { + public static void setSqlDateFormat(DateFormat dateFormat) { sqlDateTypeAdapter.setFormat(dateFormat); } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java index 271df76973..50c9b922e9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/api/FakeApi.java @@ -30,7 +30,6 @@ import java.io.IOException; import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; @@ -740,115 +739,6 @@ public class FakeApi { localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } - /** - * Build call for testBodyWithFileSchema - * @param fileSchemaTestClass (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
          Status Code Description Response Headers
          200 Success -
          - */ - public okhttp3.Call testBodyWithFileSchemaCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = fileSchemaTestClass; - - // create path and map variables - String localVarPath = "/fake/body-with-file-schema"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - if (localVarHeaderParams != null) { - localVarHeaderParams.put("Content-Type", localVarContentType); - } - - String[] localVarAuthNames = new String[] { }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call testBodyWithFileSchemaValidateBeforeCall(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'fileSchemaTestClass' is set - if (fileSchemaTestClass == null) { - throw new ApiException("Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema(Async)"); - } - - - okhttp3.Call localVarCall = testBodyWithFileSchemaCall(fileSchemaTestClass, _callback); - return localVarCall; - - } - - /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
          Status Code Description Response Headers
          200 Success -
          - */ - public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); - } - - /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
          Status Code Description Response Headers
          200 Success -
          - */ - public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * (asynchronously) - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
          Status Code Description Response Headers
          200 Success -
          - */ - public okhttp3.Call testBodyWithFileSchemaAsync(FileSchemaTestClass fileSchemaTestClass, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = testBodyWithFileSchemaValidateBeforeCall(fileSchemaTestClass, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } /** * Build call for testBodyWithQueryParams * @param query (required) diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 5c1d5c3fd6..d5f4dc14d8 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -30,6 +30,7 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -44,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * AdditionalPropertiesClass */ @@ -362,6 +365,7 @@ public class AdditionalPropertiesClass { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -381,6 +385,29 @@ public class AdditionalPropertiesClass { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AdditionalPropertiesClass is not found in the empty JSON string", AdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -401,19 +428,33 @@ public class AdditionalPropertiesClass { @Override public AdditionalPropertiesClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!AdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AdditionalPropertiesClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of AdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of AdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to AdditionalPropertiesClass + */ + public static AdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AdditionalPropertiesClass.class); + } + + /** + * Convert an instance of AdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java index 4d60101ca1..de69f3d6d7 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Animal.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.Dog; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Animal */ @@ -144,4 +147,68 @@ public class Animal { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("className"); + openapiFields.add("color"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("className"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Animal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Animal.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Animal is not found in the empty JSON string", Animal.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("className").getAsString(); + switch (discriminatorValue) { + case "Cat": + Cat.validateJsonObject(jsonObj); + break; + case "Dog": + Dog.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `className` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of Animal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Animal + * @throws IOException if the JSON string is invalid with respect to Animal + */ + public static Animal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Animal.class); + } + + /** + * Convert an instance of Animal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java index 03e3cc0f9c..650f2483d0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Apple.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Apple */ @@ -141,6 +144,7 @@ public class Apple { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -154,6 +158,29 @@ public class Apple { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Apple + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Apple.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Apple is not found in the empty JSON string", Apple.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Apple.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Apple` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -174,19 +201,33 @@ public class Apple { @Override public Apple read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Apple.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Apple` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Apple given an JSON string + * + * @param jsonString JSON string + * @return An instance of Apple + * @throws IOException if the JSON string is invalid with respect to Apple + */ + public static Apple fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Apple.class); + } + + /** + * Convert an instance of Apple to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java index dbf8227953..9270ce0a18 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/AppleReq.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * AppleReq */ @@ -141,6 +144,7 @@ public class AppleReq { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -155,6 +159,36 @@ public class AppleReq { openapiRequiredFields.add("cultivar"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to AppleReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (AppleReq.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in AppleReq is not found in the empty JSON string", AppleReq.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!AppleReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `AppleReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AppleReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -175,26 +209,33 @@ public class AppleReq { @Override public AppleReq read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!AppleReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `AppleReq` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : AppleReq.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of AppleReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of AppleReq + * @throws IOException if the JSON string is invalid with respect to AppleReq + */ + public static AppleReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AppleReq.class); + } + + /** + * Convert an instance of AppleReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 2dc3a69540..d375bd8a48 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -29,6 +29,7 @@ import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ArrayOfArrayOfNumberOnly */ @@ -123,6 +126,7 @@ public class ArrayOfArrayOfNumberOnly { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -135,6 +139,29 @@ public class ArrayOfArrayOfNumberOnly { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfArrayOfNumberOnly is not found in the empty JSON string", ArrayOfArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -155,19 +182,33 @@ public class ArrayOfArrayOfNumberOnly { @Override public ArrayOfArrayOfNumberOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ArrayOfArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfArrayOfNumberOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ArrayOfArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfArrayOfNumberOnly + */ + public static ArrayOfArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 384759be85..9ec157ed15 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -29,6 +29,7 @@ import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ArrayOfNumberOnly */ @@ -123,6 +126,7 @@ public class ArrayOfNumberOnly { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -135,6 +139,29 @@ public class ArrayOfNumberOnly { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayOfNumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayOfNumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayOfNumberOnly is not found in the empty JSON string", ArrayOfNumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayOfNumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -155,19 +182,33 @@ public class ArrayOfNumberOnly { @Override public ArrayOfNumberOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ArrayOfNumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayOfNumberOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ArrayOfNumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayOfNumberOnly + * @throws IOException if the JSON string is invalid with respect to ArrayOfNumberOnly + */ + public static ArrayOfNumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayOfNumberOnly.class); + } + + /** + * Convert an instance of ArrayOfNumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java index 23c8d4fbd1..66d23d236a 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -29,6 +29,7 @@ import org.openapitools.client.model.ReadOnlyFirst; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ArrayTest */ @@ -197,6 +200,7 @@ public class ArrayTest { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -211,6 +215,29 @@ public class ArrayTest { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ArrayTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ArrayTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ArrayTest is not found in the empty JSON string", ArrayTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ArrayTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ArrayTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -231,19 +258,33 @@ public class ArrayTest { @Override public ArrayTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ArrayTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ArrayTest` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ArrayTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ArrayTest + * @throws IOException if the JSON string is invalid with respect to ArrayTest + */ + public static ArrayTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ArrayTest.class); + } + + /** + * Convert an instance of ArrayTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java index e409ac6907..7ce5f0328c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Banana.java @@ -27,6 +27,7 @@ import java.math.BigDecimal; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Banana */ @@ -113,6 +116,7 @@ public class Banana { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ public class Banana { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Banana + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Banana.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Banana is not found in the empty JSON string", Banana.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Banana.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Banana` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public class Banana { @Override public Banana read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Banana.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Banana` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Banana given an JSON string + * + * @param jsonString JSON string + * @return An instance of Banana + * @throws IOException if the JSON string is invalid with respect to Banana + */ + public static Banana fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Banana.class); + } + + /** + * Convert an instance of Banana to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java index 7955096b5d..9691c1427a 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BananaReq.java @@ -27,6 +27,7 @@ import java.math.BigDecimal; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * BananaReq */ @@ -142,6 +145,7 @@ public class BananaReq { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -156,6 +160,36 @@ public class BananaReq { openapiRequiredFields.add("lengthCm"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BananaReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BananaReq.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BananaReq is not found in the empty JSON string", BananaReq.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BananaReq.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BananaReq` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BananaReq.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -176,26 +210,33 @@ public class BananaReq { @Override public BananaReq read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!BananaReq.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BananaReq` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BananaReq.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of BananaReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of BananaReq + * @throws IOException if the JSON string is invalid with respect to BananaReq + */ + public static BananaReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BananaReq.class); + } + + /** + * Convert an instance of BananaReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java index 93fc4cad0b..158472221c 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/BasquePig.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * BasquePig */ @@ -112,6 +115,7 @@ public class BasquePig { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ public class BasquePig { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to BasquePig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (BasquePig.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in BasquePig is not found in the empty JSON string", BasquePig.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!BasquePig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `BasquePig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BasquePig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public class BasquePig { @Override public BasquePig read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!BasquePig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `BasquePig` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : BasquePig.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of BasquePig given an JSON string + * + * @param jsonString JSON string + * @return An instance of BasquePig + * @throws IOException if the JSON string is invalid with respect to BasquePig + */ + public static BasquePig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BasquePig.class); + } + + /** + * Convert an instance of BasquePig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java index eceb83bbfe..ce4095ed0e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Capitalization.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Capitalization */ @@ -257,6 +260,7 @@ public class Capitalization { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -274,6 +278,29 @@ public class Capitalization { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Capitalization + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Capitalization.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Capitalization is not found in the empty JSON string", Capitalization.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Capitalization.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Capitalization` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -294,19 +321,33 @@ public class Capitalization { @Override public Capitalization read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Capitalization.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Capitalization` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Capitalization given an JSON string + * + * @param jsonString JSON string + * @return An instance of Capitalization + * @throws IOException if the JSON string is invalid with respect to Capitalization + */ + public static Capitalization fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Capitalization.class); + } + + /** + * Convert an instance of Capitalization to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java index 426511dc3c..a81d5016bf 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Cat.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.CatAllOf; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Cat */ @@ -117,6 +120,7 @@ public class Cat extends Animal { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -132,6 +136,36 @@ public class Cat extends Animal { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Cat + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Cat.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Cat is not found in the empty JSON string", Cat.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Cat.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Cat` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Cat.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -152,26 +186,33 @@ public class Cat extends Animal { @Override public Cat read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Cat.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Cat` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Cat.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Cat given an JSON string + * + * @param jsonString JSON string + * @return An instance of Cat + * @throws IOException if the JSON string is invalid with respect to Cat + */ + public static Cat fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Cat.class); + } + + /** + * Convert an instance of Cat to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java index 8d9affba3d..6a2c50e1c0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * CatAllOf */ @@ -112,6 +115,7 @@ public class CatAllOf { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ public class CatAllOf { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to CatAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (CatAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in CatAllOf is not found in the empty JSON string", CatAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!CatAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `CatAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public class CatAllOf { @Override public CatAllOf read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!CatAllOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `CatAllOf` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of CatAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of CatAllOf + * @throws IOException if the JSON string is invalid with respect to CatAllOf + */ + public static CatAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CatAllOf.class); + } + + /** + * Convert an instance of CatAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java index 85eb92c71b..d23447f518 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Category.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Category */ @@ -141,6 +144,7 @@ public class Category { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -155,6 +159,36 @@ public class Category { openapiRequiredFields.add("name"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Category + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Category.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Category is not found in the empty JSON string", Category.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Category.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Category` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Category.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -175,26 +209,33 @@ public class Category { @Override public Category read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Category.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Category` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Category.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Category given an JSON string + * + * @param jsonString JSON string + * @return An instance of Category + * @throws IOException if the JSON string is invalid with respect to Category + */ + public static Category fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Category.class); + } + + /** + * Convert an instance of Category to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java index da8517ec7b..8fb1b2f83d 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ClassModel.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing model with \"_class\" property */ @@ -113,6 +116,7 @@ public class ClassModel { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ public class ClassModel { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ClassModel + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ClassModel.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ClassModel is not found in the empty JSON string", ClassModel.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ClassModel.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ClassModel` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public class ClassModel { @Override public ClassModel read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ClassModel.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ClassModel` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ClassModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClassModel + * @throws IOException if the JSON string is invalid with respect to ClassModel + */ + public static ClassModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClassModel.class); + } + + /** + * Convert an instance of ClassModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java index 2a7cf96170..a52cc0be31 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Client.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Client */ @@ -112,6 +115,7 @@ public class Client { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ public class Client { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Client + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Client.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Client is not found in the empty JSON string", Client.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Client.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Client` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public class Client { @Override public Client read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Client.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Client` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Client given an JSON string + * + * @param jsonString JSON string + * @return An instance of Client + * @throws IOException if the JSON string is invalid with respect to Client + */ + public static Client fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Client.class); + } + + /** + * Convert an instance of Client to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 197a8ca0a2..c604f41f8b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.ShapeInterface; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ComplexQuadrilateral */ @@ -143,6 +146,7 @@ public class ComplexQuadrilateral { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ public class ComplexQuadrilateral { openapiRequiredFields.add("quadrilateralType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ComplexQuadrilateral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ComplexQuadrilateral.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ComplexQuadrilateral is not found in the empty JSON string", ComplexQuadrilateral.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ComplexQuadrilateral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ComplexQuadrilateral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ComplexQuadrilateral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public class ComplexQuadrilateral { @Override public ComplexQuadrilateral read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ComplexQuadrilateral.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ComplexQuadrilateral` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ComplexQuadrilateral.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ComplexQuadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of ComplexQuadrilateral + * @throws IOException if the JSON string is invalid with respect to ComplexQuadrilateral + */ + public static ComplexQuadrilateral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ComplexQuadrilateral.class); + } + + /** + * Convert an instance of ComplexQuadrilateral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java index c9bdd6fb47..6083d1cc01 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DanishPig.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * DanishPig */ @@ -112,6 +115,7 @@ public class DanishPig { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ public class DanishPig { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DanishPig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DanishPig.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DanishPig is not found in the empty JSON string", DanishPig.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DanishPig.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DanishPig` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DanishPig.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public class DanishPig { @Override public DanishPig read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!DanishPig.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DanishPig` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : DanishPig.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of DanishPig given an JSON string + * + * @param jsonString JSON string + * @return An instance of DanishPig + * @throws IOException if the JSON string is invalid with respect to DanishPig + */ + public static DanishPig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DanishPig.class); + } + + /** + * Convert an instance of DanishPig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 1ebdc75845..9bab6c77d6 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * DeprecatedObject * @deprecated @@ -114,6 +117,7 @@ public class DeprecatedObject { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -126,6 +130,29 @@ public class DeprecatedObject { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DeprecatedObject + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DeprecatedObject.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DeprecatedObject is not found in the empty JSON string", DeprecatedObject.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DeprecatedObject.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DeprecatedObject` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -146,19 +173,33 @@ public class DeprecatedObject { @Override public DeprecatedObject read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!DeprecatedObject.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DeprecatedObject` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of DeprecatedObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeprecatedObject + * @throws IOException if the JSON string is invalid with respect to DeprecatedObject + */ + public static DeprecatedObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeprecatedObject.class); + } + + /** + * Convert an instance of DeprecatedObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java index 407d20c326..24062284ab 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Dog.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.DogAllOf; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Dog */ @@ -117,6 +120,7 @@ public class Dog extends Animal { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -132,6 +136,36 @@ public class Dog extends Animal { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Dog + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Dog.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Dog is not found in the empty JSON string", Dog.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Dog.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Dog` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Dog.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -152,26 +186,33 @@ public class Dog extends Animal { @Override public Dog read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Dog.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Dog` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Dog.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Dog given an JSON string + * + * @param jsonString JSON string + * @return An instance of Dog + * @throws IOException if the JSON string is invalid with respect to Dog + */ + public static Dog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Dog.class); + } + + /** + * Convert an instance of Dog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java index 4305b501e0..6053b9169b 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * DogAllOf */ @@ -112,6 +115,7 @@ public class DogAllOf { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ public class DogAllOf { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to DogAllOf + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (DogAllOf.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in DogAllOf is not found in the empty JSON string", DogAllOf.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!DogAllOf.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `DogAllOf` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public class DogAllOf { @Override public DogAllOf read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!DogAllOf.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `DogAllOf` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of DogAllOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of DogAllOf + * @throws IOException if the JSON string is invalid with respect to DogAllOf + */ + public static DogAllOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DogAllOf.class); + } + + /** + * Convert an instance of DogAllOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java index b880f4c49d..793d088bad 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Drawing.java @@ -35,6 +35,7 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -49,6 +50,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Drawing */ @@ -229,6 +232,7 @@ public class Drawing extends HashMap { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -244,6 +248,48 @@ public class Drawing extends HashMap { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Drawing + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Drawing.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Drawing is not found in the empty JSON string", Drawing.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Drawing.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Drawing` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `mainShape` + if (jsonObj.getAsJsonObject("mainShape") != null) { + Shape.validateJsonObject(jsonObj.getAsJsonObject("mainShape")); + } + // validate the optional field `shapeOrNull` + if (jsonObj.getAsJsonObject("shapeOrNull") != null) { + ShapeOrNull.validateJsonObject(jsonObj.getAsJsonObject("shapeOrNull")); + } + // validate the optional field `nullableShape` + if (jsonObj.getAsJsonObject("nullableShape") != null) { + NullableShape.validateJsonObject(jsonObj.getAsJsonObject("nullableShape")); + } + JsonArray jsonArrayshapes = jsonObj.getAsJsonArray("shapes"); + // validate the optional field `shapes` (array) + if (jsonArrayshapes != null) { + for (int i = 0; i < jsonArrayshapes.size(); i++) { + Shape.validateJsonObject(jsonArrayshapes.get(i).getAsJsonObject()); + }; + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -264,19 +310,33 @@ public class Drawing extends HashMap { @Override public Drawing read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Drawing.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Drawing` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Drawing given an JSON string + * + * @param jsonString JSON string + * @return An instance of Drawing + * @throws IOException if the JSON string is invalid with respect to Drawing + */ + public static Drawing fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Drawing.class); + } + + /** + * Convert an instance of Drawing to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java index 87675e4eef..6b64ece266 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -28,6 +28,7 @@ import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * EnumArrays */ @@ -245,6 +248,7 @@ public class EnumArrays { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -258,6 +262,29 @@ public class EnumArrays { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumArrays + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumArrays.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumArrays is not found in the empty JSON string", EnumArrays.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumArrays.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumArrays` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -278,19 +305,33 @@ public class EnumArrays { @Override public EnumArrays read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!EnumArrays.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EnumArrays` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of EnumArrays given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumArrays + * @throws IOException if the JSON string is invalid with respect to EnumArrays + */ + public static EnumArrays fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumArrays.class); + } + + /** + * Convert an instance of EnumArrays to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java index 8bb57d811f..b25fad6648 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EnumTest.java @@ -31,6 +31,7 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -45,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * EnumTest */ @@ -599,6 +602,7 @@ public class EnumTest { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -620,6 +624,36 @@ public class EnumTest { openapiRequiredFields.add("enum_string_required"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EnumTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EnumTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EnumTest is not found in the empty JSON string", EnumTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EnumTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EnumTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EnumTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -640,26 +674,33 @@ public class EnumTest { @Override public EnumTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!EnumTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EnumTest` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EnumTest.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of EnumTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EnumTest + * @throws IOException if the JSON string is invalid with respect to EnumTest + */ + public static EnumTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EnumTest.class); + } + + /** + * Convert an instance of EnumTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index d0d2a26dab..a2cf60f6b1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.TriangleInterface; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * EquilateralTriangle */ @@ -143,6 +146,7 @@ public class EquilateralTriangle { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ public class EquilateralTriangle { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to EquilateralTriangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (EquilateralTriangle.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in EquilateralTriangle is not found in the empty JSON string", EquilateralTriangle.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!EquilateralTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `EquilateralTriangle` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EquilateralTriangle.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public class EquilateralTriangle { @Override public EquilateralTriangle read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!EquilateralTriangle.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `EquilateralTriangle` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : EquilateralTriangle.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of EquilateralTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of EquilateralTriangle + * @throws IOException if the JSON string is invalid with respect to EquilateralTriangle + */ + public static EquilateralTriangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EquilateralTriangle.class); + } + + /** + * Convert an instance of EquilateralTriangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java index 61d7be45d6..574dbb3459 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Foo.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Foo */ @@ -112,6 +115,7 @@ public class Foo { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -124,6 +128,29 @@ public class Foo { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Foo + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Foo.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Foo is not found in the empty JSON string", Foo.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Foo.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Foo` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -144,19 +171,33 @@ public class Foo { @Override public Foo read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Foo.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Foo` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Foo given an JSON string + * + * @param jsonString JSON string + * @return An instance of Foo + * @throws IOException if the JSON string is invalid with respect to Foo + */ + public static Foo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Foo.class); + } + + /** + * Convert an instance of Foo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java index a5b0cbf197..48923c9908 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FormatTest.java @@ -31,6 +31,7 @@ import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -45,6 +46,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * FormatTest */ @@ -562,6 +565,7 @@ public class FormatTest { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -593,6 +597,36 @@ public class FormatTest { openapiRequiredFields.add("password"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FormatTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (FormatTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in FormatTest is not found in the empty JSON string", FormatTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!FormatTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `FormatTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : FormatTest.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -613,26 +647,33 @@ public class FormatTest { @Override public FormatTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!FormatTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `FormatTest` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : FormatTest.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of FormatTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FormatTest + * @throws IOException if the JSON string is invalid with respect to FormatTest + */ + public static FormatTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FormatTest.class); + } + + /** + * Convert an instance of FormatTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java index 7ed501ad6d..b23b5c19d2 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Fruit.java @@ -106,10 +106,13 @@ public class Fruit extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Apple try { - deserialized = adapterApple.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Apple.validateJsonObject(jsonObject); + actualAdapter = adapterApple; match++; log.log(Level.FINER, "Input data matches schema 'Apple'"); } catch (Exception e) { @@ -119,7 +122,9 @@ public class Fruit extends AbstractOpenApiSchema { // deserialize Banana try { - deserialized = adapterBanana.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Banana.validateJsonObject(jsonObject); + actualAdapter = adapterBanana; match++; log.log(Level.FINER, "Input data matches schema 'Banana'"); } catch (Exception e) { @@ -129,7 +134,7 @@ public class Fruit extends AbstractOpenApiSchema { if (match == 1) { Fruit ret = new Fruit(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -224,5 +229,53 @@ public class Fruit extends AbstractOpenApiSchema { return (Banana)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Fruit + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Apple + try { + Apple.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Banana + try { + Banana.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Fruit with oneOf schemas: Apple, Banana. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Fruit given an JSON string + * + * @param jsonString JSON string + * @return An instance of Fruit + * @throws IOException if the JSON string is invalid with respect to Fruit + */ + public static Fruit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Fruit.class); + } + + /** + * Convert an instance of Fruit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java index 5c886b122b..abaf8b2fc6 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FruitReq.java @@ -106,10 +106,13 @@ public class FruitReq extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize AppleReq try { - deserialized = adapterAppleReq.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + AppleReq.validateJsonObject(jsonObject); + actualAdapter = adapterAppleReq; match++; log.log(Level.FINER, "Input data matches schema 'AppleReq'"); } catch (Exception e) { @@ -119,7 +122,9 @@ public class FruitReq extends AbstractOpenApiSchema { // deserialize BananaReq try { - deserialized = adapterBananaReq.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + BananaReq.validateJsonObject(jsonObject); + actualAdapter = adapterBananaReq; match++; log.log(Level.FINER, "Input data matches schema 'BananaReq'"); } catch (Exception e) { @@ -129,7 +134,7 @@ public class FruitReq extends AbstractOpenApiSchema { if (match == 1) { FruitReq ret = new FruitReq(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -229,5 +234,53 @@ public class FruitReq extends AbstractOpenApiSchema { return (BananaReq)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to FruitReq + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with AppleReq + try { + AppleReq.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with BananaReq + try { + BananaReq.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for FruitReq with oneOf schemas: AppleReq, BananaReq. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of FruitReq given an JSON string + * + * @param jsonString JSON string + * @return An instance of FruitReq + * @throws IOException if the JSON string is invalid with respect to FruitReq + */ + public static FruitReq fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FruitReq.class); + } + + /** + * Convert an instance of FruitReq to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java index 36a4bd8b24..eec085e78e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GmFruit.java @@ -105,13 +105,13 @@ public class GmFruit extends AbstractOpenApiSchema { Object deserialized = null; JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); - // deserialize Apple try { - deserialized = adapterApple.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Apple.validateJsonObject(jsonObject); log.log(Level.FINER, "Input data matches schema 'Apple'"); GmFruit ret = new GmFruit(); - ret.setActualInstance(deserialized); + ret.setActualInstance(adapterApple.fromJsonTree(jsonObject)); return ret; } catch (Exception e) { // deserialization failed, continue @@ -120,17 +120,19 @@ public class GmFruit extends AbstractOpenApiSchema { // deserialize Banana try { - deserialized = adapterBanana.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Banana.validateJsonObject(jsonObject); log.log(Level.FINER, "Input data matches schema 'Banana'"); GmFruit ret = new GmFruit(); - ret.setActualInstance(deserialized); + ret.setActualInstance(adapterBanana.fromJsonTree(jsonObject)); return ret; } catch (Exception e) { // deserialization failed, continue log.log(Level.FINER, "Input data does not match schema 'Banana'", e); } - throw new IOException(String.format("Failed deserialization for GmFruit as data doesn't match anyOf schmeas: Apple, Banana. JSON: %s", jsonObject.toString())); + + throw new IOException(String.format("Failed deserialization for GmFruit: no class matched. JSON: %s", jsonObject.toString())); } }.nullSafe(); } @@ -221,5 +223,55 @@ public class GmFruit extends AbstractOpenApiSchema { return (Banana)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GmFruit + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate anyOf schemas one by one + int validCount = 0; + // validate the json string with Apple + try { + Apple.validateJsonObject(jsonObj); + return; // return earlier as at least one schema is valid with respect to the Json object + //validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Banana + try { + Banana.validateJsonObject(jsonObj); + return; // return earlier as at least one schema is valid with respect to the Json object + //validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount == 0) { + throw new IOException(String.format("The JSON string is invalid for GmFruit with anyOf schemas: Apple, Banana. JSON: %s", jsonObj.toString())); + } + } + + /** + * Create an instance of GmFruit given an JSON string + * + * @param jsonString JSON string + * @return An instance of GmFruit + * @throws IOException if the JSON string is invalid with respect to GmFruit + */ + public static GmFruit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GmFruit.class); + } + + /** + * Convert an instance of GmFruit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 085ccbfbfc..a5f1f9ff34 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -27,6 +27,7 @@ import org.openapitools.client.model.ParentPet; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * GrandparentAnimal */ @@ -114,4 +117,64 @@ public class GrandparentAnimal { return o.toString().replace("\n", "\n "); } + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("pet_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("pet_type"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to GrandparentAnimal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (GrandparentAnimal.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in GrandparentAnimal is not found in the empty JSON string", GrandparentAnimal.openapiRequiredFields.toString())); + } + } + + String discriminatorValue = jsonObj.get("pet_type").getAsString(); + switch (discriminatorValue) { + case "ParentPet": + ParentPet.validateJsonObject(jsonObj); + break; + default: + throw new IllegalArgumentException(String.format("The value of the `pet_type` field `%s` does not match any key defined in the discriminator's mapping.", discriminatorValue)); + } + } + + + /** + * Create an instance of GrandparentAnimal given an JSON string + * + * @param jsonString JSON string + * @return An instance of GrandparentAnimal + * @throws IOException if the JSON string is invalid with respect to GrandparentAnimal + */ + public static GrandparentAnimal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GrandparentAnimal.class); + } + + /** + * Convert an instance of GrandparentAnimal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 31a4a05a3d..ff80990e36 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * HasOnlyReadOnly */ @@ -133,6 +136,7 @@ public class HasOnlyReadOnly { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -146,6 +150,29 @@ public class HasOnlyReadOnly { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HasOnlyReadOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HasOnlyReadOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HasOnlyReadOnly is not found in the empty JSON string", HasOnlyReadOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HasOnlyReadOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -166,19 +193,33 @@ public class HasOnlyReadOnly { @Override public HasOnlyReadOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!HasOnlyReadOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `HasOnlyReadOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of HasOnlyReadOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of HasOnlyReadOnly + * @throws IOException if the JSON string is invalid with respect to HasOnlyReadOnly + */ + public static HasOnlyReadOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HasOnlyReadOnly.class); + } + + /** + * Convert an instance of HasOnlyReadOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 8af6fca370..bc48571626 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -27,6 +27,7 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. */ @@ -125,6 +128,7 @@ public class HealthCheckResult { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -137,6 +141,29 @@ public class HealthCheckResult { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to HealthCheckResult + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (HealthCheckResult.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in HealthCheckResult is not found in the empty JSON string", HealthCheckResult.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!HealthCheckResult.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `HealthCheckResult` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -157,19 +184,33 @@ public class HealthCheckResult { @Override public HealthCheckResult read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!HealthCheckResult.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `HealthCheckResult` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of HealthCheckResult given an JSON string + * + * @param jsonString JSON string + * @return An instance of HealthCheckResult + * @throws IOException if the JSON string is invalid with respect to HealthCheckResult + */ + public static HealthCheckResult fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HealthCheckResult.class); + } + + /** + * Convert an instance of HealthCheckResult to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java index 925d6c646c..5f0873c2b1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/InlineResponseDefault.java @@ -27,6 +27,7 @@ import org.openapitools.client.model.Foo; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * InlineResponseDefault */ @@ -113,6 +116,7 @@ public class InlineResponseDefault { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,33 @@ public class InlineResponseDefault { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to InlineResponseDefault + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (InlineResponseDefault.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in InlineResponseDefault is not found in the empty JSON string", InlineResponseDefault.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!InlineResponseDefault.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `InlineResponseDefault` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `string` + if (jsonObj.getAsJsonObject("string") != null) { + Foo.validateJsonObject(jsonObj.getAsJsonObject("string")); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +176,33 @@ public class InlineResponseDefault { @Override public InlineResponseDefault read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!InlineResponseDefault.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `InlineResponseDefault` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of InlineResponseDefault given an JSON string + * + * @param jsonString JSON string + * @return An instance of InlineResponseDefault + * @throws IOException if the JSON string is invalid with respect to InlineResponseDefault + */ + public static InlineResponseDefault fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InlineResponseDefault.class); + } + + /** + * Convert an instance of InlineResponseDefault to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 2c2a445655..27a25ee3f6 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.TriangleInterface; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * IsoscelesTriangle */ @@ -143,6 +146,7 @@ public class IsoscelesTriangle { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ public class IsoscelesTriangle { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to IsoscelesTriangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (IsoscelesTriangle.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in IsoscelesTriangle is not found in the empty JSON string", IsoscelesTriangle.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!IsoscelesTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `IsoscelesTriangle` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IsoscelesTriangle.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public class IsoscelesTriangle { @Override public IsoscelesTriangle read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!IsoscelesTriangle.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `IsoscelesTriangle` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : IsoscelesTriangle.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of IsoscelesTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsoscelesTriangle + * @throws IOException if the JSON string is invalid with respect to IsoscelesTriangle + */ + public static IsoscelesTriangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsoscelesTriangle.class); + } + + /** + * Convert an instance of IsoscelesTriangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java index 21834a0903..7d10d2dfc1 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Mammal.java @@ -114,10 +114,13 @@ public class Mammal extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Pig try { - deserialized = adapterPig.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Pig.validateJsonObject(jsonObject); + actualAdapter = adapterPig; match++; log.log(Level.FINER, "Input data matches schema 'Pig'"); } catch (Exception e) { @@ -127,7 +130,9 @@ public class Mammal extends AbstractOpenApiSchema { // deserialize Whale try { - deserialized = adapterWhale.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Whale.validateJsonObject(jsonObject); + actualAdapter = adapterWhale; match++; log.log(Level.FINER, "Input data matches schema 'Whale'"); } catch (Exception e) { @@ -137,7 +142,9 @@ public class Mammal extends AbstractOpenApiSchema { // deserialize Zebra try { - deserialized = adapterZebra.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Zebra.validateJsonObject(jsonObject); + actualAdapter = adapterZebra; match++; log.log(Level.FINER, "Input data matches schema 'Zebra'"); } catch (Exception e) { @@ -147,7 +154,7 @@ public class Mammal extends AbstractOpenApiSchema { if (match == 1) { Mammal ret = new Mammal(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -265,5 +272,60 @@ public class Mammal extends AbstractOpenApiSchema { return (Zebra)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Mammal + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Pig + try { + Pig.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Whale + try { + Whale.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Zebra + try { + Zebra.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Mammal with oneOf schemas: Pig, Whale, Zebra. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Mammal given an JSON string + * + * @param jsonString JSON string + * @return An instance of Mammal + * @throws IOException if the JSON string is invalid with respect to Mammal + */ + public static Mammal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Mammal.class); + } + + /** + * Convert an instance of Mammal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java index 615d6de353..51fb198904 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MapTest.java @@ -29,6 +29,7 @@ import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -43,6 +44,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * MapTest */ @@ -281,6 +284,7 @@ public class MapTest { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -296,6 +300,29 @@ public class MapTest { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MapTest + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MapTest.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MapTest is not found in the empty JSON string", MapTest.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MapTest.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MapTest` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -316,19 +343,33 @@ public class MapTest { @Override public MapTest read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!MapTest.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `MapTest` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of MapTest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MapTest + * @throws IOException if the JSON string is invalid with respect to MapTest + */ + public static MapTest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MapTest.class); + } + + /** + * Convert an instance of MapTest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index ae6e2282c9..3bd9f59adb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -32,6 +32,7 @@ import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -46,6 +47,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * MixedPropertiesAndAdditionalPropertiesClass */ @@ -184,6 +187,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -198,6 +202,29 @@ public class MixedPropertiesAndAdditionalPropertiesClass { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in MixedPropertiesAndAdditionalPropertiesClass is not found in the empty JSON string", MixedPropertiesAndAdditionalPropertiesClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -218,19 +245,33 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @Override public MixedPropertiesAndAdditionalPropertiesClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!MixedPropertiesAndAdditionalPropertiesClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `MixedPropertiesAndAdditionalPropertiesClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of MixedPropertiesAndAdditionalPropertiesClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of MixedPropertiesAndAdditionalPropertiesClass + * @throws IOException if the JSON string is invalid with respect to MixedPropertiesAndAdditionalPropertiesClass + */ + public static MixedPropertiesAndAdditionalPropertiesClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MixedPropertiesAndAdditionalPropertiesClass.class); + } + + /** + * Convert an instance of MixedPropertiesAndAdditionalPropertiesClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java index b9ec6bd483..a6f1720f9e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Model200Response.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing model name starting with number */ @@ -142,6 +145,7 @@ public class Model200Response { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -155,6 +159,29 @@ public class Model200Response { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Model200Response + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Model200Response.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Model200Response is not found in the empty JSON string", Model200Response.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Model200Response.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Model200Response` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -175,19 +202,33 @@ public class Model200Response { @Override public Model200Response read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Model200Response.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Model200Response` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Model200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Model200Response + * @throws IOException if the JSON string is invalid with respect to Model200Response + */ + public static Model200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Model200Response.class); + } + + /** + * Convert an instance of Model200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java index c9f691d645..9d4ee4fbdf 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ModelApiResponse */ @@ -170,6 +173,7 @@ public class ModelApiResponse { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -184,6 +188,29 @@ public class ModelApiResponse { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelApiResponse + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelApiResponse.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelApiResponse is not found in the empty JSON string", ModelApiResponse.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelApiResponse` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -204,19 +231,33 @@ public class ModelApiResponse { @Override public ModelApiResponse read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ModelApiResponse.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ModelApiResponse` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ModelApiResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelApiResponse + * @throws IOException if the JSON string is invalid with respect to ModelApiResponse + */ + public static ModelApiResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelApiResponse.class); + } + + /** + * Convert an instance of ModelApiResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..4b09210842 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,204 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("sourceURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelFile + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelFile.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelFile is not found in the empty JSON string", ModelFile.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelFile.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelFile` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!ModelFile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelFile' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelFile.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, ModelFile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public ModelFile read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ModelFile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelFile + * @throws IOException if the JSON string is invalid with respect to ModelFile + */ + public static ModelFile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelFile.class); + } + + /** + * Convert an instance of ModelFile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java similarity index 50% rename from samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java rename to samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java index 9b7eb55c74..cffa7fb4f9 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelList.java @@ -23,11 +23,10 @@ import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,73 +41,40 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** - * FileSchemaTestClass + * ModelList */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -public class FileSchemaTestClass { - public static final String SERIALIZED_NAME_FILE = "file"; - @SerializedName(SERIALIZED_NAME_FILE) - private java.io.File file; +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; - public static final String SERIALIZED_NAME_FILES = "files"; - @SerializedName(SERIALIZED_NAME_FILES) - private List files = null; - - public FileSchemaTestClass() { + public ModelList() { } - public FileSchemaTestClass file(java.io.File file) { + public ModelList _123list(String _123list) { - this.file = file; + this._123list = _123list; return this; } /** - * Get file - * @return file + * Get _123list + * @return _123list **/ @javax.annotation.Nullable @ApiModelProperty(value = "") - public java.io.File getFile() { - return file; + public String get123list() { + return _123list; } - public void setFile(java.io.File file) { - this.file = file; - } - - - public FileSchemaTestClass files(List files) { - - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(java.io.File filesItem) { - if (this.files == null) { - this.files = new ArrayList(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getFiles() { - return files; - } - - - public void setFiles(List files) { - this.files = files; + public void set123list(String _123list) { + this._123list = _123list; } @@ -120,22 +86,20 @@ public class FileSchemaTestClass { if (o == null || getClass() != o.getClass()) { return false; } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); } @Override public int hashCode() { - return Objects.hash(file, files); + return Objects.hash(_123list); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); sb.append("}"); return sb.toString(); } @@ -151,52 +115,89 @@ public class FileSchemaTestClass { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; static { // a set of all properties/fields (JSON key names) openapiFields = new HashSet(); - openapiFields.add("file"); - openapiFields.add("files"); + openapiFields.add("123-list"); // a set of required properties/fields (JSON key names) openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelList + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelList.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelList is not found in the empty JSON string", ModelList.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelList.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelList` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override public TypeAdapter create(Gson gson, TypeToken type) { - if (!FileSchemaTestClass.class.isAssignableFrom(type.getRawType())) { - return null; // this class only serializes 'FileSchemaTestClass' and its subtypes + if (!ModelList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ModelList' and its subtypes } final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); - final TypeAdapter thisAdapter - = gson.getDelegateAdapter(this, TypeToken.get(FileSchemaTestClass.class)); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ModelList.class)); - return (TypeAdapter) new TypeAdapter() { + return (TypeAdapter) new TypeAdapter() { @Override - public void write(JsonWriter out, FileSchemaTestClass value) throws IOException { + public void write(JsonWriter out, ModelList value) throws IOException { JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); elementAdapter.write(out, obj); } @Override - public FileSchemaTestClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!FileSchemaTestClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `FileSchemaTestClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + public ModelList read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ModelList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelList + * @throws IOException if the JSON string is invalid with respect to ModelList + */ + public static ModelList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelList.class); + } + + /** + * Convert an instance of ModelList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java index 64aadfb6a8..09a6be5b71 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing reserved words */ @@ -113,6 +116,7 @@ public class ModelReturn { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ public class ModelReturn { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ModelReturn + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ModelReturn.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ModelReturn is not found in the empty JSON string", ModelReturn.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ModelReturn.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ModelReturn` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public class ModelReturn { @Override public ModelReturn read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ModelReturn.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ModelReturn` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ModelReturn given an JSON string + * + * @param jsonString JSON string + * @return An instance of ModelReturn + * @throws IOException if the JSON string is invalid with respect to ModelReturn + */ + public static ModelReturn fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ModelReturn.class); + } + + /** + * Convert an instance of ModelReturn to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java index 528c159a8f..a9f5ca0e15 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Name.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Model for testing model name same as property name */ @@ -192,6 +195,7 @@ public class Name { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -208,6 +212,36 @@ public class Name { openapiRequiredFields.add("name"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Name + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Name.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Name is not found in the empty JSON string", Name.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Name.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Name` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Name.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -228,26 +262,33 @@ public class Name { @Override public Name read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Name.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Name` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Name.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Name given an JSON string + * + * @param jsonString JSON string + * @return An instance of Name + * @throws IOException if the JSON string is invalid with respect to Name + */ + public static Name fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Name.class); + } + + /** + * Convert an instance of Name to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java index 5aa141fee0..cd29b3cb2e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableClass.java @@ -34,6 +34,7 @@ import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -48,6 +49,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * NullableClass */ @@ -500,6 +503,7 @@ public class NullableClass extends HashMap { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -523,6 +527,29 @@ public class NullableClass extends HashMap { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NullableClass + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NullableClass.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NullableClass is not found in the empty JSON string", NullableClass.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NullableClass.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NullableClass` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -543,19 +570,33 @@ public class NullableClass extends HashMap { @Override public NullableClass read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!NullableClass.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `NullableClass` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of NullableClass given an JSON string + * + * @param jsonString JSON string + * @return An instance of NullableClass + * @throws IOException if the JSON string is invalid with respect to NullableClass + */ + public static NullableClass fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NullableClass.class); + } + + /** + * Convert an instance of NullableClass to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java index f2946ec60e..c5bb74f006 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NullableShape.java @@ -105,10 +105,13 @@ public class NullableShape extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral try { - deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Quadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public class NullableShape extends AbstractOpenApiSchema { // deserialize Triangle try { - deserialized = adapterTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Triangle.validateJsonObject(jsonObject); + actualAdapter = adapterTriangle; match++; log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public class NullableShape extends AbstractOpenApiSchema { if (match == 1) { NullableShape ret = new NullableShape(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -228,5 +233,53 @@ public class NullableShape extends AbstractOpenApiSchema { return (Triangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NullableShape + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Quadrilateral + try { + Quadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Triangle + try { + Triangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for NullableShape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of NullableShape given an JSON string + * + * @param jsonString JSON string + * @return An instance of NullableShape + * @throws IOException if the JSON string is invalid with respect to NullableShape + */ + public static NullableShape fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NullableShape.class); + } + + /** + * Convert an instance of NullableShape to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java index 7dc78d63d0..180a6db89a 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -27,6 +27,7 @@ import java.math.BigDecimal; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * NumberOnly */ @@ -113,6 +116,7 @@ public class NumberOnly { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,29 @@ public class NumberOnly { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to NumberOnly + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (NumberOnly.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in NumberOnly is not found in the empty JSON string", NumberOnly.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!NumberOnly.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `NumberOnly` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,19 +172,33 @@ public class NumberOnly { @Override public NumberOnly read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!NumberOnly.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `NumberOnly` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of NumberOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of NumberOnly + * @throws IOException if the JSON string is invalid with respect to NumberOnly + */ + public static NumberOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, NumberOnly.class); + } + + /** + * Convert an instance of NumberOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 654a4415af..773a079fe4 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -30,6 +30,7 @@ import org.openapitools.client.model.DeprecatedObject; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -44,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ObjectWithDeprecatedFields */ @@ -217,6 +220,7 @@ public class ObjectWithDeprecatedFields { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -232,6 +236,33 @@ public class ObjectWithDeprecatedFields { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ObjectWithDeprecatedFields + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ObjectWithDeprecatedFields.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ObjectWithDeprecatedFields is not found in the empty JSON string", ObjectWithDeprecatedFields.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ObjectWithDeprecatedFields.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ObjectWithDeprecatedFields` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + // validate the optional field `deprecatedRef` + if (jsonObj.getAsJsonObject("deprecatedRef") != null) { + DeprecatedObject.validateJsonObject(jsonObj.getAsJsonObject("deprecatedRef")); + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -252,19 +283,33 @@ public class ObjectWithDeprecatedFields { @Override public ObjectWithDeprecatedFields read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ObjectWithDeprecatedFields.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ObjectWithDeprecatedFields` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ObjectWithDeprecatedFields given an JSON string + * + * @param jsonString JSON string + * @return An instance of ObjectWithDeprecatedFields + * @throws IOException if the JSON string is invalid with respect to ObjectWithDeprecatedFields + */ + public static ObjectWithDeprecatedFields fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ObjectWithDeprecatedFields.class); + } + + /** + * Convert an instance of ObjectWithDeprecatedFields to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java index 531e45320f..82d8a256c0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Order.java @@ -27,6 +27,7 @@ import org.threeten.bp.OffsetDateTime; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Order */ @@ -307,6 +310,7 @@ public class Order { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -324,6 +328,29 @@ public class Order { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Order + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Order.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Order is not found in the empty JSON string", Order.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Order.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Order` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -344,19 +371,33 @@ public class Order { @Override public Order read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Order.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Order` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Order given an JSON string + * + * @param jsonString JSON string + * @return An instance of Order + * @throws IOException if the JSON string is invalid with respect to Order + */ + public static Order fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Order.class); + } + + /** + * Convert an instance of Order to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java index c0f8c964ff..e86d5bc5ff 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -27,6 +27,7 @@ import java.math.BigDecimal; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * OuterComposite */ @@ -171,6 +174,7 @@ public class OuterComposite { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -185,6 +189,29 @@ public class OuterComposite { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to OuterComposite + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (OuterComposite.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in OuterComposite is not found in the empty JSON string", OuterComposite.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!OuterComposite.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `OuterComposite` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -205,19 +232,33 @@ public class OuterComposite { @Override public OuterComposite read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!OuterComposite.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `OuterComposite` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of OuterComposite given an JSON string + * + * @param jsonString JSON string + * @return An instance of OuterComposite + * @throws IOException if the JSON string is invalid with respect to OuterComposite + */ + public static OuterComposite fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OuterComposite.class); + } + + /** + * Convert an instance of OuterComposite to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java index f96071be43..392debad35 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ParentPet.java @@ -27,6 +27,7 @@ import org.openapitools.client.model.GrandparentAnimal; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ParentPet */ @@ -86,6 +89,7 @@ public class ParentPet extends GrandparentAnimal { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -99,6 +103,36 @@ public class ParentPet extends GrandparentAnimal { openapiRequiredFields.add("pet_type"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ParentPet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ParentPet.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ParentPet is not found in the empty JSON string", ParentPet.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ParentPet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ParentPet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ParentPet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -119,26 +153,33 @@ public class ParentPet extends GrandparentAnimal { @Override public ParentPet read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ParentPet.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ParentPet` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ParentPet.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ParentPet given an JSON string + * + * @param jsonString JSON string + * @return An instance of ParentPet + * @throws IOException if the JSON string is invalid with respect to ParentPet + */ + public static ParentPet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ParentPet.class); + } + + /** + * Convert an instance of ParentPet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java index 5d0065de40..5d2d5688cb 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pet.java @@ -30,6 +30,7 @@ import org.openapitools.client.model.Tag; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -44,6 +45,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Pet */ @@ -323,6 +326,7 @@ public class Pet { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -342,6 +346,47 @@ public class Pet { openapiRequiredFields.add("photoUrls"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pet + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Pet.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Pet is not found in the empty JSON string", Pet.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Pet.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Pet` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Pet.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `category` + if (jsonObj.getAsJsonObject("category") != null) { + Category.validateJsonObject(jsonObj.getAsJsonObject("category")); + } + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the optional field `tags` (array) + if (jsonArraytags != null) { + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); + }; + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -362,26 +407,33 @@ public class Pet { @Override public Pet read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Pet.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Pet` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Pet.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Pet given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pet + * @throws IOException if the JSON string is invalid with respect to Pet + */ + public static Pet fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pet.class); + } + + /** + * Convert an instance of Pet to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java new file mode 100644 index 0000000000..c7c647842d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/PetWithRequiredTags.java @@ -0,0 +1,437 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.HashSet; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import org.openapitools.client.JSON; + +/** + * PetWithRequiredTags + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class PetWithRequiredTags { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + private Long id; + + public static final String SERIALIZED_NAME_CATEGORY = "category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + private Category category; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + private String name; + + public static final String SERIALIZED_NAME_PHOTO_URLS = "photoUrls"; + @SerializedName(SERIALIZED_NAME_PHOTO_URLS) + private List photoUrls = new ArrayList(); + + public static final String SERIALIZED_NAME_TAGS = "tags"; + @SerializedName(SERIALIZED_NAME_TAGS) + private List tags = new ArrayList(); + + /** + * pet status in the store + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + AVAILABLE("available"), + + PENDING("pending"), + + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + } + + public static final String SERIALIZED_NAME_STATUS = "status"; + @SerializedName(SERIALIZED_NAME_STATUS) + private StatusEnum status; + + public PetWithRequiredTags() { + } + + public PetWithRequiredTags id(Long id) { + + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Long getId() { + return id; + } + + + public void setId(Long id) { + this.id = id; + } + + + public PetWithRequiredTags category(Category category) { + + this.category = category; + return this; + } + + /** + * Get category + * @return category + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public Category getCategory() { + return category; + } + + + public void setCategory(Category category) { + this.category = category; + } + + + public PetWithRequiredTags name(String name) { + + this.name = name; + return this; + } + + /** + * Get name + * @return name + **/ + @javax.annotation.Nonnull + @ApiModelProperty(example = "doggie", required = true, value = "") + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public PetWithRequiredTags photoUrls(List photoUrls) { + + this.photoUrls = photoUrls; + return this; + } + + public PetWithRequiredTags addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * @return photoUrls + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getPhotoUrls() { + return photoUrls; + } + + + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + + public PetWithRequiredTags tags(List tags) { + + this.tags = tags; + return this; + } + + public PetWithRequiredTags addTagsItem(Tag tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * @return tags + **/ + @javax.annotation.Nonnull + @ApiModelProperty(required = true, value = "") + + public List getTags() { + return tags; + } + + + public void setTags(List tags) { + this.tags = tags; + } + + + public PetWithRequiredTags status(StatusEnum status) { + + this.status = status; + return this; + } + + /** + * pet status in the store + * @return status + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "pet status in the store") + + public StatusEnum getStatus() { + return status; + } + + + public void setStatus(StatusEnum status) { + this.status = status; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PetWithRequiredTags petWithRequiredTags = (PetWithRequiredTags) o; + return Objects.equals(this.id, petWithRequiredTags.id) && + Objects.equals(this.category, petWithRequiredTags.category) && + Objects.equals(this.name, petWithRequiredTags.name) && + Objects.equals(this.photoUrls, petWithRequiredTags.photoUrls) && + Objects.equals(this.tags, petWithRequiredTags.tags) && + Objects.equals(this.status, petWithRequiredTags.status); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PetWithRequiredTags {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public static HashSet openapiFields; + public static HashSet openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet(); + openapiFields.add("id"); + openapiFields.add("category"); + openapiFields.add("name"); + openapiFields.add("photoUrls"); + openapiFields.add("tags"); + openapiFields.add("status"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet(); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("photoUrls"); + openapiRequiredFields.add("tags"); + } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to PetWithRequiredTags + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (PetWithRequiredTags.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in PetWithRequiredTags is not found in the empty JSON string", PetWithRequiredTags.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!PetWithRequiredTags.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `PetWithRequiredTags` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PetWithRequiredTags.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + // validate the optional field `category` + if (jsonObj.getAsJsonObject("category") != null) { + Category.validateJsonObject(jsonObj.getAsJsonObject("category")); + } + JsonArray jsonArraytags = jsonObj.getAsJsonArray("tags"); + // validate the optional field `tags` (array) + if (jsonArraytags != null) { + for (int i = 0; i < jsonArraytags.size(); i++) { + Tag.validateJsonObject(jsonArraytags.get(i).getAsJsonObject()); + }; + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public TypeAdapter create(Gson gson, TypeToken type) { + if (!PetWithRequiredTags.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PetWithRequiredTags' and its subtypes + } + final TypeAdapter elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PetWithRequiredTags.class)); + + return (TypeAdapter) new TypeAdapter() { + @Override + public void write(JsonWriter out, PetWithRequiredTags value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + elementAdapter.write(out, obj); + } + + @Override + public PetWithRequiredTags read(JsonReader in) throws IOException { + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PetWithRequiredTags given an JSON string + * + * @param jsonString JSON string + * @return An instance of PetWithRequiredTags + * @throws IOException if the JSON string is invalid with respect to PetWithRequiredTags + */ + public static PetWithRequiredTags fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PetWithRequiredTags.class); + } + + /** + * Convert an instance of PetWithRequiredTags to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java index 54982ba3f8..7523f9b916 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Pig.java @@ -105,10 +105,13 @@ public class Pig extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize BasquePig try { - deserialized = adapterBasquePig.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + BasquePig.validateJsonObject(jsonObject); + actualAdapter = adapterBasquePig; match++; log.log(Level.FINER, "Input data matches schema 'BasquePig'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public class Pig extends AbstractOpenApiSchema { // deserialize DanishPig try { - deserialized = adapterDanishPig.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + DanishPig.validateJsonObject(jsonObject); + actualAdapter = adapterDanishPig; match++; log.log(Level.FINER, "Input data matches schema 'DanishPig'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public class Pig extends AbstractOpenApiSchema { if (match == 1) { Pig ret = new Pig(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -223,5 +228,53 @@ public class Pig extends AbstractOpenApiSchema { return (DanishPig)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Pig + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with BasquePig + try { + BasquePig.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with DanishPig + try { + DanishPig.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Pig with oneOf schemas: BasquePig, DanishPig. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Pig given an JSON string + * + * @param jsonString JSON string + * @return An instance of Pig + * @throws IOException if the JSON string is invalid with respect to Pig + */ + public static Pig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Pig.class); + } + + /** + * Convert an instance of Pig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java index aad102d305..f6565d05cd 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -105,10 +105,13 @@ public class Quadrilateral extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize ComplexQuadrilateral try { - deserialized = adapterComplexQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + ComplexQuadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterComplexQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'ComplexQuadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public class Quadrilateral extends AbstractOpenApiSchema { // deserialize SimpleQuadrilateral try { - deserialized = adapterSimpleQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + SimpleQuadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterSimpleQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'SimpleQuadrilateral'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public class Quadrilateral extends AbstractOpenApiSchema { if (match == 1) { Quadrilateral ret = new Quadrilateral(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -223,5 +228,53 @@ public class Quadrilateral extends AbstractOpenApiSchema { return (SimpleQuadrilateral)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Quadrilateral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with ComplexQuadrilateral + try { + ComplexQuadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with SimpleQuadrilateral + try { + SimpleQuadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Quadrilateral with oneOf schemas: ComplexQuadrilateral, SimpleQuadrilateral. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Quadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of Quadrilateral + * @throws IOException if the JSON string is invalid with respect to Quadrilateral + */ + public static Quadrilateral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Quadrilateral.class); + } + + /** + * Convert an instance of Quadrilateral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index e6fc7e3d34..2c5e5ff914 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * QuadrilateralInterface */ @@ -112,6 +115,7 @@ public class QuadrilateralInterface { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ public class QuadrilateralInterface { openapiRequiredFields.add("quadrilateralType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to QuadrilateralInterface + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (QuadrilateralInterface.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in QuadrilateralInterface is not found in the empty JSON string", QuadrilateralInterface.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!QuadrilateralInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `QuadrilateralInterface` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QuadrilateralInterface.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public class QuadrilateralInterface { @Override public QuadrilateralInterface read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!QuadrilateralInterface.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `QuadrilateralInterface` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : QuadrilateralInterface.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of QuadrilateralInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of QuadrilateralInterface + * @throws IOException if the JSON string is invalid with respect to QuadrilateralInterface + */ + public static QuadrilateralInterface fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QuadrilateralInterface.class); + } + + /** + * Convert an instance of QuadrilateralInterface to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index d842df280f..14b28a6106 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ReadOnlyFirst */ @@ -140,6 +143,7 @@ public class ReadOnlyFirst { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -153,6 +157,29 @@ public class ReadOnlyFirst { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ReadOnlyFirst + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ReadOnlyFirst.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ReadOnlyFirst is not found in the empty JSON string", ReadOnlyFirst.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ReadOnlyFirst` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -173,19 +200,33 @@ public class ReadOnlyFirst { @Override public ReadOnlyFirst read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ReadOnlyFirst.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ReadOnlyFirst` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ReadOnlyFirst given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReadOnlyFirst + * @throws IOException if the JSON string is invalid with respect to ReadOnlyFirst + */ + public static ReadOnlyFirst fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReadOnlyFirst.class); + } + + /** + * Convert an instance of ReadOnlyFirst to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index f7dec65527..0c0de34386 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.TriangleInterface; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ScaleneTriangle */ @@ -143,6 +146,7 @@ public class ScaleneTriangle { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ public class ScaleneTriangle { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ScaleneTriangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ScaleneTriangle.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ScaleneTriangle is not found in the empty JSON string", ScaleneTriangle.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ScaleneTriangle.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ScaleneTriangle` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ScaleneTriangle.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public class ScaleneTriangle { @Override public ScaleneTriangle read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ScaleneTriangle.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ScaleneTriangle` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ScaleneTriangle.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ScaleneTriangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of ScaleneTriangle + * @throws IOException if the JSON string is invalid with respect to ScaleneTriangle + */ + public static ScaleneTriangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ScaleneTriangle.class); + } + + /** + * Convert an instance of ScaleneTriangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java index 23b4c43b00..dc6334a978 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Shape.java @@ -105,10 +105,13 @@ public class Shape extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral try { - deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Quadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public class Shape extends AbstractOpenApiSchema { // deserialize Triangle try { - deserialized = adapterTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Triangle.validateJsonObject(jsonObject); + actualAdapter = adapterTriangle; match++; log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public class Shape extends AbstractOpenApiSchema { if (match == 1) { Shape ret = new Shape(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -223,5 +228,53 @@ public class Shape extends AbstractOpenApiSchema { return (Triangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Shape + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Quadrilateral + try { + Quadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Triangle + try { + Triangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Shape with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Shape given an JSON string + * + * @param jsonString JSON string + * @return An instance of Shape + * @throws IOException if the JSON string is invalid with respect to Shape + */ + public static Shape fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Shape.class); + } + + /** + * Convert an instance of Shape to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java index 628c2f7af2..3aa6fadf9e 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * ShapeInterface */ @@ -112,6 +115,7 @@ public class ShapeInterface { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ public class ShapeInterface { openapiRequiredFields.add("shapeType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ShapeInterface + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (ShapeInterface.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in ShapeInterface is not found in the empty JSON string", ShapeInterface.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!ShapeInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `ShapeInterface` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ShapeInterface.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public class ShapeInterface { @Override public ShapeInterface read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!ShapeInterface.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `ShapeInterface` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : ShapeInterface.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of ShapeInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShapeInterface + * @throws IOException if the JSON string is invalid with respect to ShapeInterface + */ + public static ShapeInterface fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShapeInterface.class); + } + + /** + * Convert an instance of ShapeInterface to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 871b888129..b48a29b873 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -105,10 +105,13 @@ public class ShapeOrNull extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize Quadrilateral try { - deserialized = adapterQuadrilateral.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Quadrilateral.validateJsonObject(jsonObject); + actualAdapter = adapterQuadrilateral; match++; log.log(Level.FINER, "Input data matches schema 'Quadrilateral'"); } catch (Exception e) { @@ -118,7 +121,9 @@ public class ShapeOrNull extends AbstractOpenApiSchema { // deserialize Triangle try { - deserialized = adapterTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + Triangle.validateJsonObject(jsonObject); + actualAdapter = adapterTriangle; match++; log.log(Level.FINER, "Input data matches schema 'Triangle'"); } catch (Exception e) { @@ -128,7 +133,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { if (match == 1) { ShapeOrNull ret = new ShapeOrNull(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -228,5 +233,53 @@ public class ShapeOrNull extends AbstractOpenApiSchema { return (Triangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to ShapeOrNull + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with Quadrilateral + try { + Quadrilateral.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with Triangle + try { + Triangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ShapeOrNull with oneOf schemas: Quadrilateral, Triangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of ShapeOrNull given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShapeOrNull + * @throws IOException if the JSON string is invalid with respect to ShapeOrNull + */ + public static ShapeOrNull fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShapeOrNull.class); + } + + /** + * Convert an instance of ShapeOrNull to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 064c5f0996..9a87c62f59 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -28,6 +28,7 @@ import org.openapitools.client.model.ShapeInterface; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * SimpleQuadrilateral */ @@ -143,6 +146,7 @@ public class SimpleQuadrilateral { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -158,6 +162,36 @@ public class SimpleQuadrilateral { openapiRequiredFields.add("quadrilateralType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SimpleQuadrilateral + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SimpleQuadrilateral.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SimpleQuadrilateral is not found in the empty JSON string", SimpleQuadrilateral.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SimpleQuadrilateral.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SimpleQuadrilateral` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SimpleQuadrilateral.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -178,26 +212,33 @@ public class SimpleQuadrilateral { @Override public SimpleQuadrilateral read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!SimpleQuadrilateral.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `SimpleQuadrilateral` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : SimpleQuadrilateral.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of SimpleQuadrilateral given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimpleQuadrilateral + * @throws IOException if the JSON string is invalid with respect to SimpleQuadrilateral + */ + public static SimpleQuadrilateral fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimpleQuadrilateral.class); + } + + /** + * Convert an instance of SimpleQuadrilateral to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java index dfdbc850f4..9b26d894f0 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * SpecialModelName */ @@ -141,6 +144,7 @@ public class SpecialModelName { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -154,6 +158,29 @@ public class SpecialModelName { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to SpecialModelName + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (SpecialModelName.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in SpecialModelName is not found in the empty JSON string", SpecialModelName.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!SpecialModelName.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `SpecialModelName` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -174,19 +201,33 @@ public class SpecialModelName { @Override public SpecialModelName read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!SpecialModelName.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `SpecialModelName` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of SpecialModelName given an JSON string + * + * @param jsonString JSON string + * @return An instance of SpecialModelName + * @throws IOException if the JSON string is invalid with respect to SpecialModelName + */ + public static SpecialModelName fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SpecialModelName.class); + } + + /** + * Convert an instance of SpecialModelName to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java index 78ea45ac86..0aae4c29af 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Tag.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Tag */ @@ -141,6 +144,7 @@ public class Tag { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -154,6 +158,29 @@ public class Tag { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Tag + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Tag.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Tag is not found in the empty JSON string", Tag.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Tag.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Tag` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -174,19 +201,33 @@ public class Tag { @Override public Tag read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Tag.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Tag` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Tag given an JSON string + * + * @param jsonString JSON string + * @return An instance of Tag + * @throws IOException if the JSON string is invalid with respect to Tag + */ + public static Tag fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Tag.class); + } + + /** + * Convert an instance of Tag to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java index 9311228bf0..0bbf11f064 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Triangle.java @@ -114,10 +114,13 @@ public class Triangle extends AbstractOpenApiSchema { JsonObject jsonObject = elementAdapter.read(in).getAsJsonObject(); int match = 0; + TypeAdapter actualAdapter = elementAdapter; // deserialize EquilateralTriangle try { - deserialized = adapterEquilateralTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + EquilateralTriangle.validateJsonObject(jsonObject); + actualAdapter = adapterEquilateralTriangle; match++; log.log(Level.FINER, "Input data matches schema 'EquilateralTriangle'"); } catch (Exception e) { @@ -127,7 +130,9 @@ public class Triangle extends AbstractOpenApiSchema { // deserialize IsoscelesTriangle try { - deserialized = adapterIsoscelesTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + IsoscelesTriangle.validateJsonObject(jsonObject); + actualAdapter = adapterIsoscelesTriangle; match++; log.log(Level.FINER, "Input data matches schema 'IsoscelesTriangle'"); } catch (Exception e) { @@ -137,7 +142,9 @@ public class Triangle extends AbstractOpenApiSchema { // deserialize ScaleneTriangle try { - deserialized = adapterScaleneTriangle.fromJsonTree(jsonObject); + // validate the JSON object to see if any excpetion is thrown + ScaleneTriangle.validateJsonObject(jsonObject); + actualAdapter = adapterScaleneTriangle; match++; log.log(Level.FINER, "Input data matches schema 'ScaleneTriangle'"); } catch (Exception e) { @@ -147,7 +154,7 @@ public class Triangle extends AbstractOpenApiSchema { if (match == 1) { Triangle ret = new Triangle(); - ret.setActualInstance(deserialized); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonObject)); return ret; } @@ -265,5 +272,60 @@ public class Triangle extends AbstractOpenApiSchema { return (ScaleneTriangle)super.getActualInstance(); } + + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Triangle + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + // validate the json string with EquilateralTriangle + try { + EquilateralTriangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with IsoscelesTriangle + try { + IsoscelesTriangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + // validate the json string with ScaleneTriangle + try { + ScaleneTriangle.validateJsonObject(jsonObj); + validCount++; + } catch (Exception e) { + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for Triangle with oneOf schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle. %d class(es) match the result, expected 1. JSON: %s", validCount, jsonObj.toString())); + } + } + + /** + * Create an instance of Triangle given an JSON string + * + * @param jsonString JSON string + * @return An instance of Triangle + * @throws IOException if the JSON string is invalid with respect to Triangle + */ + public static Triangle fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Triangle.class); + } + + /** + * Convert an instance of Triangle to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java index a03456d2a0..24615e1588 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * TriangleInterface */ @@ -112,6 +115,7 @@ public class TriangleInterface { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -125,6 +129,36 @@ public class TriangleInterface { openapiRequiredFields.add("triangleType"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to TriangleInterface + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (TriangleInterface.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in TriangleInterface is not found in the empty JSON string", TriangleInterface.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!TriangleInterface.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `TriangleInterface` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TriangleInterface.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -145,26 +179,33 @@ public class TriangleInterface { @Override public TriangleInterface read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!TriangleInterface.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `TriangleInterface` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : TriangleInterface.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of TriangleInterface given an JSON string + * + * @param jsonString JSON string + * @return An instance of TriangleInterface + * @throws IOException if the JSON string is invalid with respect to TriangleInterface + */ + public static TriangleInterface fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TriangleInterface.class); + } + + /** + * Convert an instance of TriangleInterface to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java index 4f60e1ecd7..d1b54e47fe 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/User.java @@ -27,6 +27,7 @@ import org.openapitools.jackson.nullable.JsonNullable; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -41,6 +42,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * User */ @@ -443,6 +446,7 @@ public class User { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -466,6 +470,29 @@ public class User { openapiRequiredFields = new HashSet(); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to User + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (User.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in User is not found in the empty JSON string", User.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!User.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `User` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -486,19 +513,33 @@ public class User { @Override public User read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!User.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `User` properties"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of User given an JSON string + * + * @param jsonString JSON string + * @return An instance of User + * @throws IOException if the JSON string is invalid with respect to User + */ + public static User fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, User.class); + } + + /** + * Convert an instance of User to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java index c84faf2790..b7d11108b2 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Whale.java @@ -26,6 +26,7 @@ import java.io.IOException; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -40,6 +41,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Whale */ @@ -170,6 +173,7 @@ public class Whale { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -185,6 +189,36 @@ public class Whale { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Whale + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Whale.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Whale is not found in the empty JSON string", Whale.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Whale.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Whale` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Whale.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -205,26 +239,33 @@ public class Whale { @Override public Whale read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Whale.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Whale` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Whale.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Whale given an JSON string + * + * @param jsonString JSON string + * @return An instance of Whale + * @throws IOException if the JSON string is invalid with respect to Whale + */ + public static Whale fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Whale.class); + } + + /** + * Convert an instance of Whale to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java index 7821c21cac..260cde0f44 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/main/java/org/openapitools/client/model/Zebra.java @@ -28,6 +28,7 @@ import java.util.Map; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; @@ -42,6 +43,8 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import org.openapitools.client.JSON; + /** * Zebra */ @@ -194,6 +197,7 @@ public class Zebra extends HashMap { return o.toString().replace("\n", "\n "); } + public static HashSet openapiFields; public static HashSet openapiRequiredFields; @@ -208,6 +212,36 @@ public class Zebra extends HashMap { openapiRequiredFields.add("className"); } + /** + * Validates the JSON Object and throws an exception if issues found + * + * @param jsonObj JSON Object + * @throws IOException if the JSON Object is invalid with respect to Zebra + */ + public static void validateJsonObject(JsonObject jsonObj) throws IOException { + if (jsonObj == null) { + if (Zebra.openapiRequiredFields.isEmpty()) { + return; + } else { // has reuqired fields + throw new IllegalArgumentException(String.format("The required field(s) %s in Zebra is not found in the empty JSON string", Zebra.openapiRequiredFields.toString())); + } + } + Set> entries = jsonObj.entrySet(); + // check to see if the JSON string contains additional fields + for (Entry entry : entries) { + if (!Zebra.openapiFields.contains(entry.getKey())) { + throw new IllegalArgumentException(String.format("The field `%s` in the JSON string is not defined in the `Zebra` properties. JSON: %s", entry.getKey(), jsonObj.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Zebra.openapiRequiredFields) { + if (jsonObj.get(requiredField) == null) { + throw new IllegalArgumentException(String.format("The required field `%s` is not found in the JSON string: %s", requiredField, jsonObj.toString())); + } + } + } + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { @SuppressWarnings("unchecked") @Override @@ -228,26 +262,33 @@ public class Zebra extends HashMap { @Override public Zebra read(JsonReader in) throws IOException { - JsonObject obj = elementAdapter.read(in).getAsJsonObject(); - Set> entries = obj.entrySet();//will return members of your object - // check to see if the JSON string contains additional fields - for (Entry entry: entries) { - if (!Zebra.openapiFields.contains(entry.getKey())) { - throw new IllegalArgumentException("The field `" + entry.getKey() + "` in the JSON string is not defined in the `Zebra` properties"); - } - } - - // check to make sure all required properties/fields are present in the JSON string - for (String requiredField : Zebra.openapiRequiredFields) { - if (obj.get(requiredField) == null) { - throw new IllegalArgumentException("The required field `" + requiredField + "` is not found in the JSON string"); - } - } - - return thisAdapter.fromJsonTree(obj); + JsonObject jsonObj = elementAdapter.read(in).getAsJsonObject(); + validateJsonObject(jsonObj); + return thisAdapter.fromJsonTree(jsonObj); } }.nullSafe(); } } + + /** + * Create an instance of Zebra given an JSON string + * + * @param jsonString JSON string + * @return An instance of Zebra + * @throws IOException if the JSON string is invalid with respect to Zebra + */ + public static Zebra fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Zebra.class); + } + + /** + * Convert an instance of Zebra to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } } + diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java index 6b631a5a98..9d56087899 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/JSONTest.java @@ -245,10 +245,46 @@ public class JSONTest { assertEquals(t2.getId(), null); // with all required fields - String json3 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; // missing photoUrls (required field) + String json3 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; Pet t3 = gson.fromJson(json3, Pet.class); assertEquals(t3.getName(), "pet test 1"); assertEquals(t3.getId(), Long.valueOf(5847)); + + // with all required fields and tags (optional) + String json4 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"id\":\"tag 123\"}]}"; + Pet t4 = gson.fromJson(json3, Pet.class); + assertEquals(t4.getName(), "pet test 1"); + assertEquals(t4.getId(), Long.valueOf(5847)); + + // test Tag + String json5 = "{\"unknown_field\": 543, \"id\":\"tag 123\"}"; + Exception exception5 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Tag t5 = gson.fromJson(json5, Tag.class); + }); + assertTrue(exception5.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags + String json6 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; + Exception exception6 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + Pet t6 = gson.fromJson(json6, Pet.class); + }); + assertTrue(exception6.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags (required) + String json7 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"],\"tags\":[{\"unknown_field\": 543, \"id\":\"tag 123\"}]}"; + Exception exception7 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + PetWithRequiredTags t7 = gson.fromJson(json7, PetWithRequiredTags.class); + }); + assertTrue(exception7.getMessage().contains("The field `unknown_field` in the JSON string is not defined in the `Tag` properties. JSON: {\"unknown_field\":543,\"id\":\"tag 123\"}")); + + // test Pet with invalid tags (missing reqired) + String json8 = "{\"id\": 5847, \"name\":\"pet test 1\", \"photoUrls\": [\"https://a.com\", \"https://b.com\"]}"; + Exception exception8 = assertThrows(java.lang.IllegalArgumentException.class, () -> { + PetWithRequiredTags t8 = gson.fromJson(json8, PetWithRequiredTags.class); + }); + assertTrue(exception8.getMessage().contains("The required field `tags` is not found in the JSON string: {\"id\":5847,\"name\":\"pet test 1\",\"photoUrls\":[\"https://a.com\",\"https://b.com\"]}")); + + } /** Model tests for Pet */ @@ -306,7 +342,9 @@ public class JSONTest { assertEquals(inst.getCultivar(), "golden delicious"); assertEquals(inst.getOrigin(), "japan"); assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); + assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"origin\":\"japan\"}"); String str2 = "{ \"origin_typo\": \"japan\" }"; // no match @@ -348,18 +386,32 @@ public class JSONTest { assertEquals(inst.getCultivar(), "golden delicious"); assertEquals(inst.getMealy(), false); assertEquals(json.getGson().toJson(inst), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); assertEquals(json.getGson().toJson(o), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(o.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); AppleReq inst2 = o.getAppleReq(); assertEquals(inst2.getCultivar(), "golden delicious"); assertEquals(inst2.getMealy(), false); assertEquals(json.getGson().toJson(inst2), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst2.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + + // test fromJson + FruitReq o3 = FruitReq.fromJson(str); + assertTrue(o3.getActualInstance() instanceof AppleReq); + AppleReq inst3 = (AppleReq) o3.getActualInstance(); + assertEquals(inst3.getCultivar(), "golden delicious"); + assertEquals(inst3.getMealy(), false); + assertEquals(json.getGson().toJson(inst3), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(inst3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); + assertEquals(o3.toJson(), "{\"cultivar\":\"golden delicious\",\"mealy\":false}"); } { // test to ensure the oneOf object can be serialized to "null" correctly FruitReq o = new FruitReq(); assertEquals(o.getActualInstance(), null); assertEquals(json.getGson().toJson(o), "null"); + assertEquals(o.toJson(), "null"); assertEquals(json.getGson().toJson(null), "null"); } { diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java index 54eb3e8e09..471887d261 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -17,7 +17,6 @@ import org.openapitools.client.ApiException; import java.math.BigDecimal; import org.openapitools.client.model.Client; import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; import org.openapitools.client.model.HealthCheckResult; import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; @@ -129,21 +128,6 @@ public class FakeApiTest { // TODO: test validations } - /** - * - * - * For this test, the body for this request much reference a schema named `File`. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testBodyWithFileSchemaTest() throws ApiException { - FileSchemaTestClass fileSchemaTestClass = null; - api.testBodyWithFileSchema(fileSchemaTestClass); - // TODO: test validations - } - /** * * diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..132012d4c3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java new file mode 100644 index 0000000000..4d78953915 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-nextgen/src/test/java/org/openapitools/client/model/PetWithRequiredTagsTest.java @@ -0,0 +1,95 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import org.openapitools.client.model.Category; +import org.openapitools.client.model.Tag; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for PetWithRequiredTags + */ +public class PetWithRequiredTagsTest { + private final PetWithRequiredTags model = new PetWithRequiredTags(); + + /** + * Model tests for PetWithRequiredTags + */ + @Test + public void testPetWithRequiredTags() { + // TODO: test PetWithRequiredTags + } + + /** + * Test the property 'id' + */ + @Test + public void idTest() { + // TODO: test id + } + + /** + * Test the property 'category' + */ + @Test + public void categoryTest() { + // TODO: test category + } + + /** + * Test the property 'name' + */ + @Test + public void nameTest() { + // TODO: test name + } + + /** + * Test the property 'photoUrls' + */ + @Test + public void photoUrlsTest() { + // TODO: test photoUrls + } + + /** + * Test the property 'tags' + */ + @Test + public void tagsTest() { + // TODO: test tags + } + + /** + * Test the property 'status' + */ + @Test + public void statusTest() { + // TODO: test status + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md new file mode 100644 index 0000000000..37ad0cfd8e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelFile.md @@ -0,0 +1,18 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + +## Implemented Interfaces + +* Parcelable + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md new file mode 100644 index 0000000000..232bbf2e0a --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md @@ -0,0 +1,17 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + +## Implemented Interfaces + +* Parcelable + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..99e3a6b454 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,124 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile implements Parcelable { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + out.writeValue(sourceURI); + } + + ModelFile(Parcel in) { + sourceURI = (String)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public ModelFile createFromParcel(Parcel in) { + return new ModelFile(in); + } + public ModelFile[] newArray(int size) { + return new ModelFile[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..3c03ba17da --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,123 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList implements Parcelable { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + out.writeValue(_123list); + } + + ModelList(Parcel in) { + _123list = (String)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public ModelList createFromParcel(Parcel in) { + return new ModelList(in); + } + public ModelList[] newArray(int size) { + return new ModelList[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..132012d4c3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelFile.md b/samples/client/petstore/java/okhttp-gson/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..111a748cef --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..2ba46fefd4 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..132012d4c3 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md b/samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md b/samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..6197afe891 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..b68373d3d8 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/rest-assured-jackson/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/rest-assured/docs/ModelFile.md b/samples/client/petstore/java/rest-assured/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured/docs/ModelList.md b/samples/client/petstore/java/rest-assured/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..44f900da98 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..d3a2c81507 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import javax.validation.constraints.*; +import javax.validation.Valid; +import org.hibernate.validator.constraints.*; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..132012d4c3 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/resteasy/docs/ModelFile.md b/samples/client/petstore/java/resteasy/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/resteasy/docs/ModelList.md b/samples/client/petstore/java/resteasy/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..c87bc91994 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,117 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@XmlRootElement(name = "ModelFile") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelFile") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + @XmlElement(name = "sourceURI") + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "sourceURI") + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..32aadcded8 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,116 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@XmlRootElement(name = "ModelList") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelList") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + @XmlElement(name = "123-list") + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JacksonXmlProperty(localName = "123-list") + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/resttemplate/docs/ModelFile.md b/samples/client/petstore/java/resttemplate/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate/docs/ModelList.md b/samples/client/petstore/java/resttemplate/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md b/samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2-play26/docs/ModelList.md b/samples/client/petstore/java/retrofit2-play26/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..42060439bf --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,111 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..6eb2c78337 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play26/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2/docs/ModelFile.md b/samples/client/petstore/java/retrofit2/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelList.md b/samples/client/petstore/java/retrofit2/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..111a748cef --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..2ba46fefd4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..132012d4c3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..111a748cef --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..2ba46fefd4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..132012d4c3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md b/samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx3/docs/ModelList.md b/samples/client/petstore/java/retrofit2rx3/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..111a748cef --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String SERIALIZED_NAME_SOURCE_U_R_I = "sourceURI"; + @SerializedName(SERIALIZED_NAME_SOURCE_U_R_I) + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + + public String getSourceURI() { + return sourceURI; + } + + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..2ba46fefd4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,100 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String SERIALIZED_NAME_123LIST = "123-list"; + @SerializedName(SERIALIZED_NAME_123LIST) + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public String get123list() { + return _123list; + } + + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..132012d4c3 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..d3ed2075e9 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx3/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,51 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md b/samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md b/samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/vertx-no-nullable/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/vertx/docs/ModelFile.md b/samples/client/petstore/java/vertx/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/vertx/docs/ModelList.md b/samples/client/petstore/java/vertx/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/vertx/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/client/petstore/java/webclient/docs/ModelFile.md b/samples/client/petstore/java/webclient/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/client/petstore/java/webclient/docs/ModelList.md b/samples/client/petstore/java/webclient/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/client/petstore/java/webclient/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..8647283641 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,109 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@JsonTypeName("File") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..82abfba9e3 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@JsonTypeName("List") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/client/petstore/java/webclient/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md new file mode 100644 index 0000000000..1282785e32 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelFile.md @@ -0,0 +1,14 @@ + + +# ModelFile + +Must be named `File` for test. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sourceURI** | **String** | Test capitalization | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md new file mode 100644 index 0000000000..c838a6a72e --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/docs/ModelList.md @@ -0,0 +1,13 @@ + + +# ModelList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123list** | **String** | | [optional] + + + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java new file mode 100644 index 0000000000..0de39ec2ab --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -0,0 +1,113 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@JsonPropertyOrder({ + ModelFile.JSON_PROPERTY_SOURCE_U_R_I +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelFile { + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; + + public ModelFile() { + } + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Test capitalization") + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getSourceURI() { + return sourceURI; + } + + + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + /** + * Return true if this File object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java new file mode 100644 index 0000000000..19025e8ec4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -0,0 +1,112 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import java.util.Objects; +import java.util.Arrays; +import java.util.Map; +import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import org.openapitools.client.JSON; + + +/** + * ModelList + */ +@JsonPropertyOrder({ + ModelList.JSON_PROPERTY_123LIST +}) +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +public class ModelList { + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; + + public ModelList() { + } + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String get123list() { + return _123list; + } + + + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + + /** + * Return true if this List object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java new file mode 100644 index 0000000000..5b3fde28d4 --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelFile + */ +public class ModelFileTest { + private final ModelFile model = new ModelFile(); + + /** + * Model tests for ModelFile + */ + @Test + public void testModelFile() { + // TODO: test ModelFile + } + + /** + * Test the property 'sourceURI' + */ + @Test + public void sourceURITest() { + // TODO: test sourceURI + } + +} diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java new file mode 100644 index 0000000000..36755ee2bd --- /dev/null +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -0,0 +1,50 @@ +/* + * OpenAPI Petstore + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.openapitools.client.model; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.junit.Assert; +import org.junit.Ignore; +import org.junit.Test; + + +/** + * Model tests for ModelList + */ +public class ModelListTest { + private final ModelList model = new ModelList(); + + /** + * Model tests for ModelList + */ + @Test + public void testModelList() { + // TODO: test ModelList + } + + /** + * Test the property '_123list' + */ + @Test + public void _123listTest() { + // TODO: test _123list + } + +} diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java new file mode 100644 index 0000000000..ce611a313c --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelFile.java @@ -0,0 +1,75 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * Must be named `File` for test. + */ +@ApiModel(description = "Must be named `File` for test.") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen") +public class ModelFile { + @JsonProperty("sourceURI") + private String sourceURI; + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + @ApiModelProperty(value = "Test capitalization") + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(this.sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java new file mode 100644 index 0000000000..101752a80d --- /dev/null +++ b/samples/server/petstore/java-msf4j/src/gen/java/org/openapitools/model/ModelList.java @@ -0,0 +1,74 @@ +package org.openapitools.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaMSF4JServerCodegen") +public class ModelList { + @JsonProperty("123-list") + private String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + @ApiModelProperty(value = "") + public String get123list() { + return _123list; + } + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java new file mode 100644 index 0000000000..16c242ddf5 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelFile.java @@ -0,0 +1,75 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * Must be named `File` for test. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPlayFrameworkCodegen") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class ModelFile { + @JsonProperty("sourceURI") + + private String sourceURI; + + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; + } + + /** + * Test capitalization + * @return sourceURI + **/ + public String getSourceURI() { + return sourceURI; + } + + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelFile _file = (ModelFile) o; + return Objects.equals(sourceURI, _file.sourceURI); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java new file mode 100644 index 0000000000..6b6d4a3913 --- /dev/null +++ b/samples/server/petstore/java-play-framework-fake-endpoints/app/apimodels/ModelList.java @@ -0,0 +1,75 @@ +package apimodels; + +import com.fasterxml.jackson.annotation.*; +import java.util.Set; +import javax.validation.*; +import java.util.Objects; +import javax.validation.constraints.*; +/** + * ModelList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaPlayFrameworkCodegen") +@SuppressWarnings({"UnusedReturnValue", "WeakerAccess"}) +public class ModelList { + @JsonProperty("123-list") + + private String _123list; + + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; + } + + /** + * Get _123list + * @return _123list + **/ + public String get123list() { + return _123list; + } + + public void set123list(String _123list) { + this._123list = _123list; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(_123list, _list._123list); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @SuppressWarnings("StringBufferReplaceableByString") + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + From 0de482da2b3016a0dfd4a7fd1c8bd2b523d370ab Mon Sep 17 00:00:00 2001 From: alisters Date: Mon, 20 Dec 2021 17:59:11 +1100 Subject: [PATCH 37/54] Kotlin client: add volley library support (#10253) * Add basic jvm-volley folder to enable it as a library * Add JVM_VOLLEY to the KotlinClientCodegen as a library option (using Retrofit2 processing for now) * Temporary checkin of generated code and kotlinfied version for use in new template * Added Kotlin-ified api invoker and request objects, update Kotlin client codgen for volley * Add Android specific build.gradle mustache file to jvm-volley library * Hardcode SDK version and build tools version in build.gradle template, add extra repository for Android Gradle build tools * Add Android manifest to generated code * Add Kotlin dependencies and plugins to build gradle template * WIP: Create basic API templating for jvm-volley * Add ApiException and parameter validation, create path variable using ApiInvoker * Build queryParams and headerParams * Add VolleyRequest template * WIP: Injecting context and default API invoker into APIs (non compiling) * Add DefaultInvoker stub and update API to inject context * Add request queue generation to the DefaultInvoker * Fix up compile errors in the invoker * Cleanup unrequired templates * Update templates * Add constructor overloads to inject stack or network into request queue * Fix compile errors with request queue generation * Fix compile errors * Al'll fix it for you..... * WIP compile fixes * More compile fixes * Generate to java directory and kotlin-ify auth code * More syntax fixes in templates * Almost left it in a working state, fixing that .... now... * Switch builder method based on model existence constraints - body and response * Add coroutine logic to APIs and pass through listeners to the requests, various other fixes. * Use reflection and type tokens to work around clazz issues on generics * Add POST, PATCH and PUT to RequestFactory * More templating magic * Fix Steve, the human compiler's errors again ! * Add CLI option for generating room models * Configure the room model package * Add initial room model templating and generation * Add room model generation implementation * Implement toRoom function on models to convert model to room model * Bug fixes, transformers to and from room models * Add query parameters to URL generation * Fix issues with gson type conversion, add type adapters to gson instance * Fix issues with older API versions and Java8 libraries, * Add request factory interface * API template tidy up * Update IRequestFactory to include companion object, minor tidy ups * Remove @Keep annotations from room templates * Rename toRoomModel and toApiModel functions * Add empty companion object to generated room model * Add ITransformStorage interface to allow polymorphic transforms to room models * Add content type into GsonRequest * Move gson serialization of request body into GsonRequest * Update request factory to take header factories * Remove the generated comparision code * Move the generateRoomModels switch into the KotlinClientCodegen class * Move room model generation out of default generator * Updates for auth * Finalise removal of kotlin elements from default generator * Hoist room model logic out of abstractKotlin into kotlin client codegen * Revert AbstractKotlinCodegen * Revert Codegen constants to remove base generator changes out of our new library * Revert data class template changes, add data class body check to Kotlin Client codegen * Add sample generation yaml file for jvm-volley library * Update JVM-Volley readme for generateRoomModels flag * Remove unused template files, get auth compiling but non functional, clean build of warnings * Generate sample generated code * Add not implemented method for oauth * Add unit test for KotlinClientCodegen generateRoomModel flag * Remove accidental hard coding of src/main/java source folder * Push changed generated sample files * Move and rename IStorable inside the volley library * Inject retry policy into API definition, re-run sample and doc scripts * Add generic post processors * Update samples after generator changes * Fix some compile errors with the pet store sample * Fix duplicate auth companion object and import generation * Reinstate query and form parameter code generation * Add check for unsupported serialization libraries * Fix broken unit tests * Regenerate samples * AN-233 Update request factory to allow custom gsonadapters * update `GsonRequest.mustache` and `RequestFactoy.mustache` to use `Map` instead of `Map` to better fit kotlin conventions * Update readme with better examples and design notes * Update readme with info about gson serializers and adapters for polymorphic types * Updated samples * Merge from upstream * Address review comments * Update samples * Samples * Update docs * Remove DateAdapter generated file, template and it's inclusion as a supporting file in favour of localDateTime * Review comment cleanup for initial PR #10253 - cleaner auth key in parameter string handling * Review comment - add a kotlin version parameter to the build scripts * Updated samples * Missing changes from build.mustache * Regenerate samples for build.gradle changes * Merge from master and generate samples * Remove serializer as a supporting file from jvm-volley - it's serialisation is not a singleton and configured differently via gson request and dependency injection * Remove singleton serializer from jvm-volley generation as it's not used Co-authored-by: Alister Shipman Co-authored-by: Steve Telford Co-authored-by: Leigh Cooper Co-authored-by: Michael Hewett --- bin/configs/kotlin-jvm-volley.yaml | 9 + docs/generators/kotlin.md | 3 +- .../languages/KotlinClientCodegen.java | 115 +++- .../kotlin-client/data_class.mustache | 14 +- .../libraries/jvm-volley/README.mustache | 232 +++++++ .../libraries/jvm-volley/api.mustache | 129 ++++ .../libraries/jvm-volley/api_doc.mustache | 83 +++ .../jvm-volley/auth/apikeyauth.mustache | 16 + .../jvm-volley/auth/authentication.mustache | 15 + .../jvm-volley/auth/httpbasicauth.mustache | 3 + .../libraries/jvm-volley/auth/oauth.mustache | 5 + .../libraries/jvm-volley/bodyParams.mustache | 1 + .../libraries/jvm-volley/build.mustache | 129 ++++ .../libraries/jvm-volley/formParams.mustache | 1 + .../jvm-volley/gradle.properties.mustache | 4 + .../jvm-volley/headerParams.mustache | 1 + .../CollectionFormats.kt.mustache | 56 ++ .../ITransformForStorage.mustache | 9 + .../libraries/jvm-volley/manifest.mustache | 5 + .../libraries/jvm-volley/pathParams.mustache | 1 + .../libraries/jvm-volley/queryParams.mustache | 1 + .../jvm-volley/request/GsonRequest.mustache | 119 ++++ .../request/IRequestFactory.mustache | 64 ++ .../request/RequestFactory.mustache | 69 +++ .../kotlin-client/model_room.mustache | 38 ++ .../model_room_init_var.mustache | 1 + .../org/openapitools/codegen/TestUtils.java | 10 + .../KotlinJvmVolleyModelCodegenTest.java | 83 +++ .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 43 ++ .../.openapi-generator/VERSION | 1 + .../petstore/kotlin-jvm-volley/README.md | 230 +++++++ .../petstore/kotlin-jvm-volley/build.gradle | 95 +++ .../kotlin-jvm-volley/docs/ApiResponse.md | 12 + .../kotlin-jvm-volley/docs/Category.md | 11 + .../petstore/kotlin-jvm-volley/docs/Order.md | 22 + .../petstore/kotlin-jvm-volley/docs/Pet.md | 22 + .../petstore/kotlin-jvm-volley/docs/PetApi.md | 320 ++++++++++ .../kotlin-jvm-volley/docs/StoreApi.md | 158 +++++ .../petstore/kotlin-jvm-volley/docs/Tag.md | 11 + .../petstore/kotlin-jvm-volley/docs/User.md | 17 + .../kotlin-jvm-volley/docs/UserApi.md | 310 +++++++++ .../kotlin-jvm-volley/gradle.properties | 2 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + .../client/petstore/kotlin-jvm-volley/gradlew | 185 ++++++ .../petstore/kotlin-jvm-volley/gradlew.bat | 89 +++ .../kotlin-jvm-volley/settings.gradle | 2 + .../src/main/AndroidManifest.xml | 5 + .../org/openapitools/client/apis/PetApi.kt | 586 ++++++++++++++++++ .../org/openapitools/client/apis/StoreApi.kt | 300 +++++++++ .../org/openapitools/client/apis/UserApi.kt | 578 +++++++++++++++++ .../client/infrastructure/ByteArrayAdapter.kt | 33 + .../infrastructure/CollectionFormats.kt | 56 ++ .../infrastructure/ITransformForStorage.kt | 28 + .../client/infrastructure/LocalDateAdapter.kt | 35 ++ .../infrastructure/LocalDateTimeAdapter.kt | 35 ++ .../infrastructure/OffsetDateTimeAdapter.kt | 35 ++ .../openapitools/client/models/ApiResponse.kt | 57 ++ .../openapitools/client/models/Category.kt | 52 ++ .../client/models/ModelApiResponse.kt | 57 ++ .../org/openapitools/client/models/Order.kt | 83 +++ .../org/openapitools/client/models/Pet.kt | 85 +++ .../org/openapitools/client/models/Tag.kt | 52 ++ .../org/openapitools/client/models/User.kt | 83 +++ .../models/room/ApiResponseRoomModel.kt | 52 ++ .../client/models/room/CategoryRoomModel.kt | 49 ++ .../models/room/ModelApiResponseRoomModel.kt | 52 ++ .../client/models/room/OrderRoomModel.kt | 61 ++ .../client/models/room/PetRoomModel.kt | 63 ++ .../client/models/room/TagRoomModel.kt | 49 ++ .../client/models/room/UserRoomModel.kt | 67 ++ .../client/request/GsonRequest.kt | 119 ++++ .../client/request/IRequestFactory.kt | 64 ++ .../client/request/RequestFactory.kt | 87 +++ 75 files changed, 5591 insertions(+), 6 deletions(-) create mode 100644 bin/configs/kotlin-jvm-volley.yaml create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache create mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java create mode 100644 samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore create mode 100644 samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES create mode 100644 samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION create mode 100644 samples/client/petstore/kotlin-jvm-volley/README.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/build.gradle create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Category.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Order.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Pet.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/Tag.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/User.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradle.properties create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradlew create mode 100644 samples/client/petstore/kotlin-jvm-volley/gradlew.bat create mode 100644 samples/client/petstore/kotlin-jvm-volley/settings.gradle create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt create mode 100644 samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/bin/configs/kotlin-jvm-volley.yaml b/bin/configs/kotlin-jvm-volley.yaml new file mode 100644 index 0000000000..cdb8ac51a9 --- /dev/null +++ b/bin/configs/kotlin-jvm-volley.yaml @@ -0,0 +1,9 @@ +generatorName: kotlin +outputDir: samples/client/petstore/kotlin-jvm-volley +library: jvm-volley +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml +templateDir: modules/openapi-generator/src/main/resources/kotlin-client +additionalProperties: + artifactId: kotlin-petstore-jvm-volley + generateRoomModels: "true" + serializationLibrary: "gson" diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index cbf43a3a1e..786ff7013e 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -13,8 +13,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl |collectionType|Option. Collection type to use|
          **array**
          kotlin.Array
          **list**
          kotlin.collections.List
          |list| |dateLibrary|Option. Date library to use|
          **threetenbp-localdatetime**
          Threetenbp - Backport of JSR310 (jvm only, for legacy app only)
          **string**
          String
          **java8-localdatetime**
          Java 8 native JSR310 (jvm only, for legacy app only)
          **java8**
          Java 8 native JSR310 (jvm only, preferred for jdk 1.8+)
          **threetenbp**
          Threetenbp - Backport of JSR310 (jvm only, preferred for jdk < 1.8)
          |java8| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| +|generateRoomModels|Generate Android Room database models in addition to API models (JVM Volley library only)| |false| |groupId|Generated artifact package's organization (i.e. maven groupId).| |org.openapitools| -|library|Library template (sub-template) to use|
          **jvm-okhttp4**
          [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
          **jvm-okhttp3**
          Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
          **jvm-retrofit2**
          Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
          **multiplatform**
          Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.
          |jvm-okhttp4| +|library|Library template (sub-template) to use|
          **jvm-okhttp4**
          [DEFAULT] Platform: Java Virtual Machine. HTTP client: OkHttp 4.2.0 (Android 5.0+ and Java 8+). JSON processing: Moshi 1.8.0.
          **jvm-okhttp3**
          Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0.
          **jvm-retrofit2**
          Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2.
          **multiplatform**
          Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1.
          **jvm-volley**
          Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9
          |jvm-okhttp4| |modelMutable|Create mutable models| |false| |moshiCodeGen|Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.| |false| |omitGradlePluginVersions|Whether to declare Gradle plugin versions in build files.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index c8d7a87716..b0d272d075 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -57,12 +57,15 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { protected static final String JVM_OKHTTP3 = "jvm-okhttp3"; protected static final String JVM_RETROFIT2 = "jvm-retrofit2"; protected static final String MULTIPLATFORM = "multiplatform"; + protected static final String JVM_VOLLEY = "jvm-volley"; public static final String USE_RX_JAVA = "useRxJava"; public static final String USE_RX_JAVA2 = "useRxJava2"; public static final String USE_RX_JAVA3 = "useRxJava3"; public static final String USE_COROUTINES = "useCoroutines"; public static final String DO_NOT_USE_RX_AND_COROUTINES = "doNotUseRxAndCoroutines"; + public static final String GENERATE_ROOM_MODELS = "generateRoomModels"; + public static final String ROOM_MODEL_PACKAGE = "roomModelPackage"; public static final String OMIT_GRADLE_PLUGIN_VERSIONS = "omitGradlePluginVersions"; public static final String DATE_LIBRARY = "dateLibrary"; @@ -85,6 +88,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { // backwards compatibility for openapi configs that specify neither rx1 nor rx2 // (mustache does not allow for boolean operators so we need this extra field) protected boolean doNotUseRxAndCoroutines = true; + protected boolean generateRoomModels = false; + protected String roomModelPackage = ""; + protected String authFolder; @@ -167,6 +173,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { outputFolder = "generated-code" + File.separator + "kotlin-client"; modelTemplateFiles.put("model.mustache", ".kt"); + if (generateRoomModels) { + modelTemplateFiles.put("model_room.mustache", ".kt"); + } apiTemplateFiles.put("api.mustache", ".kt"); modelDocTemplateFiles.put("model_doc.mustache", ".md"); apiDocTemplateFiles.put("api_doc.mustache", ".md"); @@ -197,6 +206,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { supportedLibraries.put(JVM_OKHTTP3, "Platform: Java Virtual Machine. HTTP client: OkHttp 3.12.4 (Android 2.3+ and Java 7+). JSON processing: Moshi 1.8.0."); supportedLibraries.put(JVM_RETROFIT2, "Platform: Java Virtual Machine. HTTP client: Retrofit 2.6.2."); supportedLibraries.put(MULTIPLATFORM, "Platform: Kotlin multiplatform. HTTP client: Ktor 1.6.0. JSON processing: Kotlinx Serialization: 1.2.1."); + supportedLibraries.put(JVM_VOLLEY, "Platform: JVM for Android. HTTP client: Volley 1.2.1. JSON processing: gson 2.8.9"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "Library template (sub-template) to use"); libraryOption.setEnum(supportedLibraries); @@ -220,6 +230,8 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { cliOptions.add(CliOption.newBoolean(MOSHI_CODE_GEN, "Whether to enable codegen with the Moshi library. Refer to the [official Moshi doc](https://github.com/square/moshi#codegen) for more info.")); + cliOptions.add(CliOption.newBoolean(GENERATE_ROOM_MODELS, "Generate Android Room database models in addition to API models (JVM Volley library only)", false)); + cliOptions.add(CliOption.newBoolean(SUPPORT_ANDROID_API_LEVEL_25_AND_BELLOW, "[WARNING] This flag will generate code that has a known security vulnerability. It uses `kotlin.io.createTempFile` instead of `java.nio.file.Files.createTempFile` in oder to support Android API level 25 and bellow. For more info, please check the following links https://github.com/OpenAPITools/openapi-generator/security/advisories/GHSA-23x4-m842-fmwf, https://github.com/OpenAPITools/openapi-generator/pull/9284")); } @@ -235,6 +247,12 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { return "Generates a Kotlin client."; } + public boolean getGenerateRoomModels() { return generateRoomModels; } + + public void setGenerateRoomModels(Boolean generateRoomModels) { + this.generateRoomModels = generateRoomModels; + } + public void setUseRxJava(boolean useRxJava) { if (useRxJava) { this.useRxJava2 = false; @@ -298,14 +316,45 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { this.collectionType = collectionType; } + public void setRoomModelPackage(String roomModelPackage) { + this.roomModelPackage = roomModelPackage; + } + + @Override + public String modelFilename(String templateName, String modelName) { + String suffix = modelTemplateFiles().get(templateName); + // If this was a proper template method, i wouldn't have to make myself throw up by doing this.... + if (getGenerateRoomModels() && suffix.startsWith("RoomModel")) { + return roomModelFileFolder() + File.separator + toModelFilename(modelName) + suffix; + } else { + return modelFileFolder() + File.separator + toModelFilename(modelName) + suffix; + } + } + + public String roomModelFileFolder() { + return outputFolder + File.separator + sourceFolder + File.separator + roomModelPackage.replace('.', File.separatorChar); + } + @Override public void processOpts() { - super.processOpts(); - - if (MULTIPLATFORM.equals(getLibrary())) { - sourceFolder = "src/commonMain/kotlin"; + if (additionalProperties.containsKey(CodegenConstants.SOURCE_FOLDER)) { + setSourceFolder((String) additionalProperties.get(CodegenConstants.SOURCE_FOLDER)); + } else { + // Set the value to defaults if we haven't overridden + if (MULTIPLATFORM.equals(getLibrary())) { + setSourceFolder("src/commonMain/kotlin"); + } + else if (JVM_VOLLEY.equals(getLibrary())){ + // Android plugin wants it's source in java + setSourceFolder("src/main/java"); + } + else { + setSourceFolder(super.sourceFolder); + } + additionalProperties.put(CodegenConstants.SOURCE_FOLDER, this.sourceFolder); } + super.processOpts(); boolean hasRx = additionalProperties.containsKey(USE_RX_JAVA); boolean hasRx2 = additionalProperties.containsKey(USE_RX_JAVA2); @@ -348,6 +397,12 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { final String infrastructureFolder = (sourceFolder + File.separator + packageName + File.separator + "infrastructure").replace(".", "/"); authFolder = (sourceFolder + File.separator + packageName + File.separator + "auth").replace(".", "/"); + // request destination folder + final String requestFolder = (sourceFolder + File.separator + packageName + File.separator + "request").replace(".", "/"); + + // auth destination folder + final String authFolder = (sourceFolder + File.separator + packageName + File.separator + "auth").replace(".", "/"); + // additional properties if (additionalProperties.containsKey(DATE_LIBRARY)) { setDateLibrary(additionalProperties.get(DATE_LIBRARY).toString()); @@ -364,6 +419,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { case JVM_OKHTTP4: processJVMOkHttpLibrary(infrastructureFolder); break; + case JVM_VOLLEY: + processJVMVolleyLibrary(infrastructureFolder, requestFolder, authFolder); + break; case JVM_RETROFIT2: processJVMRetrofit2Library(infrastructureFolder); break; @@ -477,6 +535,47 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { addSupportingSerializerAdapters(infrastructureFolder); } + private void processJVMVolleyLibrary(String infrastructureFolder, String requestFolder, String authFolder) { + + additionalProperties.put(JVM, true); + additionalProperties.put(JVM_VOLLEY, true); + + if (additionalProperties.containsKey(GENERATE_ROOM_MODELS)) { + this.setGenerateRoomModels(convertPropertyToBooleanAndWriteBack(GENERATE_ROOM_MODELS)); + // Hide this option behind a property getter and setter in case we need to check it elsewhere + if (getGenerateRoomModels()) { + modelTemplateFiles.put("model_room.mustache", "RoomModel.kt"); + supportingFiles.add(new SupportingFile("infrastructure/ITransformForStorage.mustache", infrastructureFolder, "ITransformForStorage.kt")); + + } + } else { + additionalProperties.put(GENERATE_ROOM_MODELS, generateRoomModels); + } + + if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { + if (!additionalProperties.containsKey(ROOM_MODEL_PACKAGE)) + this.setRoomModelPackage(packageName + ".models.room"); + else + this.setRoomModelPackage(additionalProperties.get(ROOM_MODEL_PACKAGE).toString()); + } + additionalProperties.put(ROOM_MODEL_PACKAGE, roomModelPackage); + + supportingFiles.add(new SupportingFile("infrastructure/CollectionFormats.kt.mustache", infrastructureFolder, "CollectionFormats.kt")); + + // We have auth related partial files, so they can be overridden, but don't generate them explicitly + supportingFiles.add(new SupportingFile("request/GsonRequest.mustache", requestFolder, "GsonRequest.kt")); + supportingFiles.add(new SupportingFile("request/IRequestFactory.mustache", requestFolder, "IRequestFactory.kt")); + supportingFiles.add(new SupportingFile("request/RequestFactory.mustache", requestFolder, "RequestFactory.kt")); + supportingFiles.add(new SupportingFile("infrastructure/CollectionFormats.kt.mustache", infrastructureFolder, "CollectionFormats.kt")); + + if (getSerializationLibrary() != SERIALIZATION_LIBRARY_TYPE.gson) { + throw new RuntimeException("This library currently only supports gson serialization. Try adding '--additional-properties serializationLibrary=gson' to your command."); + } + addSupportingSerializerAdapters(infrastructureFolder); + supportingFiles.remove(new SupportingFile("jvm-common/infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt")); + + } + private void addSupportingSerializerAdapters(final String infrastructureFolder) { supportingFiles.add(new SupportingFile("jvm-common/infrastructure/Serializer.kt.mustache", infrastructureFolder, "Serializer.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/ByteArrayAdapter.kt.mustache", infrastructureFolder, "ByteArrayAdapter.kt")); @@ -605,6 +704,11 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { if (getLibrary().equals(MULTIPLATFORM)) { supportingFiles.add(new SupportingFile("build.gradle.kts.mustache", "", "build.gradle.kts")); supportingFiles.add(new SupportingFile("settings.gradle.kts.mustache", "", "settings.gradle.kts")); + } else if (getLibrary().equals(JVM_VOLLEY)) { + supportingFiles.add(new SupportingFile("build.mustache", "", "build.gradle")); + supportingFiles.add(new SupportingFile("gradle.properties.mustache", "", "gradle.properties")); + supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); + supportingFiles.add(new SupportingFile("manifest.mustache", "", "src/main/AndroidManifest.xml")); } else { supportingFiles.add(new SupportingFile("build.gradle.mustache", "", "build.gradle")); supportingFiles.add(new SupportingFile("settings.gradle.mustache", "", "settings.gradle")); @@ -625,6 +729,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { for (Object model : models) { @SuppressWarnings("unchecked") Map mo = (Map) model; CodegenModel cm = (CodegenModel) mo.get("model"); + if (getGenerateRoomModels()) { + cm.vendorExtensions.put("x-has-data-class-body", true); + } // escape the variable base name for use as a string literal List vars = Stream.of( diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache index c5289a46fa..5f5b4da03c 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/data_class.mustache @@ -35,6 +35,10 @@ import kotlinx.serialization.encoding.* {{#serializableModel}} import java.io.Serializable {{/serializableModel}} +{{#generateRoomModels}} +import {{roomModelPackage}}.{{classname}}RoomModel +import {{packageName}}.infrastructure.ITransformForStorage +{{/generateRoomModels}} /** * {{{description}}} @@ -56,8 +60,16 @@ import java.io.Serializable {{#required}}{{>data_class_req_var}}{{/required}}{{^required}}{{>data_class_opt_var}}{{/required}}{{^-last}},{{/-last}} {{/allVars}} -){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#vendorExtensions.x-has-data-class-body}} { +){{/discriminator}}{{#parent}}{{^serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{^parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{^serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#parent}}{{#serializableModel}}{{#parcelizeModels}} : {{{parent}}}{{#isMap}}(){{/isMap}}{{#isArray}}(){{/isArray}}, Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{^parcelizeModels}} : Serializable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{^parent}}{{#serializableModel}}{{#parcelizeModels}} : Serializable, Parcelable{{/parcelizeModels}}{{/serializableModel}}{{/parent}}{{#generateRoomModels}}{{#parent}}, {{/parent}}{{^discriminator}}{{^parent}}:{{/parent}} ITransformForStorage<{{classname}}RoomModel>{{/discriminator}}{{/generateRoomModels}}{{#vendorExtensions.x-has-data-class-body}} { {{/vendorExtensions.x-has-data-class-body}} +{{#generateRoomModels}} + companion object { } + {{^discriminator}}override fun toRoomModel(): {{classname}}RoomModel = + {{classname}}RoomModel(roomTableId = 0, + {{#allVars}}{{#items.isPrimitiveType}}{{#isArray}}{{#isList}}{{name}} = this.{{name}},{{/isList}}{{/isArray}}{{/items.isPrimitiveType}}{{^isEnum}}{{^isArray}}{{name}} = this.{{name}},{{/isArray}}{{/isEnum}}{{#isEnum}}{{^isArray}}{{name}} = this.{{name}},{{/isArray}}{{/isEnum}} + {{/allVars}} + ){{/discriminator}} +{{/generateRoomModels}} {{#serializableModel}} {{#nonPublicApi}}internal {{/nonPublicApi}}companion object { private const val serialVersionUID: Long = 123 diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache new file mode 100644 index 0000000000..ea684b9984 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/README.mustache @@ -0,0 +1,232 @@ +# {{packageName}} - Kotlin client library for {{appName}} + + +A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley + +- Currently sends GsonRequests +- Currently only supports Gson as a serializer - will throw an exception if a different serializer is chosen +- Defaults the source location to src/main/java as per standard Android builds + + +## Design + +Volley is a queue/request based layer on top of http url stack specific to Android. Android favours dependency injection and +a layered architecture, and IO performed off the main thread to maintain UI responsiveness, with a preferred technique of +kotlin co-routines. The code gen library reflects these factors. + +- Api calls use co-routines, and execute them using volley callbacks to avoid tying up a thread. +- Facilitate dependency injection, with default implementations available. +- Generate a requestFactory that can be overridden +- Allow the passing of the RequestFactory per tag (api client) or per operation (an extra parameter is created on operations with non-global security), with per operation auth overriding global security. +- DI scoping of the Request Factory and pre-generated auth header factories allow for thread safe and secure setting of credentials. +- Lazy header factories allow for refreshing tokens etc +- Factoring of header factories to the Request Factory allow ambient provision of credentials. Code gen library is credential storage agnostic. +- Header factories allow the merging of generated headers from open api spec with dynamically added headers + +- Injection of http url stack to allow custom http stacks. Default implementation is best practice singleton +- Data classes used for serialisation to reflect volley's preference - an immutable request that once queued can't be tampered with. + +- Reuse model class and other jvm common infrastructure + +- Optional generation of room database models, and transform methods to these from open api models +- Room and api models can be extended with additional extension properties. + +## Future improvements +- Option to generate image requests on certain conditionals e.g content-type gif etc +- Support for kotlin serialization. +- Multi part form parameters and support for file inputs + +## Usage +Hilt Dependency injection example - with default values for parameters overridden. +``` + @Provides + internal fun provideSomeApi( + context: Context, + restService: IRestService, + configurationService: IConfigurationService, + sessionService: ISessionService + ): SomeApi { + return SomeApi( + context = context, + requestQueue = restService.getRequestQueue(), + requestFactory = RequestFactory(listOf(createSessionHeaderFactory(sessionService), createTraceHeaderFactory()), + postProcessors = listOf(retryPolicySetter)), + basePath = configurationService.getBaseUrl() + ) + } +``` +Here is the constructor so you can see the defaults +```class SomeApi ( +val context: Context, +val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + val requestFactory: IRequestFactory = RequestFactory(), + val basePath: String = "https://yourbasepath.from_input_parameter.com/api", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { +``` + +### Overriding defaults +The above constructor for each api allows the following to be customized +- A custom context, so either a singleton request queue or different scope can be created - see +https://developer.android.com/training/volley/requestqueue#singleton +- An overrideable request queue - which in turn can have a custom http url stack passed to it +- An overrideable request factory constructor call, or a request factory that can be overridden by a custom template, with +custom header factory, request post processors and custom gson adapters injected. + +#### Overriding request generation +Request generation can be overridden by +- Overriding the entire request factory template +- Supplying custom header factories - methods that take any possible parameters but return a map of headers +- Supplying custom request post processors - methods that take and return the request object + +Header factory examples can be found in the auth section, as these are implemented as header factories. eg +``` +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> +{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} +} +``` +In this case it's a lambda function (a factory method) that takes an username and password, and returns a map of headers. Other +generated code will supply the username and password. In this case it results in a map of just one key/value pair, but +it could be multiple. The important part is it's returning a map - and that the surrounding code +will can bind the inputs to it at some point. + +Here is a different example that supplies tracing header values +``` +/** + * Create a lambda of tracing headers to be injected into an API's [RequestFactory]. + */ +private fun createTraceHeaderFactory(): () -> Map = { + mapOf( + HttpHeaderType.b3_traceId.rawValue to UUIDExtensions.asTraceId(UUID.randomUUID()), + HttpHeaderType.b3_spanId.rawValue to UUIDExtensions.asSpanId(UUID.randomUUID()), + HttpHeaderType.b3_sampled.rawValue to "1" + ) +} +``` +Finally a post processor example +``` + /** + * Configure a [DefaultRetryPolicy] to be injected into the [RequestFactory] with a maximum number of retries of zero. + */ + private val retryPolicySetter = { request: Request<*> -> + Unit.apply { + request.setRetryPolicy( + DefaultRetryPolicy( + RestService.DEFAULT_TIMEOUT_MS, + 0, + DefaultRetryPolicy.DEFAULT_BACKOFF_MULT + ) + ) + } + } +``` + +### Serialization +#### Gson and Polymorphic types +The GsonRequest object can be passed custom type adapters +``` +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + +``` +## Requires + +{{#jvm}} +* Kotlin 1.4.30 +* Gradle 6.8.3 +{{/jvm}} +{{#multiplatform}} +* Kotlin 1.5.10 +{{/multiplatform}} + +## Build + +{{#jvm}} +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +{{/jvm}} +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + +{{#generateApiDocs}} + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{{summary}}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} +{{/generateApiDocs}} + +{{#generateModelDocs}} + +## Documentation for Models + +{{#modelPackage}} +{{#models}}{{#model}} - [{{{modelPackage}}}.{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} +{{/modelPackage}} +{{^modelPackage}} +No model defined in this package +{{/modelPackage}} +{{/generateModelDocs}} + +{{! TODO: optional documentation for authorization? }} +## Documentation for Authorization + +{{^authMethods}} +All endpoints do not require authorization. +{{/authMethods}} +{{#authMethods}} +{{#last}} +Authentication schemes defined for the API: +{{/last}} +{{/authMethods}} +{{#authMethods}} + +### {{name}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{keyParamName}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{flow}} +- **Authorization URL**: {{authorizationUrl}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - {{scope}}: {{description}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache new file mode 100644 index 0000000000..6262fb5b53 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api.mustache @@ -0,0 +1,129 @@ +package {{apiPackage}} + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import {{packageName}}.request.IRequestFactory +import {{packageName}}.request.RequestFactory +import {{packageName}}.infrastructure.CollectionFormats.* + +{{#imports}}import {{import}} +{{/imports}} + +{{#operations}} +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class {{classname}} ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "{{{basePath}}}", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + {{#operation}} + /** + * {{summary}} + * {{notes}} + {{#allParams}} * @param {{paramName}} {{description}} + {{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}} + */ + {{#isDeprecated}} + @Deprecated("This api was deprecated") + {{/isDeprecated}} + suspend fun {{operationId}}({{^allParams}}){{/allParams}}{{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{^-last}}, {{/-last}}{{#-last}}{{#operationAuthMethod}}, opAuthHeaderFactory = () -> map{{/operationAuthMethod}}){{/-last}}{{/allParams}}: {{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit{{/returnType}} { + {{#bodyParam}} + val body: Any? = {{paramName}} + {{/bodyParam}} + {{^bodyParam}} + val body: Any? = null + {{/bodyParam}} + {{#allParams}} + {{#required}} + // verify the required parameter '{{paramName}}' is set + // This is probably taken care of by non-null types anyway + requireNotNull({{paramName}}) + {{/required}} + {{/allParams}} + + val contentTypes : Array = arrayOf({{#consumes}}"{{{mediaType}}}"{{^-last}},{{/-last}}{{/consumes}}) + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "{{{path}}}"{{#pathParams}}.replace("{" + "{{baseName}}" + "}", IRequestFactory.escapeString({{{paramName}}}.toString())){{/pathParams}}; + + // form params + val formParams = mapOf( + {{#formParams}} + "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}), + {{/formParams}} + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + {{#queryParams}} + "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}), + {{/queryParams}} + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + {{#headerParams}} + "{{baseName}}" to IRequestFactory.parameterToString({{paramName}}), + {{/headerParams}} + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}> = requestFactory.build( + Request.Method.{{httpMethod}}, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + {{/operation}} +} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache new file mode 100644 index 0000000000..f7bf73ae31 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/api_doc.mustache @@ -0,0 +1,83 @@ +# {{classname}}{{#description}} +{{description}}{{/description}} + +All URIs are relative to *{{basePath}}* + +Method | HTTP request | Description +------------- | ------------- | ------------- +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{/operation}}{{/operations}} + +{{#operations}} +{{#operation}} + +{{summary}}{{#notes}} + +{{notes}}{{/notes}} + +### Example +```kotlin +// Import classes: +//import {{{packageName}}}.* +//import {{{packageName}}}.infrastructure.* +//import {{{modelPackage}}}.* + +val apiClient = ApiClient() +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +apiClient.setCredentials("USERNAME", "PASSWORD") +{{/isBasicBasic}} +{{#isBasicBearer}} +apiClient.setBearerToken("TOKEN") +{{/isBasicBearer}} +{{/isBasic}} +{{/authMethods}} +val webService = apiClient.createWebservice({{{classname}}}::class.java) +{{#allParams}} +val {{{paramName}}} : {{{dataType}}} = {{{example}}} // {{{dataType}}} | {{{description}}} +{{/allParams}} + +{{#useCoroutines}} +launch(Dispatchers.IO) { +{{/useCoroutines}} +{{#useCoroutines}} {{/useCoroutines}}{{#returnType}}val result : {{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}} = {{/returnType}}webService.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}) +{{#useCoroutines}} +} +{{/useCoroutines}} +``` + +### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} +Name | Type | Description | Notes +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#generateModelDocs}}[**{{dataType}}**]({{baseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{dataType}}**{{/generateModelDocs}}{{/isFile}}{{/isPrimitiveType}}| {{description}} |{{^required}} [optional]{{/required}}{{#defaultValue}} [default to {{defaultValue}}]{{/defaultValue}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} +{{/allParams}} + +### Return type + +{{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}{{#generateModelDocs}}[**{{returnType}}**]({{returnBaseType}}.md){{/generateModelDocs}}{{^generateModelDocs}}**{{returnType}}**{{/generateModelDocs}}{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} + +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}} +{{#authMethods}} +{{#isBasic}} +{{#isBasicBasic}} +Configure {{name}}: + ApiClient().setCredentials("USERNAME", "PASSWORD") +{{/isBasicBasic}} +{{#isBasicBearer}} +Configure {{name}}: + ApiClient().setBearerToken("TOKEN") +{{/isBasicBearer}} +{{/isBasic}} +{{/authMethods}} + +### HTTP request headers + + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} + +{{/operation}} +{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache new file mode 100644 index 0000000000..919da64ce3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/apikeyauth.mustache @@ -0,0 +1,16 @@ + // Api Key auth supports query header and cookie. + // Query is supported in the path generation only with a hardcoded value. + // TODO: Not sure about cookie auth form + // If implementing api key in query parameter use the ^isKeyInHeader property + + val apiKeyAuthHeaderFactoryBuilder = { + paramName: String, apiKeyPrefix: String?, apiKey: String? -> { + mapOf(paramName to + if (apiKeyPrefix != null) { + "$apiKeyPrefix $apiKey" + } else { + apiKey!! + } + ) + } + } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache new file mode 100644 index 0000000000..707a8c25fe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/authentication.mustache @@ -0,0 +1,15 @@ +companion object Authentication { + // Where a header factory requires parameters a client will need to bind these + // TODO Generate appropriate header factories based on settings + {{#authMethods}} +{{#isApiKey}} +{{>auth/apikeyauth}} +{{/isApiKey}} +{{#isBasic}} +{{>auth/httpbasicauth}} +{{/isBasic}} +{{#isOAuth}} + // TODO: Oauth not implemented yet - comment out below as OAuth does not exist +{{/isOAuth}} + {{/authMethods}} + } diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache new file mode 100644 index 0000000000..f4cf1e11fe --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/httpbasicauth.mustache @@ -0,0 +1,3 @@ +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> + { mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache new file mode 100644 index 0000000000..78ffc6a2d7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/auth/oauth.mustache @@ -0,0 +1,5 @@ +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> +{ + throw NotImplementedError("OAuth security scheme header factory not impemented yet - see open api generator auth/oauth.mustache") + mapOf("" to "")} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache new file mode 100644 index 0000000000..886aecf65e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/bodyParams.mustache @@ -0,0 +1 @@ +{{#isBodyParam}}{{{paramName}}}: {{{dataType}}}{{^required}}? = null{{/required}}{{/isBodyParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache new file mode 100644 index 0000000000..341884176a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/build.mustache @@ -0,0 +1,129 @@ +{{#useAndroidMavenGradlePlugin}} +group = '{{groupId}}' +project.version = '{{artifactVersion}}' +{{/useAndroidMavenGradlePlugin}} + +buildscript { + + ext.kotlin_version = '1.5.10' + + ext.swagger_annotations_version = "1.6.2" + + ext.gson_version = "2.8.6" + + ext.volley_version = "1.2.0" + + ext.junit_version = "4.13.2" + + ext.robolectric_version = "4.5.1" + + ext.concurrent_unit_version = "0.4.6" + + repositories { + mavenLocal() + google() + maven { + url 'https://dl.google.com/dl/android/maven2' + } + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.android.tools.build:gradle:4.0.2' + {{#useAndroidMavenGradlePlugin}} + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + {{/useAndroidMavenGradlePlugin}} + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +{{#useAndroidMavenGradlePlugin}} +apply plugin: 'com.github.dcendents.android-maven' +{{/useAndroidMavenGradlePlugin}} + +android { + compileSdkVersion 30 + defaultConfig { + minSdkVersion 21 + targetSdkVersion 30 + } + compileOptions { + coreLibraryDesugaringEnabled true + {{#supportJava6}} + sourceCompatibility JavaVersion.VERSION_1_6 + targetCompatibility JavaVersion.VERSION_1_6 + {{/supportJava6}} + {{^supportJava6}} + {{#java8}} + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + {{/java8}} + {{^java8}} + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + {{/java8}} + {{/supportJava6}} + } + lintOptions { + abortOnError false + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.all { output -> + if (outputFile != null && outputFileName.endsWith('.aar')) { + outputFileName = "${archivesBaseName}-${version}.aar" + } + } + } + + testOptions { + unitTests.returnDefaultValues = true + } +} + +dependencies { + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.gson:gson:$gson_version" + implementation "com.android.volley:volley:${volley_version}" + testImplementation "junit:junit:$junit_version" + testImplementation "org.robolectric:robolectric:${robolectric_version}" + testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}" + {{#generateRoomModels}} + annotationProcessor "androidx.room:room-runtime:2.3.0" + implementation "androidx.room:room-runtime:2.3.0" + {{/generateRoomModels}} +} + +afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } +} + +{{#useAndroidMavenGradlePlugin}} +task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' +} + +artifacts { + archives sourcesJar +} +{{/useAndroidMavenGradlePlugin}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache new file mode 100644 index 0000000000..62de9c6381 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/formParams.mustache @@ -0,0 +1 @@ +{{#isFormParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache new file mode 100644 index 0000000000..8cbe627019 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/gradle.properties.mustache @@ -0,0 +1,4 @@ +{{#generateRoomModels}} +android.useAndroidX=true +android.enableJetifier=true +{{/generateRoomModels}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache new file mode 100644 index 0000000000..4226cf9b4b --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/headerParams.mustache @@ -0,0 +1 @@ +{{#isHeaderParam}}{{{paramName}}}: {{{dataType}}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}{{^required}}?{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{^defaultValue}} = null{{/defaultValue}}{{/required}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache new file mode 100644 index 0000000000..659f2df485 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/CollectionFormats.kt.mustache @@ -0,0 +1,56 @@ +package {{packageName}}.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache new file mode 100644 index 0000000000..83b5fa369a --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/infrastructure/ITransformForStorage.mustache @@ -0,0 +1,9 @@ +{{>licenseInfo}} +package {{packageName}}.infrastructure + +import {{roomModelPackage}}.* + +// TODO ITransformForStorage +interface ITransformForStorage { + fun toRoomModel(): T +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache new file mode 100644 index 0000000000..1ea918bad7 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/manifest.mustache @@ -0,0 +1,5 @@ + + + + + diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache new file mode 100644 index 0000000000..12deb9aac1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/pathParams.mustache @@ -0,0 +1 @@ +{{#isPathParam}}{{{paramName}}}: {{{dataType}}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache new file mode 100644 index 0000000000..9ab1853151 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/queryParams.mustache @@ -0,0 +1 @@ +{{#isQueryParam}}{{{paramName}}}: {{#collectionFormat}}{{#isCollectionFormatMulti}}{{{dataType}}}{{/isCollectionFormatMulti}}{{^isCollectionFormatMulti}}{{{collectionFormat.toUpperCase}}}Params{{/isCollectionFormatMulti}}{{/collectionFormat}}{{^collectionFormat}}{{{dataType}}}{{/collectionFormat}}{{^required}}? = null{{/required}}{{/isQueryParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache new file mode 100644 index 0000000000..e87f7413aa --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/GsonRequest.mustache @@ -0,0 +1,119 @@ +package {{packageName}}.request + +import com.android.volley.NetworkResponse +import com.android.volley.ParseError +import com.android.volley.Request +import com.android.volley.Response +import com.android.volley.toolbox.HttpHeaderParser +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import com.google.gson.JsonSyntaxException +import java.io.UnsupportedEncodingException +import java.nio.charset.Charset +import java.net.HttpURLConnection +import java.lang.reflect.Type +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime + +import {{packageName}}.infrastructure.OffsetDateTimeAdapter +import {{packageName}}.infrastructure.LocalDateTimeAdapter +import {{packageName}}.infrastructure.LocalDateAdapter +import {{packageName}}.infrastructure.ByteArrayAdapter + +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + .apply { + gsonAdapters?.forEach { + this.registerTypeAdapter(it.key, it.value) + } + } + + val gson: Gson by lazy { + gsonBuilder.create() + } + + private var response: NetworkResponse? = null + + override fun deliverResponse(response: T?) { + listener.onResponse(response) + } + + override fun getParams(): MutableMap? = params ?: super.getParams() + + override fun getBodyContentType(): String = contentTypeForBody ?: super.getBodyContentType() + + override fun getParamsEncoding(): String = encodingForParams ?: super.getParamsEncoding() + + override fun getHeaders(): MutableMap { + val combined = HashMap() + combined.putAll(super.getHeaders()) + if (headers != null) { + combined.putAll(headers) + } + return combined + } + + override fun getBody(): ByteArray? { + if (body != null) { + return gson.toJson(body).toByteArray(Charsets.UTF_8) + } + return super.getBody() + } + + override fun parseNetworkResponse(response: NetworkResponse?): Response { + return try { + this.response = copyTo(response) + val json = String( + response?.data ?: ByteArray(0), + Charset.forName(HttpHeaderParser.parseCharset(response?.headers)) + ) + Response.success( + gson.fromJson(json, type), + HttpHeaderParser.parseCacheHeaders(response) + ) + } catch (e: UnsupportedEncodingException) { + Response.error(ParseError(e)) + } catch (e: JsonSyntaxException) { + Response.error(ParseError(e)) + } + } + + private fun copyTo(response: NetworkResponse?): NetworkResponse { + return if (response != null) { + NetworkResponse( + response.statusCode, + response.data, + response.notModified, + response.networkTimeMs, + response.allHeaders + ) + } else { + // Return an empty response. + NetworkResponse( + HttpURLConnection.HTTP_BAD_METHOD, + ByteArray(0), + false, + 0, + emptyList() + ) + } + } +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache new file mode 100644 index 0000000000..d46fe90c62 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/IRequestFactory.mustache @@ -0,0 +1,64 @@ +package {{packageName}}.request + +import com.android.volley.Request +import com.android.volley.Response +import java.io.UnsupportedEncodingException +import java.lang.reflect.Type +import java.net.URLEncoder +import java.text.ParseException +import java.text.SimpleDateFormat +import java.util.* +import java.time.format.DateTimeFormatter +import java.time.OffsetDateTime +import java.time.LocalDate + + +interface IRequestFactory { + + companion object { + /** + * ISO 8601 date time format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime) + fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date) + + fun escapeString(str: String): String { + return try { + URLEncoder.encode(str, "UTF-8") + } catch (e: UnsupportedEncodingException) { + str + } + } + + fun parameterToString(param: Any?) = + when (param) { + null -> "" + is OffsetDateTime -> formatDateTime(param) + is Collection<*> -> { + val b = StringBuilder() + for (o in param) { + if (b.isNotEmpty()) { + b.append(",") + } + b.append(o.toString()) + } + b.toString() + } + else -> param.toString() + } + } + + + fun build( + method: Int, + url : String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener): Request +} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache new file mode 100644 index 0000000000..e9bc5d2128 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-volley/request/RequestFactory.mustache @@ -0,0 +1,69 @@ +// Knowing the details of an operation it will produce a call to a Volley Request constructor +package {{packageName}}.request + + +import com.android.volley.Request +import com.android.volley.Response +{{#hasAuthMethods}} +import android.util.Base64 +{{/hasAuthMethods}} +import {{packageName}}.request.IRequestFactory.Companion.escapeString +import java.lang.reflect.Type +import java.util.Locale +import java.util.UUID + +class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory { +{{#hasAuthMethods}} + + {{>auth/authentication}} +{{/hasAuthMethods}} + + /** + * {@inheritDoc} + */ + @Suppress("UNCHECKED_CAST") + override fun build( + method: Int, + url: String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener + ): Request { + val afterMarketHeaders = (headers?.toMutableMap() ?: mutableMapOf()) + // Factory built and aftermarket + // Merge the after market headers on top of the base ones in case we are overriding per call auth + val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() } + + // If we decide to support auth parameters in the url, then you will reference them by supplying a url string + // with known variable name refernces in the string. We will then apply + val updatedUrl = if (!queryParams.isNullOrEmpty()) { + queryParams.asSequence().fold("$url?") {acc, param -> + "$acc${escapeString(param.key)}=${escapeString(param.value)}&" + }.trimEnd('&') + } else { + url + } + + val request = GsonRequest( + method, + updatedUrl, + body, + allHeaders, + formParams?.toMutableMap(), + contentTypeForBody, + null, + gsonAdapters, + type, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + return request + } +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache new file mode 100644 index 0000000000..bb43e6bf87 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/model_room.mustache @@ -0,0 +1,38 @@ +{{>licenseInfo}} +package {{roomModelPackage}} + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import {{modelPackage}}.* + +{{#models}} +{{#model}} + +@Entity(tableName = "{{classname}}") +/** +* Room model for {{{description}}} +{{#allVars}} +* @param {{{name}}} {{{description}}} +{{/allVars}} +*/ +data class {{classname}}RoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + {{#allVars}}{{#items.isPrimitiveType}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}}, + {{/items.isPrimitiveType}}{{/allVars}} + {{#allVars}}{{^isEnum}}{{^isArray}}var {{{name}}}: {{{dataType}}}{{>model_room_init_var}}, + {{/isArray}}{{/isEnum}}{{/allVars}} + {{#allVars}}{{#isEnum}}{{^isArray}}var {{{name}}}: {{classname}}.{{{nameInCamelCase}}}{{>model_room_init_var}}, + {{/isArray}}{{/isEnum}}{{/allVars}}) { +{{#allVars}}{{#isArray}}{{#isList}}{{^items.isPrimitiveType}} + @Ignore + {{^isNullable}}{{#required}}lateinit {{/required}}{{/isNullable}}var {{{name}}}: {{#isArray}}{{#isList}}kotlin.collections.List{{/isList}}{{^isList}}kotlin.Array{{/isList}}<{{^items.isEnum}}{{^items.isPrimitiveType}}{{^items.isModel}}{{/items.isModel}}{{/items.isPrimitiveType}}{{{items.dataType}}}{{/items.isEnum}}{{#items.isEnum}}{{classname}}.{{{nameInCamelCase}}}{{/items.isEnum}}>{{>model_room_init_var}}{{/isArray}} +{{/items.isPrimitiveType}}{{/isList}}{{/isArray}}{{/allVars}} + {{^discriminator}}companion object { } + + fun toApiModel(): {{classname}} = {{classname}}( + {{#allVars}}{{name}} = this.{{name}}, + {{/allVars}}){{/discriminator}} +} +{{/model}} +{{/models}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache new file mode 100644 index 0000000000..01896d2439 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/model_room_init_var.mustache @@ -0,0 +1 @@ +{{#isNullable}}?{{/isNullable}}{{^required}}?{{/required}}{{#defaultvalue}} = {{defaultvalue}}{{/defaultvalue}}{{^defaultvalue}}{{#isNullable}} = null{{/isNullable}}{{^required}} = null{{/required}}{{/defaultvalue}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java index e82c584a4c..7c7ee64361 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java @@ -187,4 +187,14 @@ public class TestUtils { for (String line : lines) assertFalse(file.contains(linearize(line))); } + + public static void assertFileNotExists(Path path) { + try { + new String(Files.readAllBytes(path), StandardCharsets.UTF_8); + fail("File exists when it should not: " + path); + } catch (IOException e) { + // File exists, pass. + assertTrue(true); + } + } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java new file mode 100644 index 0000000000..6473e036d4 --- /dev/null +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/jvm_volley/KotlinJvmVolleyModelCodegenTest.java @@ -0,0 +1,83 @@ +package org.openapitools.codegen.kotlin.jvm_volley; + +import io.swagger.parser.OpenAPIParser; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.parser.core.models.ParseOptions; +import org.openapitools.codegen.ClientOptInput; +import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.DefaultGenerator; +import org.openapitools.codegen.languages.AbstractKotlinCodegen; +import org.openapitools.codegen.languages.KotlinClientCodegen; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static org.openapitools.codegen.TestUtils.*; + +public class KotlinJvmVolleyModelCodegenTest { + + @Test + public void modelsWithRoomModels() throws IOException { + KotlinClientCodegen codegen = new KotlinClientCodegen(); + codegen.additionalProperties().put(KotlinClientCodegen.GENERATE_ROOM_MODELS, true); + codegen.additionalProperties().put(KotlinClientCodegen.ROOM_MODEL_PACKAGE, "models.room"); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE.gson.name()); + + String outputPath = checkModel(codegen, false); + + assertFileContains(Paths.get(outputPath + "/src/main/java/models/room/BigDogRoomModel.kt"), "toApiModel()"); + assertFileContains(Paths.get(outputPath + "/src/main/java/models/BigDog.kt"), "toRoomModel()"); + } + + @Test + public void modelsWithoutRoomModels() throws IOException { + KotlinClientCodegen codegen = new KotlinClientCodegen(); + codegen.additionalProperties().put(KotlinClientCodegen.GENERATE_ROOM_MODELS, false); + codegen.additionalProperties().put(CodegenConstants.SERIALIZATION_LIBRARY, AbstractKotlinCodegen.SERIALIZATION_LIBRARY_TYPE.gson.name()); + + String outputPath = checkModel(codegen, false); + + assertFileNotExists(Paths.get(outputPath + "/src/main/java/models/room/BigDogRoomModel.kt")); + assertFileContains(Paths.get(outputPath + "/src/main/java/models/BigDog.kt")); + assertFileNotContains(Paths.get(outputPath + "/src/main/java/models/BigDog.kt"), "toRoomModel()"); + } + + private String checkModel(AbstractKotlinCodegen codegen, boolean mutable, String... props) throws IOException { + String outputPath = generateModels(codegen, "src/test/resources/3_0/generic.yaml", mutable); + assertFileContains(Paths.get(outputPath + "/src/main/java/models/Animal.kt"), props); + return outputPath; + } + + private String generateModels(AbstractKotlinCodegen codegen, String fileName, boolean mutable) throws IOException { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + OpenAPI openAPI = new OpenAPIParser() + .readLocation(fileName, null, new ParseOptions()).getOpenAPI(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.setLibrary("jvm-volley"); + + codegen.additionalProperties().put(CodegenConstants.MODEL_PACKAGE, "models"); + codegen.additionalProperties().put(AbstractKotlinCodegen.MODEL_MUTABLE, mutable); + + ClientOptInput input = new ClientOptInput() + .openAPI(openAPI) + .config(codegen); + + DefaultGenerator generator = new DefaultGenerator(); + + generator.setGeneratorPropertyDefault(CodegenConstants.MODELS, "true"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.APIS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.SUPPORTING_FILES, "true"); + + generator.opts(input).generate(); + + return outputPath; + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES new file mode 100644 index 0000000000..1de427bbcb --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/FILES @@ -0,0 +1,43 @@ +README.md +build.gradle +docs/ApiResponse.md +docs/Category.md +docs/Order.md +docs/Pet.md +docs/PetApi.md +docs/StoreApi.md +docs/Tag.md +docs/User.md +docs/UserApi.md +gradle.properties +gradle/wrapper/gradle-wrapper.jar +gradle/wrapper/gradle-wrapper.properties +gradlew +gradlew.bat +settings.gradle +src/main/AndroidManifest.xml +src/main/java/org/openapitools/client/apis/PetApi.kt +src/main/java/org/openapitools/client/apis/StoreApi.kt +src/main/java/org/openapitools/client/apis/UserApi.kt +src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/java/org/openapitools/client/models/Category.kt +src/main/java/org/openapitools/client/models/ModelApiResponse.kt +src/main/java/org/openapitools/client/models/Order.kt +src/main/java/org/openapitools/client/models/Pet.kt +src/main/java/org/openapitools/client/models/Tag.kt +src/main/java/org/openapitools/client/models/User.kt +src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt +src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt +src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt +src/main/java/org/openapitools/client/models/room/PetRoomModel.kt +src/main/java/org/openapitools/client/models/room/TagRoomModel.kt +src/main/java/org/openapitools/client/models/room/UserRoomModel.kt +src/main/java/org/openapitools/client/request/GsonRequest.kt +src/main/java/org/openapitools/client/request/IRequestFactory.kt +src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION new file mode 100644 index 0000000000..4077803655 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/README.md b/samples/client/petstore/kotlin-jvm-volley/README.md new file mode 100644 index 0000000000..9350405a0f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/README.md @@ -0,0 +1,230 @@ +# org.openapitools.client - Kotlin client library for OpenAPI Petstore + + +A kotlin client for Android using the currently recommended http client, Volley. See https://developer.android.com/training/volley + +- Currently sends GsonRequests +- Currently only supports Gson as a serializer - will throw an exception if a different serializer is chosen +- Defaults the source location to src/main/java as per standard Android builds + + +## Design + +Volley is a queue/request based layer on top of http url stack specific to Android. Android favours dependency injection and +a layered architecture, and IO performed off the main thread to maintain UI responsiveness, with a preferred technique of +kotlin co-routines. The code gen library reflects these factors. + +- Api calls use co-routines, and execute them using volley callbacks to avoid tying up a thread. +- Facilitate dependency injection, with default implementations available. +- Generate a requestFactory that can be overridden +- Allow the passing of the RequestFactory per tag (api client) or per operation (an extra parameter is created on operations with non-global security), with per operation auth overriding global security. +- DI scoping of the Request Factory and pre-generated auth header factories allow for thread safe and secure setting of credentials. +- Lazy header factories allow for refreshing tokens etc +- Factoring of header factories to the Request Factory allow ambient provision of credentials. Code gen library is credential storage agnostic. +- Header factories allow the merging of generated headers from open api spec with dynamically added headers + +- Injection of http url stack to allow custom http stacks. Default implementation is best practice singleton +- Data classes used for serialisation to reflect volley's preference - an immutable request that once queued can't be tampered with. + +- Reuse model class and other jvm common infrastructure + +- Optional generation of room database models, and transform methods to these from open api models +- Room and api models can be extended with additional extension properties. + +## Future improvements +- Option to generate image requests on certain conditionals e.g content-type gif etc +- Support for kotlin serialization. +- Multi part form parameters and support for file inputs + +## Usage +Hilt Dependency injection example - with default values for parameters overridden. +``` + @Provides + internal fun provideSomeApi( + context: Context, + restService: IRestService, + configurationService: IConfigurationService, + sessionService: ISessionService + ): SomeApi { + return SomeApi( + context = context, + requestQueue = restService.getRequestQueue(), + requestFactory = RequestFactory(listOf(createSessionHeaderFactory(sessionService), createTraceHeaderFactory()), + postProcessors = listOf(retryPolicySetter)), + basePath = configurationService.getBaseUrl() + ) + } +``` +Here is the constructor so you can see the defaults +```class SomeApi ( +val context: Context, +val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + val requestFactory: IRequestFactory = RequestFactory(), + val basePath: String = "https://yourbasepath.from_input_parameter.com/api", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { +``` + +### Overriding defaults +The above constructor for each api allows the following to be customized +- A custom context, so either a singleton request queue or different scope can be created - see +https://developer.android.com/training/volley/requestqueue#singleton +- An overrideable request queue - which in turn can have a custom http url stack passed to it +- An overrideable request factory constructor call, or a request factory that can be overridden by a custom template, with +custom header factory, request post processors and custom gson adapters injected. + +#### Overriding request generation +Request generation can be overridden by +- Overriding the entire request factory template +- Supplying custom header factories - methods that take any possible parameters but return a map of headers +- Supplying custom request post processors - methods that take and return the request object + +Header factory examples can be found in the auth section, as these are implemented as header factories. eg +``` +val basicAuthHeaderFactoryBuilder = { username: String?, password: String? -> +{ mapOf("Authorization" to "Basic " + Base64.encodeToString("${username ?: ""}:${password ?: ""}".toByteArray(), Base64.DEFAULT))} +} +``` +In this case it's a lambda function (a factory method) that takes an username and password, and returns a map of headers. Other +generated code will supply the username and password. In this case it results in a map of just one key/value pair, but +it could be multiple. The important part is it's returning a map - and that the surrounding code +will can bind the inputs to it at some point. + +Here is a different example that supplies tracing header values +``` +/** + * Create a lambda of tracing headers to be injected into an API's [RequestFactory]. + */ +private fun createTraceHeaderFactory(): () -> Map = { + mapOf( + HttpHeaderType.b3_traceId.rawValue to UUIDExtensions.asTraceId(UUID.randomUUID()), + HttpHeaderType.b3_spanId.rawValue to UUIDExtensions.asSpanId(UUID.randomUUID()), + HttpHeaderType.b3_sampled.rawValue to "1" + ) +} +``` +Finally a post processor example +``` + /** + * Configure a [DefaultRetryPolicy] to be injected into the [RequestFactory] with a maximum number of retries of zero. + */ + private val retryPolicySetter = { request: Request<*> -> + Unit.apply { + request.setRetryPolicy( + DefaultRetryPolicy( + RestService.DEFAULT_TIMEOUT_MS, + 0, + DefaultRetryPolicy.DEFAULT_BACKOFF_MULT + ) + ) + } + } +``` + +### Serialization +#### Gson and Polymorphic types +The GsonRequest object can be passed custom type adapters +``` +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + +``` +## Requires + +* Kotlin 1.4.30 +* Gradle 6.8.3 + +## Build + +First, create the gradle wrapper script: + +``` +gradle wrapper +``` + +Then, run: + +``` +./gradlew check assemble +``` + +This runs all tests and packages the library. + + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user +*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + + +## Documentation for Models + + - [org.openapitools.client.models.Category](docs/Category.md) + - [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md) + - [org.openapitools.client.models.Order](docs/Order.md) + - [org.openapitools.client.models.Pet](docs/Pet.md) + - [org.openapitools.client.models.Tag](docs/Tag.md) + - [org.openapitools.client.models.User](docs/User.md) + + + +## Documentation for Authorization + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - write:pets: modify pets in your account + - read:pets: read your pets + diff --git a/samples/client/petstore/kotlin-jvm-volley/build.gradle b/samples/client/petstore/kotlin-jvm-volley/build.gradle new file mode 100644 index 0000000000..6a369e5994 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/build.gradle @@ -0,0 +1,95 @@ + +buildscript { + + ext.kotlin_version = '1.5.10' + + ext.swagger_annotations_version = "1.6.2" + + ext.gson_version = "2.8.6" + + ext.volley_version = "1.2.0" + + ext.junit_version = "4.13.2" + + ext.robolectric_version = "4.5.1" + + ext.concurrent_unit_version = "0.4.6" + + repositories { + mavenLocal() + google() + maven { + url 'https://dl.google.com/dl/android/maven2' + } + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.android.tools.build:gradle:4.0.2' + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + compileSdkVersion 30 + defaultConfig { + minSdkVersion 21 + targetSdkVersion 30 + } + compileOptions { + coreLibraryDesugaringEnabled true + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + lintOptions { + abortOnError false + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.all { output -> + if (outputFile != null && outputFileName.endsWith('.aar')) { + outputFileName = "${archivesBaseName}-${version}.aar" + } + } + } + + testOptions { + unitTests.returnDefaultValues = true + } +} + +dependencies { + coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "io.swagger:swagger-annotations:$swagger_annotations_version" + implementation "com.google.code.gson:gson:$gson_version" + implementation "com.android.volley:volley:${volley_version}" + testImplementation "junit:junit:$junit_version" + testImplementation "org.robolectric:robolectric:${robolectric_version}" + testImplementation "net.jodah:concurrentunit:${concurrent_unit_version}" + annotationProcessor "androidx.room:room-runtime:2.3.0" + implementation "androidx.room:room-runtime:2.3.0" +} + +afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDirectory = project.file("${project.buildDir}/outputs/jar") + task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md b/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md new file mode 100644 index 0000000000..12f08d5cde --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/ApiResponse.md @@ -0,0 +1,12 @@ + +# ModelApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **kotlin.Int** | | [optional] +**type** | **kotlin.String** | | [optional] +**message** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Category.md b/samples/client/petstore/kotlin-jvm-volley/docs/Category.md new file mode 100644 index 0000000000..2c28a670fc --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Category.md @@ -0,0 +1,11 @@ + +# Category + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Order.md b/samples/client/petstore/kotlin-jvm-volley/docs/Order.md new file mode 100644 index 0000000000..94ab0d537e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Order.md @@ -0,0 +1,22 @@ + +# Order + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**petId** | **kotlin.Long** | | [optional] +**quantity** | **kotlin.Int** | | [optional] +**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] +**status** | [**inline**](#Status) | Order Status | [optional] +**complete** | **kotlin.Boolean** | | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | placed, approved, delivered + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md b/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md new file mode 100644 index 0000000000..bc3dd89718 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Pet.md @@ -0,0 +1,22 @@ + +# Pet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **kotlin.String** | | +**photoUrls** | **kotlin.collections.List<kotlin.String>** | | +**id** | **kotlin.Long** | | [optional] +**category** | [**Category**](Category.md) | | [optional] +**tags** | [**kotlin.collections.List<Tag>**](Tag.md) | | [optional] +**status** | [**inline**](#Status) | pet status in the store | [optional] + + + +## Enum: status +Name | Value +---- | ----- +status | available, pending, sold + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md new file mode 100644 index 0000000000..529441d7df --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/PetApi.md @@ -0,0 +1,320 @@ +# PetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store +[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image + + + +Add a new pet to the store + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val body : Pet = // Pet | Pet object that needs to be added to the store + +webService.addPet(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +Deletes a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete +val apiKey : kotlin.String = apiKey_example // kotlin.String | + +webService.deletePet(petId, apiKey) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| Pet id to delete | + **apiKey** | **kotlin.String**| | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val status : kotlin.collections.List = // kotlin.collections.List | Status values that need to be considered for filter + +val result : kotlin.collections.List = webService.findPetsByStatus(status) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val tags : kotlin.collections.List = // kotlin.collections.List | Tags to filter by + +val result : kotlin.collections.List = webService.findPetsByTags(tags) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**kotlin.collections.List<kotlin.String>**](kotlin.String.md)| Tags to filter by | + +### Return type + +[**kotlin.collections.List<Pet>**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Find pet by ID + +Returns a single pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return + +val result : Pet = webService.getPetById(petId) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Update an existing pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val body : Pet = // Pet | Pet object that needs to be added to the store + +webService.updatePet(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + + +Updates a pet in the store with form data + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated +val name : kotlin.String = name_example // kotlin.String | Updated name of the pet +val status : kotlin.String = status_example // kotlin.String | Updated status of the pet + +webService.updatePetWithForm(petId, name, status) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet that needs to be updated | + **name** | **kotlin.String**| Updated name of the pet | [optional] + **status** | **kotlin.String**| Updated status of the pet | [optional] + +### Return type + +null (empty response body) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + + +uploads an image + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(PetApi::class.java) +val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update +val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload + +val result : ModelApiResponse = webService.uploadFile(petId, additionalMetadata, file) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **kotlin.Long**| ID of pet to update | + **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] + **file** | **java.io.File**| file to upload | [optional] + +### Return type + +[**ModelApiResponse**](ModelApiResponse.md) + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md new file mode 100644 index 0000000000..168afd9b9c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/StoreApi.md @@ -0,0 +1,158 @@ +# StoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet + + + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted + +webService.deleteOrder(orderId) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.String**| ID of the order that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) + +val result : kotlin.collections.Map = webService.getInventory() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**kotlin.collections.Map<kotlin.String, kotlin.Int>** + +### Authorization + + + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched + +val result : Order = webService.getOrderById(orderId) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Place an order for a pet + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(StoreApi::class.java) +val body : Order = // Order | order placed for purchasing the pet + +val result : Order = webService.placeOrder(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md b/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md new file mode 100644 index 0000000000..60ce1bcdba --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/Tag.md @@ -0,0 +1,11 @@ + +# Tag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**name** | **kotlin.String** | | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/User.md b/samples/client/petstore/kotlin-jvm-volley/docs/User.md new file mode 100644 index 0000000000..e801729b5e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/User.md @@ -0,0 +1,17 @@ + +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **kotlin.Long** | | [optional] +**username** | **kotlin.String** | | [optional] +**firstName** | **kotlin.String** | | [optional] +**lastName** | **kotlin.String** | | [optional] +**email** | **kotlin.String** | | [optional] +**password** | **kotlin.String** | | [optional] +**phone** | **kotlin.String** | | [optional] +**userStatus** | **kotlin.Int** | User Status | [optional] + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md b/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md new file mode 100644 index 0000000000..b26ede4100 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/docs/UserApi.md @@ -0,0 +1,310 @@ +# UserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](UserApi.md#createUser) | **POST** /user | Create user +[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name +[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system +[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user + + + +Create user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val body : User = // User | Created user object + +webService.createUser(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**User**](User.md)| Created user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val body : kotlin.collections.List = // kotlin.collections.List | List of user object + +webService.createUsersWithArrayInput(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Creates list of users with given input array + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val body : kotlin.collections.List = // kotlin.collections.List | List of user object + +webService.createUsersWithListInput(body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**kotlin.collections.List<User>**](User.md)| List of user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Delete user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted + +webService.deleteUser(username) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be deleted | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Get user by user name + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. + +val result : User = webService.getUserByName(username) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Logs user into the system + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | The user name for login +val password : kotlin.String = password_example // kotlin.String | The password for login in clear text + +val result : kotlin.String = webService.loginUser(username, password) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| The user name for login | + **password** | **kotlin.String**| The password for login in clear text | + +### Return type + +**kotlin.String** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/xml, application/json + + +Logs out current logged in user session + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) + +webService.logoutUser() +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +Updated user + +This can only be done by the logged in user. + +### Example +```kotlin +// Import classes: +//import org.openapitools.client.* +//import org.openapitools.client.infrastructure.* +//import org.openapitools.client.models.* + +val apiClient = ApiClient() +val webService = apiClient.createWebservice(UserApi::class.java) +val username : kotlin.String = username_example // kotlin.String | name that need to be deleted +val body : User = // User | Updated user object + +webService.updateUser(username, body) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **kotlin.String**| name that need to be deleted | + **body** | [**User**](User.md)| Updated user object | + +### Return type + +null (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle.properties b/samples/client/petstore/kotlin-jvm-volley/gradle.properties new file mode 100644 index 0000000000..646c51b977 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradle.properties @@ -0,0 +1,2 @@ +android.useAndroidX=true +android.enableJetifier=true diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9-kq3!^i>^UQL`%gn6)jz54$WDmeYdsBE9;PqZ_ zoGd=P4+|(-u4U1dbAVQrFWoNgNd;0nrghPFbQrJctO>nwDdI`Q^i0XJDUYm|T|RWc zZ3^Qgo_Qk$%Fvjj-G}1NB#ZJqIkh;kX%V{THPqOyiq)d)0+(r9o(qKlSp*hmK#iIY zA^)Vr$-Hz<#SF=0@tL@;dCQsm`V9s1vYNq}K1B)!XSK?=I1)tX+bUV52$YQu*0%fnWEukW>mxkz+%3-S!oguE8u#MGzST8_Dy^#U?fA@S#K$S@9msUiX!gd_ow>08w5)nX{-KxqMOo7d?k2&?Vf z&diGDtZr(0cwPe9z9FAUSD9KC)7(n^lMWuayCfxzy8EZsns%OEblHFSzP=cL6}?J| z0U$H!4S_TVjj<`6dy^2j`V`)mC;cB%* z8{>_%E1^FH!*{>4a7*C1v>~1*@TMcLK{7nEQ!_igZC}ikJ$*<$yHy>7)oy79A~#xE zWavoJOIOC$5b6*q*F_qN1>2#MY)AXVyr$6x4b=$x^*aqF*L?vmj>Mgv+|ITnw_BoW zO?jwHvNy^prH{9$rrik1#fhyU^MpFqF2fYEt(;4`Q&XWOGDH8k6M=%@fics4ajI;st# zCU^r1CK&|jzUhRMv;+W~6N;u<;#DI6cCw-otsc@IsN3MoSD^O`eNflIoR~l4*&-%RBYk@gb^|-JXs&~KuSEmMxB}xSb z@K76cXD=Y|=I&SNC2E+>Zg?R6E%DGCH5J1nU!A|@eX9oS(WPaMm==k2s_ueCqdZw| z&hqHp)47`c{BgwgvY2{xz%OIkY1xDwkw!<0veB#yF4ZKJyabhyyVS`gZepcFIk%e2 zTcrmt2@-8`7i-@5Nz>oQWFuMC_KlroCl(PLSodswHqJ3fn<;gxg9=}~3x_L3P`9Sn zChIf}8vCHvTriz~T2~FamRi?rh?>3bX1j}%bLH+uFX+p&+^aXbOK7clZxdU~6Uxgy z8R=obwO4dL%pmVo*Ktf=lH6hnlz_5k3cG;m8lgaPp~?eD!Yn2kf)tU6PF{kLyn|oI@eQ`F z3IF7~Blqg8-uwUuWZScRKn%c2_}dXB6Dx_&xR*n9M9LXasJhtZdr$vBY!rP{c@=)& z#!?L$2UrkvClwQO>U*fSMs67oSj2mxiJ$t;E|>q%Kh_GzzWWO&3;ufU%2z%ucBU8H z3WIwr$n)cfCXR&>tyB7BcSInK>=ByZA%;cVEJhcg<#6N{aZC4>K41XF>ZgjG`z_u& zGY?;Ad?-sgiOnI`oppF1o1Gurqbi*;#x2>+SSV6|1^G@ooVy@fg?wyf@0Y!UZ4!}nGuLeC^l)6pwkh|oRY`s1Pm$>zZ3u-83T|9 zGaKJIV3_x+u1>cRibsaJpJqhcm%?0-L;2 zitBrdRxNmb0OO2J%Y&Ym(6*`_P3&&5Bw157{o7LFguvxC$4&zTy#U=W*l&(Q2MNO} zfaUwYm{XtILD$3864IA_nn34oVa_g^FRuHL5wdUd)+W-p-iWCKe8m_cMHk+=? zeKX)M?Dt(|{r5t7IenkAXo%&EXIb-i^w+0CX0D=xApC=|Xy(`xy+QG^UyFe z+#J6h_&T5i#sV)hj3D4WN%z;2+jJcZxcI3*CHXGmOF3^)JD5j&wfX)e?-|V0GPuA+ zQFot%aEqGNJJHn$!_}#PaAvQ^{3-Ye7b}rWwrUmX53(|~i0v{}G_sI9uDch_brX&6 zWl5Ndj-AYg(W9CGfQf<6!YmY>Ey)+uYd_JNXH=>|`OH-CDCmcH(0%iD_aLlNHKH z7bcW-^5+QV$jK?R*)wZ>r9t}loM@XN&M-Pw=F#xn(;u3!(3SXXY^@=aoj70;_=QE9 zGghsG3ekq#N||u{4We_25U=y#T*S{4I{++Ku)> zQ!DZW;pVcn>b;&g2;YE#+V`v*Bl&Y-i@X6D*OpNA{G@JAXho&aOk(_j^weW{#3X5Y z%$q_wpb07EYPdmyH(1^09i$ca{O<}7) zRWncXdSPgBE%BM#by!E>tdnc$8RwUJg1*x($6$}ae$e9Knj8gvVZe#bLi!<+&BkFj zg@nOpDneyc+hU9P-;jmOSMN|*H#>^Ez#?;%C3hg_65leSUm;iz)UkW)jX#p)e&S&M z1|a?wDzV5NVnlhRBCd_;F87wp>6c<&nkgvC+!@KGiIqWY4l}=&1w7|r6{oBN8xyzh zG$b#2=RJp_iq6)#t5%yLkKx(0@D=C3w+oiXtSuaQ%I1WIb-eiE$d~!)b@|4XLy!CZ z9p=t=%3ad@Ep+<9003D2KZ5VyP~_n$=;~r&YUg5UZ0KVD&tR1DHy9x)qWtKJp#Kq# zP*8p#W(8JJ_*h_3W}FlvRam?<4Z+-H77^$Lvi+#vmhL9J zJ<1SV45xi;SrO2f=-OB(7#iNA5)x1uNC-yNxUw|!00vcW2PufRm>e~toH;M0Q85MQLWd?3O{i8H+5VkR@l9Dg-ma ze2fZ%>G(u5(k9EHj2L6!;(KZ8%8|*-1V|B#EagbF(rc+5iL_5;Eu)L4Z-V;0HfK4d z*{utLse_rvHZeQ>V5H=f78M3Ntg1BPxFCVD{HbNA6?9*^YIq;B-DJd{Ca2L#)qWP? zvX^NhFmX?CTWw&Ns}lgs;r3i+Bq@y}Ul+U%pzOS0Fcv9~aB(0!>GT0)NO?p=25LjN z2bh>6RhgqD7bQj#k-KOm@JLgMa6>%-ok1WpOe)FS^XOU{c?d5shG(lIn3GiVBxmg`u%-j=)^v&pX1JecJics3&jvPI)mDut52? z3jEA)DM%}BYbxxKrizVYwq?(P&19EXlwD9^-6J+4!}9{ywR9Gk42jjAURAF&EO|~N z)?s>$Da@ikI4|^z0e{r`J8zIs>SpM~Vn^{3fArRu;?+43>lD+^XtUcY1HidJwnR6+ z!;oG2=B6Z_=M%*{z-RaHc(n|1RTKQdNjjV!Pn9lFt^4w|AeN06*j}ZyhqZ^!-=cyGP_ShV1rGxkx8t zB;8`h!S{LD%ot``700d0@Grql(DTt4Awgmi+Yr0@#jbe=2#UkK%rv=OLqF)9D7D1j z!~McAwMYkeaL$~kI~90)5vBhBzWYc3Cj1WI0RS`z000R8-@ET0dA~*r(gSiCJmQMN&4%1D zyVNf0?}sBH8zNbBLn>~(W{d3%@kL_eQ6jEcR{l>C|JK z(R-fA!z|TTRG40|zv}7E@PqCAXP3n`;%|SCQ|ZS%ym$I{`}t3KPL&^l5`3>yah4*6 zifO#{VNz3)?ZL$be;NEaAk9b#{tV?V7 zP|wf5YA*1;s<)9A4~l3BHzG&HH`1xNr#%){4xZ!jq%o=7nN*wMuXlFV{HaiQLJ`5G zBhDi#D(m`Q1pLh@Tq+L;OwuC52RdW7b8}~60WCOK5iYMUad9}7aWBuILb({5=z~YF zt?*Jr5NG+WadM{mDL>GyiByCuR)hd zA=HM?J6l1Xv0Dl+LW@w$OTcEoOda^nFCw*Sy^I@$sSuneMl{4ys)|RY#9&NxW4S)9 zq|%83IpslTLoz~&vTo!Ga@?rj_kw{|k{nv+w&Ku?fyk4Ki4I?);M|5Axm)t+BaE)D zm(`AQ#k^DWrjbuXoJf2{Aj^KT zFb1zMSqxq|vceV+Mf-)$oPflsO$@*A0n0Z!R{&(xh8s}=;t(lIy zv$S8x>m;vQNHuRzoaOo?eiWFe{0;$s`Bc+Osz~}Van${u;g(su`3lJ^TEfo~nERfP z)?aFzpDgnLYiERsKPu|0tq4l2wT)Atr6Qb%m-AUn6HnCue*yWICp7TjW$@sO zm5rm4aTcPQ(rfi7a`xP7cKCFrJD}*&_~xgLyr^-bmsL}y;A5P|al8J3WUoBSjqu%v zxC;mK!g(7r6RRJ852Z~feoC&sD3(6}^5-uLK8o)9{8L_%%rItZK9C){UxB|;G>JbP zsRRtS4-3B*5c+K2kvmgZK8472%l>3cntWUOVHxB|{Ay~aOg5RN;{PJgeVD*H%ac+y!h#wi%o2bF2Ca8IyMyH{>4#{E_8u^@+l-+n=V}Sq?$O z{091@v%Bd*3pk0^2UtiF9Z+(a@wy6 zUdw8J*ze$K#=$48IBi1U%;hmhO>lu!uU;+RS}p&6@rQila7WftH->*A4=5W|Fmtze z)7E}jh@cbmr9iup^i%*(uF%LG&!+Fyl@LFA-}Ca#bxRfDJAiR2dt6644TaYw1Ma79 zt8&DYj31j^5WPNf5P&{)J?WlCe@<3u^78wnd(Ja4^a>{^Tw}W>|Cjt^If|7l^l)^Q zbz|7~CF(k_9~n|h;ysZ+jHzkXf(*O*@5m zLzUmbHp=x!Q|!9NVXyipZ3)^GuIG$k;D)EK!a5=8MFLI_lpf`HPKl=-Ww%z8H_0$j ztJ||IfFG1lE9nmQ0+jPQy zCBdKkjArH@K7jVcMNz);Q(Q^R{d5G?-kk;Uu_IXSyWB)~KGIizZL(^&qF;|1PI7!E zTP`%l)gpX|OFn&)M%txpQ2F!hdA~hX1Cm5)IrdljqzRg!f{mN%G~H1&oqe`5eJCIF zHdD7O;AX-{XEV(a`gBFJ9ews#CVS2y!&>Cm_dm3C8*n3MA*e67(WC?uP@8TXuMroq z{#w$%z@CBIkRM7?}Xib+>hRjy?%G!fiw8! z8(gB+8J~KOU}yO7UGm&1g_MDJ$IXS!`+*b*QW2x)9>K~Y*E&bYMnjl6h!{17_8d!%&9D`a7r&LKZjC<&XOvTRaKJ1 zUY@hl5^R&kZl3lU3njk`3dPzxj$2foOL26r(9zsVF3n_F#v)s5vv3@dgs|lP#eylq62{<-vczqP!RpVBTgI>@O6&sU>W|do17+#OzQ7o5A$ICH z?GqwqnK^n2%LR;$^oZM;)+>$X3s2n}2jZ7CdWIW0lnGK-b#EG01)P@aU`pg}th&J-TrU`tIpb5t((0eu|!u zQz+3ZiOQ^?RxxK4;zs=l8q!-n7X{@jSwK(iqNFiRColuEOg}!7cyZi`iBX4g1pNBj zAPzL?P^Ljhn;1$r8?bc=#n|Ed7wB&oHcw()&*k#SS#h}jO?ZB246EGItsz*;^&tzp zu^YJ0=lwsi`eP_pU8}6JA7MS;9pfD;DsSsLo~ogzMNP70@@;Fm8f0^;>$Z>~}GWRw!W5J3tNX*^2+1f3hz{~rIzJo z6W%J(H!g-eI_J1>0juX$X4Cl6i+3wbc~k146UIX&G22}WE>0ga#WLsn9tY(&29zBvH1$`iWtTe zG2jYl@P!P)eb<5DsR72BdI7-zP&cZNI{7q3e@?N8IKc4DE#UVr->|-ryuJXk^u^>4 z$3wE~=q390;XuOQP~TNoDR?#|NSPJ%sTMInA6*rJ%go|=YjGe!B>z6u$IhgQSwoV* zjy3F2#I>uK{42{&IqP59)Y(1*Z>>#W8rCf4_eVsH)`v!P#^;BgzKDR`ARGEZzkNX+ zJUQu=*-ol=Xqqt5=`=pA@BIn@6a9G8C{c&`i^(i+BxQO9?YZ3iu%$$da&Kb?2kCCo zo7t$UpSFWqmydXf@l3bVJ=%K?SSw)|?srhJ-1ZdFu*5QhL$~-IQS!K1s@XzAtv6*Y zl8@(5BlWYLt1yAWy?rMD&bwze8bC3-GfNH=p zynNFCdxyX?K&G(ZZ)afguQ2|r;XoV^=^(;Cku#qYn4Lus`UeKt6rAlFo_rU`|Rq z&G?~iWMBio<78of-2X(ZYHx~=U0Vz4btyXkctMKdc9UM!vYr~B-(>)(Hc|D zMzkN4!PBg%tZoh+=Gba!0++d193gbMk2&krfDgcbx0jI92cq?FFESVg0D$>F+bil} zY~$)|>1HZsX=5sAZ2WgPB5P=8X#TI+NQ(M~GqyVB53c6IdX=k>Wu@A0Svf5#?uHaF zsYn|koIi3$(%GZ2+G+7Fv^lHTb#5b8sAHSTnL^qWZLM<(1|9|QFw9pnRU{svj}_Al zL)b9>fN{QiA($8peNEJyy`(a{&uh-T4_kdZFIVsKKVM(?05}76EEz?#W za^fiZOAd14IJ4zLX-n7Lq0qlQ^lW8Cvz4UKkV9~P}>sq0?xD3vg+$4vLm~C(+ zM{-3Z#qnZ09bJ>}j?6ry^h+@PfaD7*jZxBEY4)UG&daWb??6)TP+|3#Z&?GL?1i+280CFsE|vIXQbm| zM}Pk!U`U5NsNbyKzkrul-DzwB{X?n3E6?TUHr{M&+R*2%yOiXdW-_2Yd6?38M9Vy^ z*lE%gA{wwoSR~vN0=no}tP2Ul5Gk5M(Xq`$nw#ndFk`tcpd5A=Idue`XZ!FS>Q zG^0w#>P4pPG+*NC9gLP4x2m=cKP}YuS!l^?sHSFftZy{4CoQrb_ z^20(NnG`wAhMI=eq)SsIE~&Gp9Ne0nD4%Xiu|0Fj1UFk?6avDqjdXz{O1nKao*46y zT8~iA%Exu=G#{x=KD;_C&M+Zx4+n`sHT>^>=-1YM;H<72k>$py1?F3#T1*ef9mLZw z5naLQr?n7K;2l+{_uIw*_1nsTn~I|kkCgrn;|G~##hM;9l7Jy$yJfmk+&}W@JeKcF zx@@Woiz8qdi|D%aH3XTx5*wDlbs?dC1_nrFpm^QbG@wM=i2?Zg;$VK!c^Dp8<}BTI zyRhAq@#%2pGV49*Y5_mV4+OICP|%I(dQ7x=6Ob}>EjnB_-_18*xrY?b%-yEDT(wrO z9RY2QT0`_OpGfMObKHV;QLVnrK%mc?$WAdIT`kJQT^n%GuzE7|9@k3ci5fYOh(287 zuIbg!GB3xLg$YN=n)^pHGB0jH+_iIiC=nUcD;G6LuJsjn2VI1cyZx=a?ShCsF==QK z;q~*m&}L<-cb+mDDXzvvrRsybcgQ;Vg21P(uLv5I+eGc7o7tc6`;OA9{soHFOz zT~2?>Ts}gprIX$wRBb4yE>ot<8+*Bv`qbSDv*VtRi|cyWS>)Fjs>fkNOH-+PX&4(~ z&)T8Zam2L6puQl?;5zg9h<}k4#|yH9czHw;1jw-pwBM*O2hUR6yvHATrI%^mvs9q_ z&ccT0>f#eDG<^WG^q@oVqlJrhxH)dcq2cty@l3~|5#UDdExyXUmLQ}f4#;6fI{f^t zDCsgIJ~0`af%YR%Ma5VQq-p21k`vaBu6WE?66+5=XUd%Ay%D$irN>5LhluRWt7 zov-=f>QbMk*G##&DTQyou$s7UqjjW@k6=!I@!k+S{pP8R(2=e@io;N8E`EOB;OGoI zw6Q+{X1_I{OO0HPpBz!X!@`5YQ2)t{+!?M_iH25X(d~-Zx~cXnS9z>u?+If|iNJbx zyFU2d1!ITX64D|lE0Z{dLRqL1Ajj=CCMfC4lD3&mYR_R_VZ>_7_~|<^o*%_&jevU+ zQ4|qzci=0}Jydw|LXLCrOl1_P6Xf@c0$ieK2^7@A9UbF{@V_0p%lqW|L?5k>bVM8|p5v&2g;~r>B8uo<4N+`B zH{J)h;SYiIVx@#jI&p-v3dwL5QNV1oxPr8J%ooezTnLW>i*3Isb49%5i!&ac_dEXv zvXmVUck^QHmyrF8>CGXijC_R-y(Qr{3Zt~EmW)-nC!tiH`wlw5D*W7Pip;T?&j%kX z6DkZX4&}iw>hE(boLyjOoupf6JpvBG8}jIh!!VhnD0>}KSMMo{1#uU6kiFcA04~|7 zVO8eI&x1`g4CZ<2cYUI(n#wz2MtVFHx47yE5eL~8bot~>EHbevSt}LLMQX?odD{Ux zJMnam{d)W4da{l7&y-JrgiU~qY3$~}_F#G7|MxT)e;G{U`In&?`j<5D->}cb{}{T(4DF0BOk-=1195KB-E*o@c?`>y#4=dMtYtSY=&L{!TAjFVcq0y@AH`vH! z$41+u!Ld&}F^COPgL(EE{0X7LY&%D7-(?!kjFF7=qw<;`V{nwWBq<)1QiGJgUc^Vz ztMUlq1bZqKn17|6x6iAHbWc~l1HcmAxr%$Puv!znW)!JiukwIrqQ00|H$Z)OmGG@= zv%A8*4cq}(?qn4rN6o`$Y))(MyXr8R<2S^J+v(wmFmtac!%VOfN?&(8Nr!T@kV`N; z*Q33V3t`^rN&aBiHet)18wy{*wi1=W!B%B-Q6}SCrUl$~Hl{@!95ydml@FK8P=u4s z4e*7gV2s=YxEvskw2Ju!2%{8h01rx-3`NCPc(O zH&J0VH5etNB2KY6k4R@2Wvl^Ck$MoR3=)|SEclT2ccJ!RI9Nuter7u9@;sWf-%um;GfI!=eEIQ2l2p_YWUd{|6EG ze{yO6;lMc>;2tPrsNdi@&1K6(1;|$xe8vLgiouj%QD%gYk`4p{Ktv9|j+!OF-P?@p z;}SV|oIK)iwlBs+`ROXkhd&NK zzo__r!B>tOXpBJMDcv!Mq54P+n4(@dijL^EpO1wdg~q+!DT3lB<>9AANSe!T1XgC=J^)IP0XEZ()_vpu!!3HQyJhwh?r`Ae%Yr~b% zO*NY9t9#qWa@GCPYOF9aron7thfWT`eujS4`t2uG6)~JRTI;f(ZuoRQwjZjp5Pg34 z)rp$)Kr?R+KdJ;IO;pM{$6|2y=k_siqvp%)2||cHTe|b5Ht8&A{wazGNca zX$Ol?H)E_R@SDi~4{d-|8nGFhZPW;Cts1;08TwUvLLv&_2$O6Vt=M)X;g%HUr$&06 zISZb(6)Q3%?;3r~*3~USIg=HcJhFtHhIV(siOwV&QkQe#J%H9&E21!C*d@ln3E@J* zVqRO^<)V^ky-R|%{(9`l-(JXq9J)1r$`uQ8a}$vr9E^nNiI*thK8=&UZ0dsFN_eSl z(q~lnD?EymWLsNa3|1{CRPW60>DSkY9YQ;$4o3W7Ms&@&lv9eH!tk~N&dhqX&>K@} zi1g~GqglxkZ5pEFkllJ)Ta1I^c&Bt6#r(QLQ02yHTaJB~- zCcE=5tmi`UA>@P=1LBfBiqk)HB4t8D?02;9eXj~kVPwv?m{5&!&TFYhu>3=_ zsGmYZ^mo*-j69-42y&Jj0cBLLEulNRZ9vXE)8~mt9C#;tZs;=#M=1*hebkS;7(aGf zcs7zH(I8Eui9UU4L--))yy`&d&$In&VA2?DAEss4LAPCLd>-$i?lpXvn!gu^JJ$(DoUlc6wE98VLZ*z`QGQov5l4Fm_h?V-;mHLYDVOwKz7>e4+%AzeO>P6v}ndPW| zM>m#6Tnp7K?0mbK=>gV}=@k*0Mr_PVAgGMu$j+pWxzq4MAa&jpCDU&-5eH27Iz>m^ zax1?*HhG%pJ((tkR(V(O(L%7v7L%!_X->IjS3H5kuXQT2!ow(;%FDE>16&3r){!ex zhf==oJ!}YU89C9@mfDq!P3S4yx$aGB?rbtVH?sHpg?J5C->!_FHM%Hl3#D4eplxzQ zRA+<@LD%LKSkTk2NyWCg7u=$%F#;SIL44~S_OGR}JqX}X+=bc@swpiClB`Zbz|f!4 z7Ysah7OkR8liXfI`}IIwtEoL}(URrGe;IM8%{>b1SsqXh)~w}P>yiFRaE>}rEnNkT z!HXZUtxUp1NmFm)Dm@-{FI^aRQqpSkz}ZSyKR%Y}YHNzBk)ZIp} zMtS=aMvkgWKm9&oTcU0?S|L~CDqA+sHpOxwnswF-fEG)cXCzUR?ps@tZa$=O)=L+5 zf%m58cq8g_o}3?Bhh+c!w4(7AjxwQ3>WnVi<{{38g7yFboo>q|+7qs<$8CPXUFAN< zG&}BHbbyQ5n|qqSr?U~GY{@GJ{(Jny{bMaOG{|IkUj7tj^9pa9|FB_<+KHLxSxR;@ zHpS$4V)PP+tx}22fWx(Ku9y+}Ap;VZqD0AZW4gCDTPCG=zgJmF{|x;(rvdM|2|9a}cex6xrMkERnkE;}jvU-kmzd%_J50$M`lIPCKf+^*zL=@LW`1SaEc%=m zQ+lT06Gw+wVwvQ9fZ~#qd430v2HndFsBa9WjD0P}K(rZYdAt^5WQIvb%D^Q|pkVE^ zte$&#~zmULFACGfS#g=2OLOnIf2Of-k!(BIHjs77nr!5Q1*I9 z1%?=~#Oss!rV~?-6Gm~BWJiA4mJ5TY&iPm_$)H1_rTltuU1F3I(qTQ^U$S>%$l z)Wx1}R?ij0idp@8w-p!Oz{&*W;v*IA;JFHA9%nUvVDy7Q8woheC#|8QuDZb-L_5@R zOqHwrh|mVL9b=+$nJxM`3eE{O$sCt$UK^2@L$R(r^-_+z?lOo+me-VW=Zw z-Bn>$4ovfWd%SPY`ab-u9{INc*k2h+yH%toDHIyqQ zO68=u`N}RIIs7lsn1D){)~%>ByF<>i@qFb<-axvu(Z+6t7v<^z&gm9McRB~BIaDn$ z#xSGT!rzgad8o>~kyj#h1?7g96tOcCJniQ+*#=b7wPio>|6a1Z?_(TS{)KrPe}(8j z!#&A=k(&Pj^F;r)CI=Z{LVu>uj!_W1q4b`N1}E(i%;BWjbEcnD=mv$FL$l?zS6bW!{$7j1GR5ocn94P2u{ z70tAAcpqtQo<@cXw~@i-@6B23;317|l~S>CB?hR5qJ%J3EFgyBdJd^fHZu7AzHF(BQ!tyAz^L0`X z23S4Fe{2X$W0$zu9gm%rg~A>ijaE#GlYlrF9$ds^QtaszE#4M(OLVP2O-;XdT(XIC zatwzF*)1c+t~c{L=fMG8Z=k5lv>U0;C{caN1NItnuSMp)6G3mbahu>E#sj&oy94KC zpH}8oEw{G@N3pvHhp{^-YaZeH;K+T_1AUv;IKD<=mv^&Ueegrb!yf`4VlRl$M?wsl zZyFol(2|_QM`e_2lYSABpKR{{NlxlDSYQNkS;J66aT#MSiTx~;tUmvs-b*CrR4w=f z8+0;*th6kfZ3|5!Icx3RV11sp=?`0Jy3Fs0N4GZQMN=8HmT6%x9@{Dza)k}UwL6JT zHRDh;%!XwXr6yuuy`4;Xsn0zlR$k%r%9abS1;_v?`HX_hI|+EibVnlyE@3aL5vhQq zlIG?tN^w@0(v9M*&L+{_+RQZw=o|&BRPGB>e5=ys7H`nc8nx)|-g;s7mRc7hg{GJC zAe^vCIJhajmm7C6g! zL&!WAQ~5d_5)00?w_*|*H>3$loHrvFbitw#WvLB!JASO?#5Ig5$Ys10n>e4|3d;tS zELJ0|R4n3Az(Fl3-r^QiV_C;)lQ1_CW{5bKS15U|E9?ZgLec@%kXr84>5jV2a5v=w z?pB1GPdxD$IQL4)G||B_lI+A=08MUFFR4MxfGOu07vfIm+j=z9tp~5i_6jb`tR>qV z$#`=BQ*jpCjm$F0+F)L%xRlnS%#&gro6PiRfu^l!EVan|r3y}AHJQOORGx4~ z&<)3=K-tx518DZyp%|!EqpU!+X3Et7n2AaC5(AtrkW>_57i}$eqs$rupubg0a1+WO zGHZKLN2L0D;ab%{_S1Plm|hx8R?O14*w*f&2&bB050n!R2by zw!@XOQx$SqZ5I<(Qu$V6g>o#A!JVwErWv#(Pjx=KeS0@hxr4?13zj#oWwPS(7Ro|v z>Mp@Kmxo79q|}!5qtX2-O@U&&@6s~!I&)1WQIl?lTnh6UdKT_1R640S4~f=_xoN3- zI+O)$R@RjV$F=>Ti7BlnG1-cFKCC(t|Qjm{SalS~V-tX#+2ekRhwmN zZr`8{QF6y~Z!D|{=1*2D-JUa<(1Z=;!Ei!KiRNH?o{p5o3crFF=_pX9O-YyJchr$~ zRC`+G+8kx~fD2k*ZIiiIGR<8r&M@3H?%JVOfE>)})7ScOd&?OjgAGT@WVNSCZ8N(p zuQG~76GE3%(%h1*vUXg$vH{ua0b`sQ4f0*y=u~lgyb^!#CcPJa2mkSEHGLsnO^kb$ zru5_l#nu=Y{rSMWiYx?nO{8I!gH+?wEj~UM?IrG}E|bRIBUM>UlY<`T1EHpRr36vv zBi&dG8oxS|J$!zoaq{+JpJy+O^W(nt*|#g32bd&K^w-t>!Vu9N!k9eA8r!Xc{utY> zg9aZ(D2E0gL#W0MdjwES-7~Wa8iubPrd?8-$C4BP?*wok&O8+ykOx{P=Izx+G~hM8 z*9?BYz!T8~dzcZr#ux8kS7u7r@A#DogBH8km8Ry4slyie^n|GrTbO|cLhpqgMdsjX zJ_LdmM#I&4LqqsOUIXK8gW;V0B(7^$y#h3h>J0k^WJfAMeYek%Y-Dcb_+0zPJez!GM zAmJ1u;*rK=FNM0Nf}Y!!P9c4)HIkMnq^b;JFd!S3?_Qi2G#LIQ)TF|iHl~WKK6JmK zbv7rPE6VkYr_%_BT}CK8h=?%pk@3cz(UrZ{@h40%XgThP*-Oeo`T0eq9 zA8BnWZKzCy5e&&_GEsU4*;_k}(8l_&al5K-V*BFM=O~;MgRkYsOs%9eOY6s6AtE*<7GQAR2ulC3RAJrG_P1iQK5Z~&B z&f8X<>yJV6)oDGIlS$Y*D^Rj(cszTy5c81a5IwBr`BtnC6_e`ArI8CaTX_%rx7;cn zR-0?J_LFg*?(#n~G8cXut(1nVF0Oka$A$1FGcERU<^ggx;p@CZc?3UB41RY+wLS`LWFNSs~YP zuw1@DNN3lTd|jDL7gjBsd9}wIw}4xT2+8dBQzI00m<@?c2L%>}QLfK5%r!a-iII`p zX@`VEUH)uj^$;7jVUYdADQ2k*!1O3WdfgF?OMtUXNpQ1}QINamBTKDuv19^{$`8A1 zeq%q*O0mi@(%sZU>Xdb0Ru96CFqk9-L3pzLVsMQ`Xpa~N6CR{9Rm2)A|CI21L(%GW zh&)Y$BNHa=FD+=mBw3{qTgw)j0b!Eahs!rZnpu)z!!E$*eXE~##yaXz`KE5(nQM`s zD!$vW9XH)iMxu9R>r$VlLk9oIR%HxpUiW=BK@4U)|1WNQ=mz9a z^!KkO=>GaJ!GBXm{KJj^;kh-MkUlEQ%lza`-G&}C5y1>La1sR6hT=d*NeCnuK%_LV zOXt$}iP6(YJKc9j-Fxq~*ItVUqljQ8?oaysB-EYtFQp9oxZ|5m0^Hq(qV!S+hq#g( z?|i*H2MIr^Kxgz+3vIljQ*Feejy6S4v~jKEPTF~Qhq!(ms5>NGtRgO5vfPPc4Z^AM zTj!`5xEreIN)vaNxa|q6qWdg>+T`Ol0Uz)ckXBXEGvPNEL3R8hB3=C5`@=SYgAju1 z!)UBr{2~=~xa{b8>x2@C7weRAEuatC)3pkRhT#pMPTpSbA|tan%U7NGMvzmF?c!V8 z=pEWxbdXbTAGtWTyI?Fml%lEr-^AE}w#l(<7OIw;ctw}imYax&vR4UYNJZK6P7ZOd zP87XfhnUHxCUHhM@b*NbTi#(-8|wcv%3BGNs#zRCVV(W?1Qj6^PPQa<{yaBwZ`+<`w|;rqUY_C z&AeyKwwf*q#OW-F()lir=T^<^wjK65Lif$puuU5+tk$;e_EJ;Lu+pH>=-8=PDhkBg z8cWt%@$Sc#C6F$Vd+0507;{OOyT7Hs%nKS88q-W!$f~9*WGBpHGgNp}=C*7!RiZ5s zn1L_DbKF@B8kwhDiLKRB@lsXVVLK|ph=w%_`#owlf@s@V(pa`GY$8h%;-#h@TsO|Y8V=n@*!Rog7<7Cid%apR|x zOjhHCyfbIt%+*PCveTEcuiDi%Wx;O;+K=W?OFUV%)%~6;gl?<0%)?snDDqIvkHF{ zyI02)+lI9ov42^hL>ZRrh*HhjF9B$A@=H94iaBESBF=eC_KT$8A@uB^6$~o?3Wm5t1OIaqF^~><2?4e3c&)@wKn9bD? zoeCs;H>b8DL^F&>Xw-xjZEUFFTv>JD^O#1E#)CMBaG4DX9bD(Wtc8Rzq}9soQ8`jf zeSnHOL}<+WVSKp4kkq&?SbETjq6yr@4%SAqOG=9E(3YeLG9dtV+8vmzq+6PFPk{L; z(&d++iu=^F%b+ea$i2UeTC{R*0Isk;vFK!no<;L+(`y`3&H-~VTdKROkdyowo1iqR zbVW(3`+(PQ2>TKY>N!jGmGo7oeoB8O|P_!Ic@ zZ^;3dnuXo;WJ?S+)%P>{Hcg!Jz#2SI(s&dY4QAy_vRlmOh)QHvs_7c&zkJCmJGVvV zX;Mtb>QE+xp`KyciG$Cn*0?AK%-a|=o!+7x&&yzHQOS>8=B*R=niSnta^Pxp1`=md z#;$pS$4WCT?mbiCYU?FcHGZ#)kHVJTTBt^%XE(Q};aaO=Zik0UgLcc0I(tUpt(>|& zcxB_|fxCF7>&~5eJ=Dpn&5Aj{A^cV^^}(7w#p;HG&Q)EaN~~EqrE1qKrMAc&WXIE;>@<&)5;gD2?={Xf@Mvn@OJKw=8Mgn z!JUFMwD+s==JpjhroT&d{$kQAy%+d`a*XxDEVxy3`NHzmITrE`o!;5ClXNPb4t*8P zzAivdr{j_v!=9!^?T3y?gzmqDWX6mkzhIzJ-3S{T5bcCFMr&RPDryMcdwbBuZbsgN zGrp@^i?rcfN7v0NKGzDPGE#4yszxu=I_`MI%Z|10nFjU-UjQXXA?k8Pk|OE<(?ae) zE%vG#eZAlj*E7_3dx#Zz4kMLj>H^;}33UAankJiDy5ZvEhrjr`!9eMD8COp}U*hP+ zF}KIYx@pkccIgyxFm#LNw~G&`;o&5)2`5aogs`1~7cMZQ7zj!%L4E`2yzlQN6REX20&O<9 zKV6fyr)TScJPPzNTC2gL+0x#=u>(({{D7j)c-%tvqls3#Y?Z1m zV5WUE)zdJ{$p>yX;^P!UcXP?UD~YM;IRa#Rs5~l+*$&nO(;Ers`G=0D!twR(0GF@c zHl9E5DQI}Oz74n zfKP>&$q0($T4y$6w(p=ERAFh+>n%iaeRA%!T%<^+pg?M)@ucY<&59$x9M#n+V&>}=nO9wCV{O~lg&v#+jcUj(tQ z`0u1YH)-`U$15a{pBkGyPL0THv1P|4e@pf@3IBZS4dVJPo#H>pWq%Lr0YS-SeWash z8R7=jb28KPMI|_lo#GEO|5B?N_e``H*23{~a!AmUJ+fb4HX-%QI@lSEUxKlGV7z7Q zSKw@-TR>@1RL%w{x}dW#k1NgW+q4yt2Xf1J62Bx*O^WG8OJ|FqI4&@d3_o8Id@*)4 zYrk=>@!wv~mh7YWv*bZhxqSmFh2Xq)o=m;%n$I?GSz49l1$xRpPu_^N(vZ>*>Z<04 z2+rP70oM=NDysd!@fQdM2OcyT?3T^Eb@lIC-UG=Bw{BjQ&P`KCv$AcJ;?`vdZ4){d z&gkoUK{$!$$K`3*O-jyM1~p-7T*qb)Ys>Myt^;#1&a%O@x8A+E>! zY8=eD`ZG)LVagDLBeHg>=atOG?Kr%h4B%E6m@J^C+U|y)XX@f z8oyJDW|9g=<#f<{JRr{y#~euMnv)`7j=%cHWLc}ngjq~7k**6%4u>Px&W%4D94(r* z+akunK}O0DC2A%Xo9jyF;DobX?!1I(7%}@7F>i%&nk*LMO)bMGg2N+1iqtg+r(70q zF5{Msgsm5GS7DT`kBsjMvOrkx&|EU!{{~gL4d2MWrAT=KBQ-^zQCUq{5PD1orxlIL zq;CvlWx#f1NWvh`hg011I%?T_s!e38l*lWVt|~z-PO4~~1g)SrJ|>*tXh=QfXT)%( z+ex+inPvD&O4Ur;JGz>$sUOnWdpSLcm1X%aQDw4{dB!cnj`^muI$CJ2%p&-kULVCE z>$eMR36kN$wCPR+OFDM3-U(VOrp9k3)lI&YVFqd;Kpz~K)@Fa&FRw}L(SoD z9B4a+hQzZT-BnVltst&=kq6Y(f^S4hIGNKYBgMxGJ^;2yrO}P3;r)(-I-CZ)26Y6? z&rzHI_1GCvGkgy-t1E;r^3Le30|%$ebDRu2+gdLG)r=A~Qz`}~&L@aGJ{}vVs_GE* zVUjFnzHiXfKQbpv&bR&}l2bzIjAooB)=-XNcYmrGmBh(&iu@o!^hn0^#}m2yZZUK8 zufVm7Gq0y`Mj;9b>`c?&PZkU0j4>IL=UL&-Lp3j&47B5pAW4JceG{!XCA)kT<%2nqCxj<)uy6XR_uws~>_MEKPOpAQ!H zkn>FKh)<9DwwS*|Y(q?$^N!6(51O0 z^JM~Ax{AI1Oj$fs-S5d4T7Z_i1?{%0SsIuQ&r8#(JA=2iLcTN+?>wOL532%&dMYkT z*T5xepC+V6zxhS@vNbMoi|i)=rpli@R9~P!39tWbSSb904ekv7D#quKbgFEMTb48P zuq(VJ+&L8aWU(_FCD$3^uD!YM%O^K(dvy~Wm2hUuh6bD|#(I39Xt>N1Y{ZqXL`Fg6 zKQ?T2htHN!(Bx;tV2bfTtIj7e)liN-29s1kew>v(D^@)#v;}C4-G=7x#;-dM4yRWm zyY`cS21ulzMK{PoaQ6xChEZ}o_#}X-o}<&0)$1#3we?+QeLt;aVCjeA)hn!}UaKt< zat1fHEx13y-rXNMvpUUmCVzocPmN~-Y4(YJvQ#db)4|%B!rBsgAe+*yor~}FrNH08 z3V!97S}D7d$zbSD{$z;@IYMxM6aHdypIuS*pr_U6;#Y!_?0i|&yU*@16l z*dcMqDQgfNBf}?quiu4e>H)yTVfsp#f+Du0@=Kc41QockXkCkvu>FBd6Q+@FL!(Yx z2`YuX#eMEiLEDhp+9uFqME_E^faV&~9qjBHJkIp~%$x^bN=N)K@kvSVEMdDuzA0sn z88CBG?`RX1@#hQNd`o^V{37)!w|nA)QfiYBE^m=yQKv-fQF+UCMcuEe1d4BH7$?>b zJl-r9@0^Ie=)guO1vOd=i$_4sz>y3x^R7n4ED!5oXL3@5**h(xr%Hv)_gILarO46q+MaDOF%ChaymKoI6JU5Pg;7#2n9-18|S1;AK+ zgsn6;k6-%!QD>D?cFy}8F;r@z8H9xN1jsOBw2vQONVqBVEbkiNUqgw~*!^##ht>w0 zUOykwH=$LwX2j&nLy=@{hr)2O&-wm-NyjW7n~Zs9UlH;P7iP3 zI}S(r0YFVYacnKH(+{*)Tbw)@;6>%=&Th=+Z6NHo_tR|JCI8TJiXv2N7ei7M^Q+RM z?9o`meH$5Yi;@9XaNR#jIK^&{N|DYNNbtdb)XW1Lv2k{E>;?F`#Pq|&_;gm~&~Zc9 zf+6ZE%{x4|{YdtE?a^gKyzr}dA>OxQv+pq|@IXL%WS0CiX!V zm$fCePA%lU{%pTKD7|5NJHeXg=I0jL@$tOF@K*MI$)f?om)D63K*M|r`gb9edD1~Y zc|w7N)Y%do7=0{RC|AziW7#am$)9jciRJ?IWl9PE{G3U+$%FcyKs_0Cgq`=K3@ttV z9g;M!3z~f_?P%y3-ph%vBMeS@p7P&Ea8M@97+%XEj*(1E6vHj==d zjsoviB>j^$_^OI_DEPvFkVo(BGRo%cJeD){6Uckei=~1}>sp299|IRjhXe)%?uP0I zF5+>?0#Ye}T^Y$u_rc4=lPcq4K^D(TZG-w30-YiEM=dcK+4#o*>lJ8&JLi+3UcpZk z!^?95S^C0ja^jwP`|{<+3cBVog$(mRdQmadS+Vh~z zS@|P}=|z3P6uS+&@QsMp0no9Od&27O&14zHXGAOEy zh~OKpymK5C%;LLb467@KgIiVwYbYd6wFxI{0-~MOGfTq$nBTB!{SrWmL9Hs}C&l&l#m?s*{tA?BHS4mVKHAVMqm63H<|c5n0~k)-kbg zXidai&9ZUy0~WFYYKT;oe~rytRk?)r8bptITsWj(@HLI;@=v5|XUnSls7$uaxFRL+ zRVMGuL3w}NbV1`^=Pw*0?>bm8+xfeY(1PikW*PB>>Tq(FR`91N0c2&>lL2sZo5=VD zQY{>7dh_TX98L2)n{2OV=T10~*YzX27i2Q7W86M4$?gZIXZaBq#sA*{PH8){|GUi;oM>e?ua7eF4WFuFYZSG| zze?srg|5Ti8Og{O zeFxuw9!U+zhyk?@w zjsA6(oKD=Ka;A>Ca)oPORxK+kxH#O@zhC!!XS4@=swnuMk>t+JmLmFiE^1aX3f<)D@`%K0FGK^gg1a1j>zi z2KhV>sjU7AX3F$SEqrXSC}fRx64GDoc%!u2Yag68Lw@w9v;xOONf@o)Lc|Uh3<21ctTYu-mFZuHk*+R{GjXHIGq3p)tFtQp%TYqD=j1&y)>@zxoxUJ!G@ zgI0XKmP6MNzw>nRxK$-Gbzs}dyfFzt>#5;f6oR27ql!%+{tr+(`(>%51|k`ML} zY4eE)Lxq|JMas(;JibNQds1bUB&r}ydMQXBY4x(^&fY_&LlQC)3hylc$~8&~|06-D z#T+%66rYbHX%^KuqJED_wuGB+=h`nWA!>1n0)3wZrBG3%`b^Ozv6__dNa@%V14|!D zQ?o$z5u0^8`giv%qE!BzZ!3j;BlDlJDk)h@9{nSQeEk!z9RGW) z${RSF3phEM*ce*>Xdp}585vj$|40=&S{S-GTiE?Op*vY&Lvr9}BO$XWy80IF+6@%n z5*2ueT_g@ofP#u5pxb7n*fv^Xtt7&?SRc{*2Ka-*!BuOpf}neHGCiHy$@Ka1^Dint z;DkmIL$-e)rj4o2WQV%Gy;Xg(_Bh#qeOsTM2f@KEe~4kJ8kNLQ+;(!j^bgJMcNhvklP5Z6I+9Fq@c&D~8Fb-4rmDT!MB5QC{Dsb;BharP*O;SF4& zc$wj-7Oep7#$WZN!1nznc@Vb<_Dn%ga-O#J(l=OGB`dy=Sy&$(5-n3zzu%d7E#^8`T@}V+5B;PP8J14#4cCPw-SQTdGa2gWL0*zKM z#DfSXs_iWOMt)0*+Y>Lkd=LlyoHjublNLefhKBv@JoC>P7N1_#> zv=mLWe96%EY;!ZGSQDbZWb#;tzqAGgx~uk+-$+2_8U`!ypbwXl z^2E-FkM1?lY@yt8=J3%QK+xaZ6ok=-y%=KXCD^0r!5vUneW>95PzCkOPO*t}p$;-> ze5j-BLT_;)cZQzR2CEsm@rU7GZfFtdp*a|g4wDr%8?2QkIGasRfDWT-Dvy*U{?IHT z*}wGnzdlSptl#ZF^sf)KT|BJs&kLG91^A6ls{CzFprZ6-Y!V0Xysh%9p%iMd7HLsS zN+^Un$tDV)T@i!v?3o0Fsx2qI(AX_$dDkBzQ@fRM%n zRXk6hb9Py#JXUs+7)w@eo;g%QQ95Yq!K_d=z{0dGS+pToEI6=Bo8+{k$7&Z zo4>PH(`ce8E-Ps&uv`NQ;U$%t;w~|@E3WVOCi~R4oj5wP?%<*1C%}Jq%a^q~T7u>K zML5AKfQDv6>PuT`{SrKHRAF+^&edg6+5R_#H?Lz3iGoWo#PCEd0DS;)2U({{X#zU^ zw_xv{4x7|t!S)>44J;KfA|DC?;uQ($l+5Vp7oeqf7{GBF9356nx|&B~gs+@N^gSdd zvb*>&W)|u#F{Z_b`f#GVtQ`pYv3#||N{xj1NgB<#=Odt6{eB%#9RLt5v zIi|0u70`#ai}9fJjKv7dE!9ZrOIX!3{$z_K5FBd-Kp-&e4(J$LD-)NMTp^_pB`RT; zftVVlK2g@+1Ahv2$D){@Y#cL#dUj9*&%#6 zd2m9{1NYp>)6=oAvqdCn5#cx{AJ%S8skUgMglu2*IAtd+z1>B&`MuEAS(D(<6X#Lj z?f4CFx$)M&$=7*>9v1ER4b6!SIz-m0e{o0BfkySREchp?WdVPpQCh!q$t>?rL!&Jg zd#heM;&~A}VEm8Dvy&P|J*eAV&w!&Nx6HFV&B8jJFVTmgLaswn!cx$&%JbTsloz!3 zMEz1d`k==`Ueub_JAy_&`!ogbwx27^ZXgFNAbx=g_I~5nO^r)}&myw~+yY*cJl4$I znNJ32M&K=0(2Dj_>@39`3=FX!v3nZHno_@q^!y}%(yw0PqOo=);6Y@&ylVe>nMOZ~ zd>j#QQSBn3oaWd;qy$&5(5H$Ayi)0haAYO6TH>FR?rhqHmNOO+(})NB zLI@B@v0)eq!ug`>G<@htRlp3n!EpU|n+G+AvXFrWSUsLMBfL*ZB`CRsIVHNTR&b?K zxBgsN0BjfB>UVcJ|x%=-zb%OV7lmZc& zxiupadZVF7)6QuhoY;;FK2b*qL0J-Rn-8!X4ZY$-ZSUXV5DFd7`T41c(#lAeLMoeT z4%g655v@7AqT!i@)Edt5JMbN(=Q-6{=L4iG8RA%}w;&pKmtWvI4?G9pVRp|RTw`g0 zD5c12B&A2&P6Ng~8WM2eIW=wxd?r7A*N+&!Be7PX3s|7~z=APxm=A?5 zt>xB4WG|*Td@VX{Rs)PV0|yK`oI3^xn(4c_j&vgxk_Y3o(-`_5o`V zRTghg6%l@(qodXN;dB#+OKJEEvhfcnc#BeO2|E(5df-!fKDZ!%9!^BJ_4)9P+9Dq5 zK1=(v?KmIp34r?z{NEWnLB3Px{XYwy-akun4F7xTRr2^zeYW{gcK9)>aJDdU5;w5@ zak=<+-PLH-|04pelTb%ULpuuuJC7DgyT@D|p{!V!0v3KpDnRjANN12q6SUR3mb9<- z>2r~IApQGhstZ!3*?5V z8#)hJ0TdZg0M-BK#nGFP>$i=qk82DO z7h;Ft!D5E15OgW)&%lej*?^1~2=*Z5$2VX>V{x8SC+{i10BbtUk9@I#Vi&hX)q
          Q!LwySI{Bnv%Sm)yh{^sSVJ8&h_D-BJ_YZe5eCaAWU9b$O2c z$T|{vWVRtOL!xC0DTc(Qbe`ItNtt5hr<)VijD0{U;T#bUEp381_y`%ZIav?kuYG{iyYdEBPW=*xNSc;Rlt6~F4M`5G+VtOjc z*0qGzCb@gME5udTjJA-9O<&TWd~}ysBd(eVT1-H82-doyH9RST)|+Pb{o*;$j9Tjs zhU!IlsPsj8=(x3bAKJTopW3^6AKROHR^7wZ185wJGVhA~hEc|LP;k7NEz-@4p5o}F z`AD6naG3(n=NF9HTH81=F+Q|JOz$7wm9I<+#BSmB@o_cLt2GkW9|?7mM;r!JZp89l zbo!Hp8=n!XH1{GwaDU+k)pGp`C|cXkCU5%vcH)+v@0eK>%7gWxmuMu9YLlChA|_D@ zi#5zovN_!a-0?~pUV-Rj*1P)KwdU-LguR>YM&*Nen+ln8Q$?WFCJg%DY%K}2!!1FE zDv-A%Cbwo^p(lzac&_TZ-l#9kq`mhLcY3h9ZTUVCM(Ad&=EriQY5{jJv<5K&g|*Lk zgV%ILnf1%8V2B0E&;Sp4sYbYOvvMebLwYwzkRQ#F8GpTQq#uv=J`uaSJ34OWITeSGo6+-8Xw znCk*n{kdDEi)Hi&u^)~cs@iyCkFWB2SWZU|Uc%^43ZIZQ-vWNExCCtDWjqHs;;tWf$v{}0{p0Rvxkq``)*>+Akq%|Na zA`@~-Vfe|+(AIlqru+7Ceh4nsVmO9p9jc8}HX^W&ViBDXT+uXbT#R#idPn&L>+#b6 zflC-4C5-X;kUnR~L>PSLh*gvL68}RBsu#2l`s_9KjUWRhiqF`j)`y`2`YU(>3bdBj z?>iyjEhe-~$^I5!nn%B6Wh+I`FvLNvauve~eX<+Ipl&04 zT}};W&1a3%W?dJ2=N#0t?e+aK+%t}5q%jSLvp3jZ%?&F}nOOWr>+{GFIa%wO_2`et z=JzoRR~}iKuuR+azPI8;Gf9)z3kyA4EIOSl!sRR$DlW}0>&?GbgPojmjmnln;cTqCt=ADbE zZ8GAnoM+S1(5$i8^O4t`ue;vO4i}z0wz-QEIVe5_u03;}-!G1NyY8;h^}y;tzY}i5 zqQr#Ur3Fy8sSa$Q0ys+f`!`+>9WbvU_I`Sj;$4{S>O3?#inLHCrtLy~!s#WXV=oVP zeE93*Nc`PBi4q@%Ao$x4lw9vLHM!6mn3-b_cebF|n-2vt-zYVF_&sDE--J-P;2WHo z+@n2areE0o$LjvjlV2X7ZU@j+`{*8zq`JR3gKF#EW|#+{nMyo-a>nFFTg&vhyT=b} zDa8+v0(Dgx0yRL@ZXOYIlVSZ0|MFizy0VPW8;AfA5|pe!#j zX}Py^8fl5SyS4g1WSKKtnyP+_PoOwMMwu`(i@Z)diJp~U54*-miOchy7Z35eL>^M z4p<-aIxH4VUZgS783@H%M7P9hX>t{|RU7$n4T(brCG#h9e9p! z+o`i;EGGq3&pF;~5V~eBD}lC)>if$w%Vf}AFxGqO88|ApfHf&Bvu+xdG)@vuF}Yvk z)o;~k-%+0K0g+L`Wala!$=ZV|z$e%>f0%XoLib%)!R^RoS+{!#X?h-6uu zF&&KxORdZU&EwQFITIRLo(7TA3W}y6X{?Y%y2j0It!ekU#<)$qghZtpcS>L3uh`Uj z7GY;6f$9qKynP#oS3$$a{p^{D+0oJQ71`1?OAn_m8)UGZmj3l*ZI)`V-a>MKGGFG< z&^jg#Ok%(hhm>hSrZ5;Qga4u(?^i>GiW_j9%_7M>j(^|Om$#{k+^*ULnEgzW_1gCICtAD^WpC`A z{9&DXkG#01Xo)U$OC(L5Y$DQ|Q4C6CjUKk1UkPj$nXH##J{c8e#K|&{mA*;b$r0E4 zUNo0jthwA(c&N1l=PEe8Rw_8cEl|-eya9z&H3#n`B$t#+aJ03RFMzrV@gowbe8v(c zIFM60^0&lCFO10NU4w@|61xiZ4CVXeaKjd;d?sv52XM*lS8XiVjgWpRB;&U_C0g+`6B5V&w|O6B*_q zsATxL!M}+$He)1eOWECce#eS@2n^xhlB4<_Nn?yCVEQWDs(r`|@2GqLe<#(|&P0U? z$7V5IgpWf09uIf_RazRwC?qEqRaHyL?iiS05UiGesJy%^>-C{{ypTBI&B0-iUYhk> zIk<5xpsuV@g|z(AZD+C-;A!fTG=df1=<%nxy(a(IS+U{ME4ZbDEBtcD_3V=icT6*_ z)>|J?>&6%nvHhZERBtjK+s4xnut*@>GAmA5m*OTp$!^CHTr}vM4n(X1Q*;{e-Rd2BCF-u@1ZGm z!S8hJ6L=Gl4T_SDa7Xx|-{4mxveJg=ctf`BJ*fy!yF6Dz&?w(Q_6B}WQVtNI!BVBC zKfX<>7vd6C96}XAQmF-Jd?1Q4eTfRB3q7hCh0f!(JkdWT5<{iAE#dKy*Jxq&3a1@~ z8C||Dn2mFNyrUV|<-)C^_y7@8c2Fz+2jrae9deBDu;U}tJ{^xAdxCD248(k;dCJ%o z`y3sADe>U%suxwwv~8A1+R$VB=Q?%U?4joI$um;aH+eCrBqpn- z%79D_7rb;R-;-9RTrwi9dPlg8&@tfWhhZ(Vx&1PQ+6(huX`;M9x~LrW~~#3{j0Bh2kDU$}@!fFQej4VGkJv?M4rU^x!RU zEwhu$!CA_iDjFjrJa`aocySDX16?~;+wgav;}Zut6Mg%C4>}8FL?8)Kgwc(Qlj{@#2Pt0?G`$h7P#M+qoXtlV@d}%c&OzO+QYKK`kyXaK{U(O^2DyIXCZlNQjt0^8~8JzNGrIxhj}}M z&~QZlbx%t;MJ(Vux;2tgNKGlAqphLq%pd}JG9uoVHUo?|hN{pLQ6Em%r*+7t^<);X zm~6=qChlNAVXNN*Sow->*4;}T;l;D1I-5T{Bif@4_}=>l`tK;qqDdt5zvisCKhMAH z#r}`)7VW?LZqfdmXQ%zo5bJ00{Xb9^YKrk0Nf|oIW*K@(=`o2Vndz}ZDyk{!u}PVx zzd--+_WC*U{~DH3{?GI64IB+@On&@9X>EUAo&L+G{L^dozaI4C3G#2wr~hseW@K&g zKWs{uHu-9Je!3;4pE>eBltKUXb^*hG8I&413)$J&{D4N%7PcloU6bn%jPxJyQL?g* z9g+YFFEDiE`8rW^laCNzQmi7CTnPfwyg3VDHRAl>h=In6jeaVOP@!-CP60j3+#vpL zEYmh_oP0{-gTe7Or`L6x)6w?77QVi~jD8lWN@3RHcm80iV%M1A!+Y6iHM)05iC64tb$X2lV_%Txk@0l^hZqi^%Z?#- zE;LE0uFx)R08_S-#(wC=dS&}vj6P4>5ZWjhthP=*Hht&TdLtKDR;rXEX4*z0h74FA zMCINqrh3Vq;s%3MC1YL`{WjIAPkVL#3rj^9Pj9Ss7>7duy!9H0vYF%>1jh)EPqvlr6h%R%CxDsk| z!BACz7E%j?bm=pH6Eaw{+suniuY7C9Ut~1cWfOX9KW9=H><&kQlinPV3h9R>3nJvK z4L9(DRM=x;R&d#a@oFY7mB|m8h4692U5eYfcw|QKwqRsshN(q^v$4$)HgPpAJDJ`I zkqjq(8Cd!K!+wCd=d@w%~e$=gdUgD&wj$LQ1r>-E=O@c ze+Z$x{>6(JA-fNVr)X;*)40Eym1TtUZI1Pwwx1hUi+G1Jlk~vCYeXMNYtr)1?qwyg zsX_e*$h?380O00ou?0R@7-Fc59o$UvyVs4cUbujHUA>sH!}L54>`e` zHUx#Q+Hn&Og#YVOuo*niy*GU3rH;%f``nk#NN5-xrZ34NeH$l`4@t);4(+0|Z#I>Y z)~Kzs#exIAaf--65L0UHT_SvV8O2WYeD>Mq^Y6L!Xu8%vnpofG@w!}R7M28?i1*T&zp3X4^OMCY6(Dg<-! zXmcGQrRgHXGYre7GfTJ)rhl|rs%abKT_Nt24_Q``XH{88NVPW+`x4ZdrMuO0iZ0g` z%p}y};~T5gbb9SeL8BSc`SO#ixC$@QhXxZ=B}L`tP}&k?1oSPS=4%{UOHe0<_XWln zwbl5cn(j-qK`)vGHY5B5C|QZd5)W7c@{bNVXqJ!!n$^ufc?N9C-BF2QK1(kv++h!>$QbAjq)_b$$PcJdV+F7hz0Hu@ zqj+}m0qn{t^tD3DfBb~0B36|Q`bs*xs|$i^G4uNUEBl4g;op-;Wl~iThgga?+dL7s zUP(8lMO?g{GcYpDS{NM!UA8Hco?#}eNEioRBHy4`mq!Pd-9@-97|k$hpEX>xoX+dY zDr$wfm^P&}Wu{!%?)U_(%Mn79$(ywvu*kJ9r4u|MyYLI_67U7%6Gd_vb##Nerf@>& z8W11z$$~xEZt$dPG}+*IZky+os5Ju2eRi;1=rUEeIn>t-AzC_IGM-IXWK3^6QNU+2pe=MBn4I*R@A%-iLDCOHTE-O^wo$sL_h{dcPl=^muAQb`_BRm};=cy{qSkui;`WSsj9%c^+bIDQ z0`_?KX0<-=o!t{u(Ln)v>%VGL z0pC=GB7*AQ?N7N{ut*a%MH-tdtNmNC+Yf$|KS)BW(gQJ*z$d{+{j?(e&hgTy^2|AR9vx1Xre2fagGv0YXWqtNkg*v%40v?BJBt|f9wX5 z{QTlCM}b-0{mV?IG>TW_BdviUKhtosrBqdfq&Frdz>cF~yK{P@(w{Vr7z2qKFwLhc zQuogKO@~YwyS9%+d-zD7mJG~@?EFJLSn!a&mhE5$_4xBl&6QHMzL?CdzEnC~C3$X@ zvY!{_GR06ep5;<#cKCSJ%srxX=+pn?ywDwtJ2{TV;0DKBO2t++B(tIO4)Wh`rD13P z4fE$#%zkd=UzOB74gi=-*CuID&Z3zI^-`4U^S?dHxK8fP*;fE|a(KYMgMUo`THIS1f!*6dOI2 zFjC3O=-AL`6=9pp;`CYPTdVX z8(*?V&%QoipuH0>WKlL8A*zTKckD!paN@~hh zmXzm~qZhMGVdQGd=AG8&20HW0RGV8X{$9LldFZYm zE?}`Q3i?xJRz43S?VFMmqRyvWaS#(~Lempg9nTM$EFDP(Gzx#$r)W&lpFKqcAoJh-AxEw$-bjW>`_+gEi z2w`99#UbFZGiQjS8kj~@PGqpsPX`T{YOj`CaEqTFag;$jY z8_{Wzz>HXx&G*Dx<5skhpETxIdhKH?DtY@b9l8$l?UkM#J-Snmts7bd7xayKTFJ(u zyAT&@6cAYcs{PBfpqZa%sxhJ5nSZBPji?Zlf&}#L?t)vC4X5VLp%~fz2Sx<*oN<7` z?ge=k<=X7r<~F7Tvp9#HB{!mA!QWBOf%EiSJ6KIF8QZNjg&x~-%e*tflL(ji_S^sO ztmib1rp09uon}RcsFi#k)oLs@$?vs(i>5k3YN%$T(5Or(TZ5JW9mA6mIMD08=749$ z!d+l*iu{Il7^Yu}H;lgw=En1sJpCKPSqTCHy4(f&NPelr31^*l%KHq^QE>z>Ks_bH zjbD?({~8Din7IvZeJ>8Ey=e;I?thpzD=zE5UHeO|neioJwG;IyLk?xOz(yO&0DTU~ z^#)xcs|s>Flgmp;SmYJ4g(|HMu3v7#;c*Aa8iF#UZo7CvDq4>8#qLJ|YdZ!AsH%^_7N1IQjCro

          K7UpUK$>l@ zw`1S}(D?mUXu_C{wupRS-jiX~w=Uqqhf|Vb3Cm9L=T+w91Cu^ z*&Ty%sN?x*h~mJc4g~k{xD4ZmF%FXZNC;oVDwLZ_WvrnzY|{v8hc1nmx4^}Z;yriXsAf+Lp+OFLbR!&Ox?xABwl zu8w&|5pCxmu#$?Cv2_-Vghl2LZ6m7}VLEfR5o2Ou$x02uA-%QB2$c(c1rH3R9hesc zfpn#oqpbKuVsdfV#cv@5pV4^f_!WS+F>SV6N0JQ9E!T90EX((_{bSSFv9ld%I0&}9 zH&Jd4MEX1e0iqDtq~h?DBrxQX1iI0lIs<|kB$Yrh&cpeK0-^K%=FBsCBT46@h#yi!AyDq1V(#V}^;{{V*@T4WJ&U-NTq43w=|K>z8%pr_nC>%C(Wa_l78Ufib$r8Od)IIN=u>417 z`Hl{9A$mI5A(;+-Q&$F&h-@;NR>Z<2U;Y21>>Z;s@0V@SbkMQQj%_;~+qTuQ?c|AV zcWm3XZQHhP&R%QWarS%mJ!9R^&!_)*s(v+VR@I#QrAT}`17Y+l<`b-nvmDNW`De%y zrwTZ9EJrj1AFA>B`1jYDow}~*dfPs}IZMO3=a{Fy#IOILc8F0;JS4x(k-NSpbN@qM z`@aE_e}5{!$v3+qVs7u?sOV(y@1Os*Fgu`fCW9=G@F_#VQ%xf$hj0~wnnP0$hFI+@ zkQj~v#V>xn)u??YutKsX>pxKCl^p!C-o?+9;!Nug^ z{rP!|+KsP5%uF;ZCa5F;O^9TGac=M|=V z_H(PfkV1rz4jl?gJ(ArXMyWT4y(86d3`$iI4^l9`vLdZkzpznSd5Ikfrs8qcSy&>z zTIZgWZGXw0n9ibQxYWE@gI0(3#KA-dAdPcsL_|hg2@~C!VZDM}5;v_Nykfq!*@*Zf zE_wVgx82GMDryKO{U{D>vSzSc%B~|cjDQrt5BN=Ugpsf8H8f1lR4SGo#hCuXPL;QQ z#~b?C4MoepT3X`qdW2dNn& zo8)K}%Lpu>0tQei+{>*VGErz|qjbK#9 zvtd8rcHplw%YyQCKR{kyo6fgg!)6tHUYT(L>B7er5)41iG`j$qe*kSh$fY!PehLcD zWeKZHn<492B34*JUQh=CY1R~jT9Jt=k=jCU2=SL&&y5QI2uAG2?L8qd2U(^AW#{(x zThSy=C#>k+QMo^7caQcpU?Qn}j-`s?1vXuzG#j8(A+RUAY})F@=r&F(8nI&HspAy4 z4>(M>hI9c7?DCW8rw6|23?qQMSq?*Vx?v30U%luBo)B-k2mkL)Ljk5xUha3pK>EEj z@(;tH|M@xkuN?gsz;*bygizwYR!6=(Xgcg^>WlGtRYCozY<rFX2E>kaZo)O<^J7a`MX8Pf`gBd4vrtD|qKn&B)C&wp0O-x*@-|m*0egT=-t@%dD zgP2D+#WPptnc;_ugD6%zN}Z+X4=c61XNLb7L1gWd8;NHrBXwJ7s0ce#lWnnFUMTR& z1_R9Fin4!d17d4jpKcfh?MKRxxQk$@)*hradH2$3)nyXep5Z;B z?yX+-Bd=TqO2!11?MDtG0n(*T^!CIiF@ZQymqq1wPM_X$Iu9-P=^}v7npvvPBu!d$ z7K?@CsA8H38+zjA@{;{kG)#AHME>Ix<711_iQ@WWMObXyVO)a&^qE1GqpP47Q|_AG zP`(AD&r!V^MXQ^e+*n5~Lp9!B+#y3#f8J^5!iC@3Y@P`;FoUH{G*pj*q7MVV)29+j z>BC`a|1@U_v%%o9VH_HsSnM`jZ-&CDvbiqDg)tQEnV>b%Ptm)T|1?TrpIl)Y$LnG_ zzKi5j2Fx^K^PG1=*?GhK;$(UCF-tM~^=Z*+Wp{FSuy7iHt9#4n(sUuHK??@v+6*|10Csdnyg9hAsC5_OrSL;jVkLlf zHXIPukLqbhs~-*oa^gqgvtpgTk_7GypwH><53riYYL*M=Q@F-yEPLqQ&1Sc zZB%w}T~RO|#jFjMWcKMZccxm-SL)s_ig?OC?y_~gLFj{n8D$J_Kw%{r0oB8?@dWzn zB528d-wUBQzrrSSLq?fR!K%59Zv9J4yCQhhDGwhptpA5O5U?Hjqt>8nOD zi{)0CI|&Gu%zunGI*XFZh(ix)q${jT8wnnzbBMPYVJc4HX*9d^mz|21$=R$J$(y7V zo0dxdbX3N#=F$zjstTf*t8vL)2*{XH!+<2IJ1VVFa67|{?LP&P41h$2i2;?N~RA30LV`BsUcj zfO9#Pg1$t}7zpv#&)8`mis3~o+P(DxOMgz-V*(?wWaxi?R=NhtW}<#^Z?(BhSwyar zG|A#Q7wh4OfK<|DAcl9THc-W4*>J4nTevsD%dkj`U~wSUCh15?_N@uMdF^Kw+{agk zJ`im^wDqj`Ev)W3k3stasP`88-M0ZBs7;B6{-tSm3>I@_e-QfT?7|n0D~0RRqDb^G zyHb=is;IwuQ&ITzL4KsP@Z`b$d%B0Wuhioo1CWttW8yhsER1ZUZzA{F*K=wmi-sb#Ju+j z-l@In^IKnb{bQG}Ps>+Vu_W#grNKNGto+yjA)?>0?~X`4I3T@5G1)RqGUZuP^NJCq&^HykuYtMDD8qq+l8RcZNJsvN(10{ zQ1$XcGt}QH-U^WU!-wRR1d--{B$%vY{JLWIV%P4-KQuxxDeJaF#{eu&&r!3Qu{w}0f--8^H|KwE>)ORrcR+2Qf zb})DRcH>k0zWK8@{RX}NYvTF;E~phK{+F;MkIP$)T$93Ba2R2TvKc>`D??#mv9wg$ zd~|-`Qx5LwwsZ2hb*Rt4S9dsF%Cny5<1fscy~)d;0m2r$f=83<->c~!GNyb!U)PA; zq^!`@@)UaG)Ew(9V?5ZBq#c%dCWZrplmuM`o~TyHjAIMh0*#1{B>K4po-dx$Tk-Cq z=WZDkP5x2W&Os`N8KiYHRH#UY*n|nvd(U>yO=MFI-2BEp?x@=N<~CbLJBf6P)}vLS?xJXYJ2^<3KJUdrwKnJnTp{ zjIi|R=L7rn9b*D#Xxr4*R<3T5AuOS+#U8hNlfo&^9JO{VbH!v9^JbK=TCGR-5EWR@ zN8T-_I|&@A}(hKeL4_*eb!1G8p~&_Im8|wc>Cdir+gg90n1dw?QaXcx6Op_W1r=axRw>4;rM*UOpT#Eb9xU1IiWo@h?|5uP zka>-XW0Ikp@dIe;MN8B01a7+5V@h3WN{J=HJ*pe0uwQ3S&MyWFni47X32Q7SyCTNQ z+sR!_9IZa5!>f&V$`q!%H8ci!a|RMx5}5MA_kr+bhtQy{-^)(hCVa@I!^TV4RBi zAFa!Nsi3y37I5EK;0cqu|9MRj<^r&h1lF}u0KpKQD^5Y+LvFEwM zLU@@v4_Na#Axy6tn3P%sD^5P#<7F;sd$f4a7LBMk zGU^RZHBcxSA%kCx*eH&wgA?Qwazm8>9SCSz_!;MqY-QX<1@p$*T8lc?@`ikEqJ>#w zcG``^CoFMAhdEXT9qt47g0IZkaU)4R7wkGs^Ax}usqJ5HfDYAV$!=6?>J6+Ha1I<5 z|6=9soU4>E))tW$<#>F ziZ$6>KJf0bPfbx_)7-}tMINlc=}|H+$uX)mhC6-Hz+XZxsKd^b?RFB6et}O#+>Wmw9Ec9) z{q}XFWp{3@qmyK*Jvzpyqv57LIR;hPXKsrh{G?&dRjF%Zt5&m20Ll?OyfUYC3WRn{cgQ?^V~UAv+5 z&_m#&nIwffgX1*Z2#5^Kl4DbE#NrD&Hi4|7SPqZ}(>_+JMz=s|k77aEL}<=0Zfb)a z%F(*L3zCA<=xO)2U3B|pcTqDbBoFp>QyAEU(jMu8(jLA61-H!ucI804+B!$E^cQQa z)_ERrW3g!B9iLb3nn3dlkvD7KsY?sRvls3QC0qPi>o<)GHx%4Xb$5a3GBTJ(k@`e@ z$RUa^%S15^1oLEmA=sayrP5;9qtf!Z1*?e$ORVPsXpL{jL<6E)0sj&swP3}NPmR%FM?O>SQgN5XfHE< zo(4#Cv11(%Nnw_{_Ro}r6=gKd{k?NebJ~<~Kv0r(r0qe4n3LFx$5%x(BKvrz$m?LG zjLIc;hbj0FMdb9aH9Lpsof#yG$(0sG2%RL;d(n>;#jb!R_+dad+K;Ccw!|RY?uS(a zj~?=&M!4C(5LnlH6k%aYvz@7?xRa^2gml%vn&eKl$R_lJ+e|xsNfXzr#xuh(>`}9g zLHSyiFwK^-p!;p$yt7$F|3*IfO3Mlu9e>Dpx8O`37?fA`cj`C0B-m9uRhJjs^mRp# zWB;Aj6|G^1V6`jg7#7V9UFvnB4((nIwG?k%c7h`?0tS8J3Bn0t#pb#SA}N-|45$-j z$R>%7cc2ebAClXc(&0UtHX<>pd)akR3Kx_cK+n<}FhzmTx!8e9^u2e4%x{>T6pQ`6 zO182bh$-W5A3^wos0SV_TgPmF4WUP-+D25KjbC{y_6W_9I2_vNKwU(^qSdn&>^=*t z&uvp*@c8#2*paD!ZMCi3;K{Na;I4Q35zw$YrW5U@Kk~)&rw;G?d7Q&c9|x<Hg|CNMsxovmfth*|E*GHezPTWa^Hd^F4!B3sF;)? z(NaPyAhocu1jUe(!5Cy|dh|W2=!@fNmuNOzxi^tE_jAtzNJ0JR-avc_H|ve#KO}#S z#a(8secu|^Tx553d4r@3#6^MHbH)vmiBpn0X^29xEv!Vuh1n(Sr5I0V&`jA2;WS|Y zbf0e}X|)wA-Pf5gBZ>r4YX3Mav1kKY(ulAJ0Q*jB)YhviHK)w!TJsi3^dMa$L@^{` z_De`fF4;M87vM3Ph9SzCoCi$#Fsd38u!^0#*sPful^p5oI(xGU?yeYjn;Hq1!wzFk zG&2w}W3`AX4bxoVm03y>ts{KaDf!}b&7$(P4KAMP=vK5?1In^-YYNtx1f#}+2QK@h zeSeAI@E6Z8a?)>sZ`fbq9_snl6LCu6g>o)rO;ijp3|$vig+4t} zylEo7$SEW<_U+qgVcaVhk+4k+C9THI5V10qV*dOV6pPtAI$)QN{!JRBKh-D zk2^{j@bZ}yqW?<#VVuI_27*cI-V~sJiqQv&m07+10XF+#ZnIJdr8t`9s_EE;T2V;B z4UnQUH9EdX%zwh-5&wflY#ve!IWt0UE-My3?L#^Bh%kcgP1q{&26eXLn zTkjJ*w+(|_>Pq0v8{%nX$QZbf)tbJaLY$03;MO=Ic-uqYUmUCuXD>J>o6BCRF=xa% z3R4SK9#t1!K4I_d>tZgE>&+kZ?Q}1qo4&h%U$GfY058s%*=!kac{0Z+4Hwm!)pFLR zJ+5*OpgWUrm0FPI2ib4NPJ+Sk07j(`diti^i#kh&f}i>P4~|d?RFb#!JN)~D@)beox}bw?4VCf^y*`2{4`-@%SFTry2h z>9VBc9#JxEs1+0i2^LR@B1J`B9Ac=#FW=(?2;5;#U$0E0UNag_!jY$&2diQk_n)bT zl5Me_SUvqUjwCqmVcyb`igygB_4YUB*m$h5oeKv3uIF0sk}~es!{D>4r%PC*F~FN3owq5e0|YeUTSG#Vq%&Gk7uwW z0lDo#_wvflqHeRm*}l?}o;EILszBt|EW*zNPmq#?4A+&i0xx^?9obLyY4xx=Y9&^G;xYXYPxG)DOpPg!i_Ccl#3L}6xAAZzNhPK1XaC_~ z!A|mlo?Be*8Nn=a+FhgpOj@G7yYs(Qk(8&|h@_>w8Y^r&5nCqe0V60rRz?b5%J;GYeBqSAjo|K692GxD4` zRZyM2FdI+-jK2}WAZTZ()w_)V{n5tEb@>+JYluDozCb$fA4H)$bzg(Ux{*hXurjO^ zwAxc+UXu=&JV*E59}h3kzQPG4M)X8E*}#_&}w*KEgtX)cU{vm9b$atHa;s>| z+L6&cn8xUL*OSjx4YGjf6{Eq+Q3{!ZyhrL&^6Vz@jGbI%cAM9GkmFlamTbcQGvOlL zmJ?(FI)c86=JEs|*;?h~o)88>12nXlpMR4@yh%qdwFNpct;vMlc=;{FSo*apJ;p}! zAX~t;3tb~VuP|ZW;z$=IHf->F@Ml)&-&Bnb{iQyE#;GZ@C$PzEf6~q}4D>9jic@mTO5x76ulDz@+XAcm35!VSu zT*Gs>;f0b2TNpjU_BjHZ&S6Sqk6V1370+!eppV2H+FY!q*n=GHQ!9Rn6MjY!Jc77A zG7Y!lFp8?TIHN!LXO?gCnsYM-gQxsm=Ek**VmZu7vnuufD7K~GIxfxbsQ@qv2T zPa`tvHB$fFCyZl>3oYg?_wW)C>^_iDOc^B7klnTOoytQH18WkOk)L2BSD0r%xgRSW zQS9elF^?O=_@|58zKLK;(f77l-Zzu}4{fXed2saq!5k#UZAoDBqYQS{sn@j@Vtp|$ zG%gnZ$U|9@u#w1@11Sjl8ze^Co=)7yS(}=;68a3~g;NDe_X^}yJj;~s8xq9ahQ5_r zxAlTMnep*)w1e(TG%tWsjo3RR;yVGPEO4V{Zp?=a_0R#=V^ioQu4YL=BO4r0$$XTX zZfnw#_$V}sDAIDrezGQ+h?q24St0QNug_?{s-pI(^jg`#JRxM1YBV;a@@JQvH8*>> zIJvku74E0NlXkYe_624>znU0J@L<-c=G#F3k4A_)*;ky!C(^uZfj%WB3-*{*B$?9+ zDm$WFp=0(xnt6`vDQV3Jl5f&R(Mp};;q8d3I%Kn>Kx=^;uSVCw0L=gw53%Bp==8Sw zxtx=cs!^-_+i{2OK`Q;913+AXc_&Z5$@z3<)So0CU3;JAv=H?@Zpi~riQ{z-zLtVL z!oF<}@IgJp)Iyz1zVJ42!SPHSkjYNS4%ulVVIXdRuiZ@5Mx8LJS}J#qD^Zi_xQ@>DKDr-_e#>5h3dtje*NcwH_h;i{Sx7}dkdpuW z(yUCjckQsagv*QGMSi9u1`Z|V^}Wjf7B@q%j2DQXyd0nOyqg%m{CK_lAoKlJ7#8M} z%IvR?Vh$6aDWK2W!=i?*<77q&B8O&3?zP(Cs@kapc)&p7En?J;t-TX9abGT#H?TW? ztO5(lPKRuC7fs}zwcUKbRh=7E8wzTsa#Z{a`WR}?UZ%!HohN}d&xJ=JQhpO1PI#>X zHkb>pW04pU%Bj_mf~U}1F1=wxdBZu1790>3Dm44bQ#F=T4V3&HlOLsGH)+AK$cHk6 zia$=$kog?)07HCL*PI6}DRhpM^*%I*kHM<#1Se+AQ!!xyhcy6j7`iDX7Z-2i73_n# zas*?7LkxS-XSqv;YBa zW_n*32D(HTYQ0$feV_Fru1ZxW0g&iwqixPX3=9t4o)o|kOo79V$?$uh?#8Q8e>4e)V6;_(x&ViUVxma+i25qea;d-oK7ouuDsB^ab{ zu1qjQ%`n56VtxBE#0qAzb7lph`Eb-}TYpXB!H-}3Ykqyp`otprp7{VEuW*^IR2n$Fb99*nAtqT&oOFIf z@w*6>YvOGw@Ja?Pp1=whZqydzx@9X4n^2!n83C5{C?G@|E?&$?p*g68)kNvUTJ)I6 z1Q|(#UuP6pj78GUxq11m-GSszc+)X{C2eo-?8ud9sB=3(D47v?`JAa{V(IF zPZQ_0AY*9M97>Jf<o%#O_%Wq}8>YM=q0|tGY+hlXcpE=Z4Od z`NT7Hu2hnvRoqOw@g1f=bv`+nba{GwA$Ak0INlqI1k<9!x_!sL()h?hEWoWrdU3w` zZ%%)VR+Bc@_v!C#koM1p-3v_^L6)_Ktj4HE>aUh%2XZE@JFMOn)J~c`_7VWNb9c-N z2b|SZMR4Z@E7j&q&9(6H3yjEu6HV7{2!1t0lgizD;mZ9$r(r7W5G$ky@w(T_dFnOD z*p#+z$@pKE+>o@%eT(2-p_C}wbQ5s(%Sn_{$HDN@MB+Ev?t@3dPy`%TZ!z}AThZSu zN<1i$siJhXFdjV zP*y|V<`V8t=h#XTRUR~5`c`Z9^-`*BZf?WAehGdg)E2Je)hqFa!k{V(u+(hTf^Yq& zoruUh2(^3pe)2{bvt4&4Y9CY3js)PUHtd4rVG57}uFJL)D(JfSIo^{P=7liFXG zq5yqgof0V8paQcP!gy+;^pp-DA5pj=gbMN0eW=-eY+N8~y+G>t+x}oa!5r>tW$xhI zPQSv=pi;~653Gvf6~*JcQ%t1xOrH2l3Zy@8AoJ+wz@daW@m7?%LXkr!bw9GY@ns3e zSfuWF_gkWnesv?s3I`@}NgE2xwgs&rj?kH-FEy82=O8`+szN ziHch`vvS`zNfap14!&#i9H@wF7}yIPm=UB%(o(}F{wsZ(wA0nJ2aD^@B41>>o-_U6 zUqD~vdo48S8~FTb^+%#zcbQiiYoDKYcj&$#^;Smmb+Ljp(L=1Kt_J!;0s%1|JK}Wi z;={~oL!foo5n8=}rs6MmUW~R&;SIJO3TL4Ky?kh+b2rT9B1Jl4>#Uh-Bec z`Hsp<==#UEW6pGPhNk8H!!DUQR~#F9jEMI6T*OWfN^Ze&X(4nV$wa8QUJ>oTkruH# zm~O<`J7Wxseo@FqaZMl#Y(mrFW9AHM9Kb|XBMqaZ2a)DvJgYipkDD_VUF_PKd~dT7 z#02}bBfPn9a!X!O#83=lbJSK#E}K&yx-HI#T6ua)6o0{|={*HFusCkHzs|Fn&|C3H zBck1cmfcWVUN&i>X$YU^Sn6k2H;r3zuXbJFz)r5~3$d$tUj(l1?o={MM){kjgqXRO zc5R*#{;V7AQh|G|)jLM@wGAK&rm2~@{Pewv#06pHbKn#wL0P6F1!^qw9g&cW3Z=9} zj)POhOlwsh@eF=>z?#sIs*C-Nl(yU!#DaiaxhEs#iJqQ8w%(?+6lU02MYSeDkr!B- zPjMv+on6OLXgGnAtl(ao>|X2Y8*Hb}GRW5}-IzXnoo-d0!m4Vy$GS!XOLy>3_+UGs z2D|YcQx@M#M|}TDOetGi{9lGo9m-=0-^+nKE^*?$^uHkxZh}I{#UTQd;X!L+W@jm( zDg@N4+lUqI92o_rNk{3P>1gxAL=&O;x)ZT=q1mk0kLlE$WeWuY_$0`0jY-Kkt zP*|m3AF}Ubd=`<>(Xg0har*_@x2YH}bn0Wk*OZz3*e5;Zc;2uBdnl8?&XjupbkOeNZsNh6pvsq_ydmJI+*z**{I{0K)-;p1~k8cpJXL$^t!-`E}=*4G^-E8>H!LjTPxSx zcF+cS`ommfKMhNSbas^@YbTpH1*RFrBuATUR zt{oFWSk^$xU&kbFQ;MCX22RAN5F6eq9UfR$ut`Jw--p2YX)A*J69m^!oYfj2y7NYcH6&r+0~_sH^c^nzeN1AU4Ga7=FlR{S|Mm~MpzY0$Z+p2W(a={b-pR9EO1Rs zB%KY|@wLcAA@)KXi!d2_BxrkhDn`DT1=Dec}V!okd{$+wK z4E{n8R*xKyci1(CnNdhf$Dp2(Jpof0-0%-38X=Dd9PQgT+w%Lshx9+loPS~MOm%ZT zt%2B2iL_KU_ita%N>xjB!#71_3=3c}o zgeW~^U_ZTJQ2!PqXulQd=3b=XOQhwATK$y(9$#1jOQ4}4?~l#&nek)H(04f(Sr=s| zWv7Lu1=%WGk4FSw^;;!8&YPM)pQDCY9DhU`hMty1@sq1=Tj7bFsOOBZOFlpR`W>-J$-(kezWJj;`?x-v>ev{*8V z8p|KXJPV$HyQr1A(9LVrM47u-XpcrIyO`yWvx1pVYc&?154aneRpLqgx)EMvRaa#|9?Wwqs2+W8n5~79G z(}iCiLk;?enn}ew`HzhG+tu+Ru@T+K5juvZN)wY;x6HjvqD!&!)$$;1VAh~7fg0K| zEha#aN=Yv|3^~YFH}cc38ovVb%L|g@9W6fo(JtT6$fa?zf@Ct88e}m?i)b*Jgc{fl zExfdvw-BYDmH6>(4QMt#p0;FUIQqkhD}aH?a7)_%JtA~soqj{ppP_82yi9kaxuK>~ ze_)Zt>1?q=ZH*kF{1iq9sr*tVuy=u>Zev}!gEZx@O6-fjyu9X00gpIl-fS_pzjpqJ z1yqBmf9NF!jaF<+YxgH6oXBdK)sH(>VZ)1siyA$P<#KDt;8NT*l_0{xit~5j1P)FN zI8hhYKhQ)i z37^aP13B~u65?sg+_@2Kr^iWHN=U;EDSZ@2W2!5ALhGNWXnFBY%7W?1 z=HI9JzQ-pLKZDYTv<0-lt|6c-RwhxZ)mU2Os{bsX_i^@*fKUj8*aDO5pks=qn3Dv6 zwggpKLuyRCTVPwmw1r}B#AS}?X7b837UlXwp~E2|PJw2SGVueL7){Y&z!jL!XN=0i zU^Eig`S2`{+gU$68aRdWx?BZ{sU_f=8sn~>s~M?GU~`fH5kCc; z8ICp+INM3(3{#k32RZdv6b9MQYdZXNuk7ed8;G?S2nT+NZBG=Tar^KFl2SvhW$bGW#kdWL-I)s_IqVnCDDM9fm8g;P;8 z7t4yZn3^*NQfx7SwmkzP$=fwdC}bafQSEF@pd&P8@H#`swGy_rz;Z?Ty5mkS%>m#% zp_!m9e<()sfKiY(nF<1zBz&&`ZlJf6QLvLhl`_``%RW&{+O>Xhp;lwSsyRqGf=RWd zpftiR`={2(siiPAS|p}@q=NhVc0ELprt%=fMXO3B)4ryC2LT(o=sLM7hJC!}T1@)E zA3^J$3&1*M6Xq>03FX`R&w*NkrZE?FwU+Muut;>qNhj@bX17ZJxnOlPSZ=Zeiz~T_ zOu#yc3t6ONHB;?|r4w+pI)~KGN;HOGC)txxiUN8#mexj+W(cz%9a4sx|IRG=}ia zuEBuba3AHsV2feqw-3MvuL`I+2|`Ud4~7ZkN=JZ;L20|Oxna5vx1qbIh#k2O4$RQF zo`tL()zxaqibg^GbB+BS5#U{@K;WWQj~GcB1zb}zJkPwH|5hZ9iH2308!>_;%msji zJHSL~s)YHBR=Koa1mLEOHos*`gp=s8KA-C zu0aE+W!#iJ*0xqKm3A`fUGy#O+X+5W36myS>Uh2!R*s$aCU^`K&KKLCCDkejX2p=5 z%o7-fl03x`gaSNyr?3_JLv?2RLS3F*8ub>Jd@^Cc17)v8vYEK4aqo?OS@W9mt%ITJ z9=S2%R8M){CugT@k~~0x`}Vl!svYqX=E)c_oU6o}#Hb^%G1l3BudxA{F*tbjG;W_>=xV73pKY53v%>I)@D36I_@&p$h|Aw zonQS`07z_F#@T-%@-Tb|)7;;anoD_WH>9ewFy(ZcEOM$#Y)8>qi7rCnsH9GO-_7zF zu*C87{Df1P4TEOsnzZ@H%&lvV(3V@;Q!%+OYRp`g05PjY^gL$^$-t0Y>H*CDDs?FZly*oZ&dxvsxaUWF!{em4{A>n@vpXg$dwvt@_rgmHF z-MER`ABa8R-t_H*kv>}CzOpz;!>p^^9ztHMsHL|SRnS<-y5Z*r(_}c4=fXF`l^-i}>e7v!qs_jv zqvWhX^F=2sDNWA9c@P0?lUlr6ecrTKM%pNQ^?*Lq?p-0~?_j50xV%^(+H>sMul#Tw zeciF*1=?a7cI(}352%>LO96pD+?9!fNyl^9v3^v&Y4L)mNGK0FN43&Xf8jUlxW1Bw zyiu2;qW-aGNhs=zbuoxnxiwZ3{PFZM#Kw)9H@(hgX23h(`Wm~m4&TvoZoYp{plb^> z_#?vXcxd>r7K+1HKJvhed>gtK`TAbJUazUWQY6T~t2af%#<+Veyr%7-#*A#@&*;@g58{i|E%6yC_InGXCOd{L0;$)z#?n7M`re zh!kO{6=>7I?*}czyF7_frt#)s1CFJ_XE&VrDA?Dp3XbvF{qsEJgb&OLSNz_5g?HpK z9)8rsr4JN!Af3G9!#Qn(6zaUDqLN(g2g8*M)Djap?WMK9NKlkC)E2|-g|#-rp%!Gz zAHd%`iq|81efi93m3yTBw3g0j#;Yb2X{mhRAI?&KDmbGqou(2xiRNb^sV}%%Wu0?< z?($L>(#BO*)^)rSgyNRni$i`R4v;GhlCZ8$@e^ROX(p=2_v6Y!%^As zu022)fHdv_-~Yu_H6WVPLpHQx!W%^6j)cBhS`O3QBW#x(eX54d&I22op(N59b*&$v zFiSRY6rOc^(dgSV1>a7-5C;(5S5MvKcM2Jm-LD9TGqDpP097%52V+0>Xqq!! zq4e3vj53SE6i8J`XcQB|MZPP8j;PAOnpGnllH6#Ku~vS42xP*Nz@~y%db7Xi8s09P z1)e%8ys6&M8D=Dt6&t`iKG_4X=!kgRQoh%Z`dc&mlOUqXk-k`jKv9@(a^2-Upw>?< zt5*^DV~6Zedbec4NVl($2T{&b)zA@b#dUyd>`2JC0=xa_fIm8{5um zr-!ApXZhC8@=vC2WyxO|!@0Km)h8ep*`^he92$@YwP>VcdoS5OC^s38e#7RPsg4j+ zbVGG}WRSET&ZfrcR(x~k8n1rTP%CnfUNKUonD$P?FtNFF#cn!wEIab-;jU=B1dHK@ z(;(yAQJ`O$sMn>h;pf^8{JISW%d+@v6@CnXh9n5TXGC}?FI9i-D0OMaIg&mAg=0Kn zNJ7oz5*ReJukD55fUsMuaP+H4tDN&V9zfqF@ zr=#ecUk9wu{0;!+gl;3Bw=Vn^)z$ahVhhw)io!na&9}LmWurLb0zubxK=UEnU*{5P z+SP}&*(iBKSO4{alBHaY^)5Q=mZ+2OwIooJ7*Q5XJ+2|q`9#f?6myq!&oz?klihLq z4C)$XP!BNS0G_Z1&TM>?Jk{S~{F3n83ioli=IO6f%wkvCl(RFFw~j0tb{GvXTx>*sB0McY0s&SNvj4+^h`9nJ_wM>F!Uc>X}9PifQekn0sKI2SAJP!a4h z5cyGTuCj3ZBM^&{dRelIlT^9zcfaAuL5Y~bl!ppSf`wZbK$z#6U~rdclk``e+!qhe z6Qspo*%<)eu6?C;Bp<^VuW6JI|Ncvyn+LlSl;Mp22Bl7ARQ0Xc24%29(ZrdsIPw&-=yHQ7_Vle|5h>AST0 zUGX2Zk34vp?U~IHT|;$U86T+UUHl_NE4m|}>E~6q``7hccCaT^#y+?wD##Q%HwPd8 zV3x4L4|qqu`B$4(LXqDJngNy-{&@aFBvVsywt@X^}iH7P%>bR?ciC$I^U-4Foa`YKI^qDyGK7k%E%c_P=yzAi`YnxGA%DeNd++j3*h^ z=rn>oBd0|~lZ<6YvmkKY*ZJlJ;Im0tqgWu&E92eqt;+NYdxx`eS(4Hw_Jb5|yVvBg z*tbdY^!AN;luEyN4VRhS@-_DC{({ziH{&Z}iGElSV~qvT>L-8G%+yEL zX#MFOhj{InyKG=mvW-<1B@c-}x$vA(nU?>S>0*eN#!SLzQ)Ex7fvQ)S4D<8|I#N$3 zT5Ei`Z?cxBODHX8(Xp73v`IsAYC@9b;t}z0wxVuQSY1J^GRwDPN@qbM-ZF48T$GZ< z8WU+;Pqo?{ghI-KZ-i*ydXu`Ep0Xw^McH_KE9J0S7G;x8Fe`DVG?j3Pv=0YzJ}yZR z%2=oqHiUjvuk0~Ca>Kol4CFi0_xQT~;_F?=u+!kIDl-9g`#ZNZ9HCy17Ga1v^Jv9# z{T4Kb1-AzUxq*MutfOWWZgD*HnFfyYg0&e9f(5tZ>krPF6{VikNeHoc{linPPt#Si z&*g>(c54V8rT_AX!J&bNm-!umPvOR}vDai#`CX___J#=zeB*{4<&2WpaDncZsOkp* zsg<%@@rbrMkR_ux9?LsQxzoBa1s%$BBn6vk#{&&zUwcfzeCBJUwFYSF$08qDsB;gWQN*g!p8pxjofWbqNSZOEKOaTx@+* zwdt5*Q47@EOZ~EZL9s?1o?A%9TJT=Ob_13yyugvPg*e&ZU(r6^k4=2+D-@n=Hv5vu zSXG|hM(>h9^zn=eQ=$6`JO&70&2|%V5Lsx>)(%#;pcOfu>*nk_3HB_BNaH$`jM<^S zcSftDU1?nL;jy)+sfonQN}(}gUW?d_ikr*3=^{G)=tjBtEPe>TO|0ddVB zTklrSHiW+!#26frPXQQ(YN8DG$PZo?(po(QUCCf_OJC`pw*uey00%gmH!`WJkrKXj2!#6?`T25mTu9OJp2L8z3! z=arrL$ZqxuE{%yV)14Kd>k}j7pxZ6#$Dz8$@WV5p8kTqN<-7W)Q7Gt2{KoOPK_tZ| zf2WG~O5@{qPI+W<4f_;reuFVdO^5`ADC1!JQE|N`s3cq@(0WB!n0uh@*c{=LAd;~} zyGK@hbF-Oo+!nN)@i*O(`@FA#u?o=~e{`4O#5}z&=UkU*50fOrzi11D^&FOqe>wii z?*k+2|EcUs;Gx{!@KBT~>PAwLrIDT7Th=Utu?~?np@t^gFs?zgX=D${RwOY^WGh-+ z+#4$066ISh8eYW#FXWp~S`<*%O^ZuItL1Tyqt8#tZ zY120E;^VG`!lZn&3sPd$RkdHpU#|w+bYV)pJC|SH9g%|5IkxVTQcBA4CL0}$&}ef@ zW^Vtj%M;;_1xxP9x#ex17&4N*{ksO*_4O}xYu(p*JkL#yr}@7b)t5X?%CY<+s5_MJ zuiqt+N_;A(_)%lumoyRFixWa-M7qK_9s6<1X?JDa9fP!+_6u~~M$5L=ipB=7(j#f< zZ34J%=bs549%~_mA(|={uZNs_0?o7;-LBP(ZRnkd{-^|2|=4vUTmtByHL8 zEph`(LSEzQj68a+`d$V<45J7cyv^#|^|%fD#si1Nx!4NW*`l*{->HEWNh6-|g>-=r zXmQ|-i}Ku$ndUeHQ^&ieT!Lf}vf6GaqW9$DJ2NWrqwPY%%4nip$@vK$nRp*_C-v<| zuKz~ZyN&<%!NS26&x?jhy+@awJipMQ-8(X4#Ae5??U<1QMt1l9R=w9fAnEF}NYu$2 z>6}Vkc zIb*A?G*z8^IvibmBKn_u^5&T_1oey0gZS2~obf(#xk=erZGTEdQnt3DMGM+0oPwss zj5zXD;(oWhB_T@~Ig#9@v)AKtXu3>Inmgf@A|-lD-1U>cNyl3h?ADD9)GG4}zUGPk zZzaXe!~Kf?<~@$G?Uql3t8jy9{2!doq4=J}j9ktTxss{p6!9UdjyDERlA*xZ!=Q)KDs5O)phz>Vq3BNGoM(H|=1*Q4$^2fTZw z(%nq1P|5Rt81}SYJpEEzMPl5VJsV5&4e)ZWKDyoZ>1EwpkHx-AQVQc8%JMz;{H~p{=FXV>jIxvm4X*qv52e?Y-f%DJ zxEA165GikEASQ^fH6K#d!Tpu2HP{sFs%E=e$gYd$aj$+xue6N+Wc(rAz~wUsk2`(b z8Kvmyz%bKQxpP}~baG-rwYcYCvkHOi zlkR<=>ZBTU*8RF_d#Bl@zZsRIhx<%~Z@Z=ik z>adw3!DK(8R|q$vy{FTxw%#xliD~6qXmY^7_9kthVPTF~Xy1CfBqbU~?1QmxmU=+k z(ggxvEuA;0e&+ci-zQR{-f7aO{O(Pz_OsEjLh_K>MbvoZ4nxtk5u{g@nPv)cgW_R} z9}EA4K4@z0?7ue}Z(o~R(X&FjejUI2g~08PH1E4w>9o{)S(?1>Z0XMvTb|;&EuyOE zGvWNpYX)Nv<8|a^;1>bh#&znEcl-r!T#pn= z4$?Yudha6F%4b>*8@=BdtXXY4N+`U4Dmx$}>HeVJk-QdTG@t!tVT#0(LeV0gvqyyw z2sEp^9eY0N`u10Tm4n8No&A=)IeEC|gnmEXoNSzu!1<4R<%-9kY_8~5Ej?zRegMn78wuMs#;i&eUA0Zk_RXQ3b&TT} z;SCI=7-FUB@*&;8|n>(_g^HGf3@QODE3LpmX~ELnymQm{Sx9xrKS zK29p~?v@R$0=v6Dr5aW>-!{+h@?Q58|Kz8{{W`%J+lDAdb&M5VHrX_mDY;1-JLnf)ezmPau$)1;=`-FU=-r-83tX=C`S#}GZufju zQ>sXNT0Ny=k@nc%cFnvA_i4SC)?_ORXHq8B4D%el1uPX`c~uG#S1M7C+*MMqLw78E zhY2dI8@+N^qrMI1+;TUda(vGqGSRyU{Fnm`aqrr7bz42c5xsOO-~oZpkzorD1g}Y<6rk&3>PsSGy}W?MtqFky@A(X# zIuNZK0cK?^=;PUAu>j0#HtjbHCV*6?jzA&OoE$*Jlga*}LF`SF?WLhv1O|zqC<>*> zYB;#lsYKx0&kH@BFpW8n*yDcc6?;_zaJs<-jPSkCsSX-!aV=P5kUgF@Nu<{a%#K*F z134Q{9|YX7X(v$62_cY3^G%t~rD>Q0z@)1|zs)vjJ6Jq9;7#Ki`w+eS**En?7;n&7 zu==V3T&eFboN3ZiMx3D8qYc;VjFUk_H-WWCau(VFXSQf~viH0L$gwD$UfFHqNcgN`x}M+YQ6RnN<+@t>JUp#)9YOkqst-Ga?{FsDpEeX0(5v{0J~SEbWiL zXC2}M4?UH@u&|;%0y`eb33ldo4~z-x8zY!oVmV=c+f$m?RfDC35mdQ2E>Pze7KWP- z>!Bh<&57I+O_^s}9Tg^k)h7{xx@0a0IA~GAOt2yy!X%Q$1rt~LbTB6@Du!_0%HV>N zlf)QI1&gvERKwso23mJ!Ou6ZS#zCS5W`gxE5T>C#E|{i<1D35C222I33?Njaz`On7 zi<+VWFP6D{e-{yiN#M|Jgk<44u1TiMI78S5W`Sdb5f+{zu34s{CfWN7a3Cf^@L%!& zN$?|!!9j2c)j$~+R6n#891w-z8(!oBpL2K=+%a$r2|~8-(vQj5_XT`<0Ksf;oP+tz z9CObS!0m)Tgg`K#xBM8B(|Z)Wb&DYL{WTYv`;A=q6~Nnx2+!lTIXtj8J7dZE!P_{z z#f8w6F}^!?^KE#+ZDv+xd5O&3EmomZzsv?>E-~ygGum45fk!SBN&|eo1rKw^?aZJ4 E2O(~oYXATM literal 0 HcmV?d00001 diff --git a/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000000..8cf6eb5ad2 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew b/samples/client/petstore/kotlin-jvm-volley/gradlew new file mode 100644 index 0000000000..4f906e0c81 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/kotlin-jvm-volley/gradlew.bat b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat new file mode 100644 index 0000000000..107acd32c4 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/samples/client/petstore/kotlin-jvm-volley/settings.gradle b/samples/client/petstore/kotlin-jvm-volley/settings.gradle new file mode 100644 index 0000000000..4e9ddfce00 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/settings.gradle @@ -0,0 +1,2 @@ + +rootProject.name = 'kotlin-petstore-jvm-volley' \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml b/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..90fc37cd89 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt new file mode 100644 index 0000000000..8f17db8b84 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/PetApi.kt @@ -0,0 +1,586 @@ +package org.openapitools.client.apis + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import org.openapitools.client.request.IRequestFactory +import org.openapitools.client.request.RequestFactory +import org.openapitools.client.infrastructure.CollectionFormats.* + +import org.openapitools.client.models.ModelApiResponse +import org.openapitools.client.models.Pet + +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class PetApi ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "http://petstore.swagger.io/v2", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + /** + * Add a new pet to the store + * + * @param body Pet object that needs to be added to the store + * @return void + */ + suspend fun addPet(body: Pet): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf("application/json","application/xml") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Deletes a pet + * + * @param petId Pet id to delete + * @param apiKey + * @return void + */ + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String? = null): Unit { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + "api_key" to IRequestFactory.parameterToString(apiKey), + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.DELETE, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Finds Pets by status + * Multiple status values can be provided with comma separated strings + * @param status Status values that need to be considered for filter + * @return kotlin.collections.List + */ + suspend fun findPetsByStatus(status: CSVParams): kotlin.collections.List? { + val body: Any? = null + // verify the required parameter 'status' is set + // This is probably taken care of by non-null types anyway + requireNotNull(status) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/findByStatus"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + "status" to IRequestFactory.parameterToString(status), + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request> = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Finds Pets by tags + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @param tags Tags to filter by + * @return kotlin.collections.List + */ + @Deprecated("This api was deprecated") + suspend fun findPetsByTags(tags: CSVParams): kotlin.collections.List? { + val body: Any? = null + // verify the required parameter 'tags' is set + // This is probably taken care of by non-null types anyway + requireNotNull(tags) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/findByTags"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + "tags" to IRequestFactory.parameterToString(tags), + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request> = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Find pet by ID + * Returns a single pet + * @param petId ID of pet to return + * @return Pet + */ + suspend fun getPetById(petId: kotlin.Long): Pet? { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Update an existing pet + * + * @param body Pet object that needs to be added to the store + * @return void + */ + suspend fun updatePet(body: Pet): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf("application/json","application/xml") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.PUT, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated + * @param name Updated name of the pet + * @param status Updated status of the pet + * @return void + */ + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String? = null, status: kotlin.String? = null): Unit { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf("application/x-www-form-urlencoded") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + "name" to IRequestFactory.parameterToString(name), + "status" to IRequestFactory.parameterToString(status), + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * uploads an image + * + * @param petId ID of pet to update + * @param additionalMetadata Additional data to pass to server + * @param file file to upload + * @return ModelApiResponse + */ + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String? = null, file: java.io.File? = null): ModelApiResponse? { + val body: Any? = null + // verify the required parameter 'petId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(petId) + + val contentTypes : Array = arrayOf("multipart/form-data") + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/pet/{petId}/uploadImage".replace("{" + "petId" + "}", IRequestFactory.escapeString(petId.toString())); + + // form params + val formParams = mapOf( + "additionalMetadata" to IRequestFactory.parameterToString(additionalMetadata), + "file" to IRequestFactory.parameterToString(file), + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt new file mode 100644 index 0000000000..0d2d7af60d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/StoreApi.kt @@ -0,0 +1,300 @@ +package org.openapitools.client.apis + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import org.openapitools.client.request.IRequestFactory +import org.openapitools.client.request.RequestFactory +import org.openapitools.client.infrastructure.CollectionFormats.* + +import org.openapitools.client.models.Order + +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class StoreApi ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "http://petstore.swagger.io/v2", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + /** + * Delete purchase order by ID + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @param orderId ID of the order that needs to be deleted + * @return void + */ + suspend fun deleteOrder(orderId: kotlin.String): Unit { + val body: Any? = null + // verify the required parameter 'orderId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(orderId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/order/{orderId}".replace("{" + "orderId" + "}", IRequestFactory.escapeString(orderId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.DELETE, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Returns pet inventories by status + * Returns a map of status codes to quantities + * @return kotlin.collections.Map + */ + suspend fun getInventory(): kotlin.collections.Map? { + val body: Any? = null + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/inventory"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener> { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken>() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request> = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Find purchase order by ID + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @param orderId ID of pet that needs to be fetched + * @return Order + */ + suspend fun getOrderById(orderId: kotlin.Long): Order? { + val body: Any? = null + // verify the required parameter 'orderId' is set + // This is probably taken care of by non-null types anyway + requireNotNull(orderId) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/order/{orderId}".replace("{" + "orderId" + "}", IRequestFactory.escapeString(orderId.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Place an order for a pet + * + * @param body order placed for purchasing the pet + * @return Order + */ + suspend fun placeOrder(body: Order): Order? { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/store/order"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt new file mode 100644 index 0000000000..bb7b4e24b1 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/apis/UserApi.kt @@ -0,0 +1,578 @@ +package org.openapitools.client.apis + +import android.content.Context +import com.android.volley.DefaultRetryPolicy +import com.android.volley.Request +import com.android.volley.RequestQueue +import com.android.volley.Response +import com.android.volley.toolbox.BaseHttpStack +import com.android.volley.toolbox.Volley +import java.util.*; +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine +import com.google.gson.reflect.TypeToken + +import org.openapitools.client.request.IRequestFactory +import org.openapitools.client.request.RequestFactory +import org.openapitools.client.infrastructure.CollectionFormats.* + +import org.openapitools.client.models.User + +/* +* If you wish to use a custom http stack with your client you +* can pass that to the request queue like: +* Volley.newRequestQueue(context.applicationContext, myCustomHttpStack) +*/ +class UserApi ( + private val context: Context, + private val requestQueue: Lazy = lazy(initializer = { + Volley.newRequestQueue(context.applicationContext) + }), + private val requestFactory: IRequestFactory = RequestFactory(), + private val basePath: String = "http://petstore.swagger.io/v2", + private val postProcessors :List <(Request<*>) -> Unit> = listOf()) { + + /** + * Create user + * This can only be done by the logged in user. + * @param body Created user object + * @return void + */ + suspend fun createUser(body: User): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + suspend fun createUsersWithArrayInput(body: kotlin.collections.List): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/createWithArray"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Creates list of users with given input array + * + * @param body List of user object + * @return void + */ + suspend fun createUsersWithListInput(body: kotlin.collections.List): Unit { + val body: Any? = body + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/createWithList"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.POST, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Delete user + * This can only be done by the logged in user. + * @param username The name that needs to be deleted + * @return void + */ + suspend fun deleteUser(username: kotlin.String): Unit { + val body: Any? = null + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.DELETE, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. + * @return User + */ + suspend fun getUserByName(username: kotlin.String): User? { + val body: Any? = null + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Logs user into the system + * + * @param username The user name for login + * @param password The password for login in clear text + * @return kotlin.String + */ + suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String? { + val body: Any? = null + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + // verify the required parameter 'password' is set + // This is probably taken care of by non-null types anyway + requireNotNull(password) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/login"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + "username" to IRequestFactory.parameterToString(username), + "password" to IRequestFactory.parameterToString(password), + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Logs out current logged in user session + * + * @return void + */ + suspend fun logoutUser(): Unit { + val body: Any? = null + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/logout"; + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.GET, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } + /** + * Updated user + * This can only be done by the logged in user. + * @param username name that need to be deleted + * @param body Updated user object + * @return void + */ + suspend fun updateUser(username: kotlin.String, body: User): Unit { + val body: Any? = body + // verify the required parameter 'username' is set + // This is probably taken care of by non-null types anyway + requireNotNull(username) + // verify the required parameter 'body' is set + // This is probably taken care of by non-null types anyway + requireNotNull(body) + + val contentTypes : Array = arrayOf() + val contentType: String = if (contentTypes.isNotEmpty()) { contentTypes.first() } else { "application/json" } + + // Do some work or avoid some work based on what we know about the model, + // before we delegate to a pluggable request factory template + // The request factory template contains only pure code and no templates + // to make it easy to override with your own. + + // create path and map variables + val path = "/user/{username}".replace("{" + "username" + "}", IRequestFactory.escapeString(username.toString())); + + // form params + val formParams = mapOf( + ) + + + // TODO: Cater for allowing empty values + // TODO, if its apikey auth, then add the header names here and the hardcoded auth key + // Only support hard coded apikey in query param auth for when we do this first path + val queryParams = mapOf( + ).filter { it.value.isNotEmpty() } + + val headerParams: Map = mapOf( + ) + + return suspendCoroutine { continuation -> + val responseListener = Response.Listener { response -> + continuation.resume(response) + } + + val errorListener = Response.ErrorListener { error -> + continuation.resumeWithException(error) + } + + val responseType = object : TypeToken() {}.type + + // Call the correct request builder based on whether we have a return type or a body. + // All other switching on types must be done in code inside the builder + val request: Request = requestFactory.build( + Request.Method.PUT, + "$basePath$path", + body, + headerParams, + queryParams, + formParams, + contentType, + responseType, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + requestQueue.value.add(request) + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt new file mode 100644 index 0000000000..6120b08192 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt @@ -0,0 +1,33 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException + +class ByteArrayAdapter : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: ByteArray?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(String(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): ByteArray? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return out.nextString().toByteArray() + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt new file mode 100644 index 0000000000..001e99325d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt @@ -0,0 +1,56 @@ +package org.openapitools.client.infrastructure + +class CollectionFormats { + + open class CSVParams { + + var params: List + + constructor(params: List) { + this.params = params + } + + constructor(vararg params: String) { + this.params = listOf(*params) + } + + override fun toString(): String { + return params.joinToString(",") + } + } + + open class SSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString(" ") + } + } + + class TSVParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("\t") + } + } + + class PIPESParams : CSVParams { + + constructor(params: List) : super(params) + + constructor(vararg params: String) : super(*params) + + override fun toString(): String { + return params.joinToString("|") + } + } + + class SPACEParams : SSVParams() +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt new file mode 100644 index 0000000000..21e96af43d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt @@ -0,0 +1,28 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.infrastructure + +import org.openapitools.client.models.room.* + +// TODO ITransformForStorage +interface ITransformForStorage { + fun toRoomModel(): T +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt new file mode 100644 index 0000000000..30ef669718 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDate +import java.time.format.DateTimeFormatter + +class LocalDateAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDate?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDate? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDate.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt new file mode 100644 index 0000000000..3ad781c66c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class LocalDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_LOCAL_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: LocalDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): LocalDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return LocalDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt new file mode 100644 index 0000000000..e615135c9c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt @@ -0,0 +1,35 @@ +package org.openapitools.client.infrastructure + +import com.google.gson.TypeAdapter +import com.google.gson.stream.JsonReader +import com.google.gson.stream.JsonWriter +import com.google.gson.stream.JsonToken.NULL +import java.io.IOException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter + +class OffsetDateTimeAdapter(private val formatter: DateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME) : TypeAdapter() { + @Throws(IOException::class) + override fun write(out: JsonWriter?, value: OffsetDateTime?) { + if (value == null) { + out?.nullValue() + } else { + out?.value(formatter.format(value)) + } + } + + @Throws(IOException::class) + override fun read(out: JsonReader?): OffsetDateTime? { + out ?: return null + + when (out.peek()) { + NULL -> { + out.nextNull() + return null + } + else -> { + return OffsetDateTime.parse(out.nextString(), formatter) + } + } + } +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt new file mode 100644 index 0000000000..d2569559c1 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ApiResponse.kt @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.ApiResponseRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + +data class ApiResponse ( + + @SerializedName("code") + val code: kotlin.Int? = null, + + @SerializedName("type") + val type: kotlin.String? = null, + + @SerializedName("message") + val message: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): ApiResponseRoomModel = + ApiResponseRoomModel(roomTableId = 0, + code = this.code, +type = this.type, +message = this.message, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt new file mode 100644 index 0000000000..8bd167529e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Category.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.CategoryRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A category for a pet + * + * @param id + * @param name + */ + +data class Category ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("name") + val name: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): CategoryRoomModel = + CategoryRoomModel(roomTableId = 0, + id = this.id, +name = this.name, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt new file mode 100644 index 0000000000..9f81f502ed --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/ModelApiResponse.kt @@ -0,0 +1,57 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.ModelApiResponseRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * Describes the result of uploading an image resource + * + * @param code + * @param type + * @param message + */ + +data class ModelApiResponse ( + + @SerializedName("code") + val code: kotlin.Int? = null, + + @SerializedName("type") + val type: kotlin.String? = null, + + @SerializedName("message") + val message: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): ModelApiResponseRoomModel = + ModelApiResponseRoomModel(roomTableId = 0, + code = this.code, +type = this.type, +message = this.message, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt new file mode 100644 index 0000000000..cb48557cd2 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Order.kt @@ -0,0 +1,83 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.OrderRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * An order for a pets from the pet store + * + * @param id + * @param petId + * @param quantity + * @param shipDate + * @param status Order Status + * @param complete + */ + +data class Order ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("petId") + val petId: kotlin.Long? = null, + + @SerializedName("quantity") + val quantity: kotlin.Int? = null, + + @SerializedName("shipDate") + val shipDate: java.time.OffsetDateTime? = null, + + /* Order Status */ + @SerializedName("status") + val status: Order.Status? = null, + + @SerializedName("complete") + val complete: kotlin.Boolean? = false + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): OrderRoomModel = + OrderRoomModel(roomTableId = 0, + id = this.id, +petId = this.petId, +quantity = this.quantity, +shipDate = this.shipDate, +status = this.status, +complete = this.complete, + ) + + /** + * Order Status + * + * Values: placed,approved,delivered + */ + enum class Status(val value: kotlin.String) { + @SerializedName(value = "placed") placed("placed"), + @SerializedName(value = "approved") approved("approved"), + @SerializedName(value = "delivered") delivered("delivered"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt new file mode 100644 index 0000000000..83edfb9c4f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Pet.kt @@ -0,0 +1,85 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + +import org.openapitools.client.models.Category +import org.openapitools.client.models.Tag + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.PetRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A pet for sale in the pet store + * + * @param name + * @param photoUrls + * @param id + * @param category + * @param tags + * @param status pet status in the store + */ + +data class Pet ( + + @SerializedName("name") + val name: kotlin.String, + + @SerializedName("photoUrls") + val photoUrls: kotlin.collections.List, + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("category") + val category: Category? = null, + + @SerializedName("tags") + val tags: kotlin.collections.List? = null, + + /* pet status in the store */ + @SerializedName("status") + val status: Pet.Status? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): PetRoomModel = + PetRoomModel(roomTableId = 0, + name = this.name, +photoUrls = this.photoUrls, +id = this.id, +category = this.category, + +status = this.status, + ) + + /** + * pet status in the store + * + * Values: available,pending,sold + */ + enum class Status(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"); + } +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt new file mode 100644 index 0000000000..03dcdbbaf0 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/Tag.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.TagRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A tag for a pet + * + * @param id + * @param name + */ + +data class Tag ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("name") + val name: kotlin.String? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): TagRoomModel = + TagRoomModel(roomTableId = 0, + id = this.id, +name = this.name, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt new file mode 100644 index 0000000000..c35a2df394 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/User.kt @@ -0,0 +1,83 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import com.google.gson.annotations.SerializedName +import org.openapitools.client.models.room.UserRoomModel +import org.openapitools.client.infrastructure.ITransformForStorage + +/** + * A User who is purchasing from the pet store + * + * @param id + * @param username + * @param firstName + * @param lastName + * @param email + * @param password + * @param phone + * @param userStatus User Status + */ + +data class User ( + + @SerializedName("id") + val id: kotlin.Long? = null, + + @SerializedName("username") + val username: kotlin.String? = null, + + @SerializedName("firstName") + val firstName: kotlin.String? = null, + + @SerializedName("lastName") + val lastName: kotlin.String? = null, + + @SerializedName("email") + val email: kotlin.String? = null, + + @SerializedName("password") + val password: kotlin.String? = null, + + @SerializedName("phone") + val phone: kotlin.String? = null, + + /* User Status */ + @SerializedName("userStatus") + val userStatus: kotlin.Int? = null + +): ITransformForStorage { + companion object { } + override fun toRoomModel(): UserRoomModel = + UserRoomModel(roomTableId = 0, + id = this.id, +username = this.username, +firstName = this.firstName, +lastName = this.lastName, +email = this.email, +password = this.password, +phone = this.phone, +userStatus = this.userStatus, + ) + +} + diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt new file mode 100644 index 0000000000..aa00942c39 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ApiResponseRoomModel.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "ApiResponse") +/** +* Room model for Describes the result of uploading an image resource +* @param code +* @param type +* @param message +*/ +data class ApiResponseRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): ApiResponse = ApiResponse( + code = this.code, + type = this.type, + message = this.message, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt new file mode 100644 index 0000000000..896589516a --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/CategoryRoomModel.kt @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Category") +/** +* Room model for A category for a pet +* @param id +* @param name +*/ +data class CategoryRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var name: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): Category = Category( + id = this.id, + name = this.name, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt new file mode 100644 index 0000000000..87c2114349 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/ModelApiResponseRoomModel.kt @@ -0,0 +1,52 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "ModelApiResponse") +/** +* Room model for Describes the result of uploading an image resource +* @param code +* @param type +* @param message +*/ +data class ModelApiResponseRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var code: kotlin.Int? = null, + var type: kotlin.String? = null, + var message: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): ModelApiResponse = ModelApiResponse( + code = this.code, + type = this.type, + message = this.message, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt new file mode 100644 index 0000000000..5367a0e354 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/OrderRoomModel.kt @@ -0,0 +1,61 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Order") +/** +* Room model for An order for a pets from the pet store +* @param id +* @param petId +* @param quantity +* @param shipDate +* @param status Order Status +* @param complete +*/ +data class OrderRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var petId: kotlin.Long? = null, + var quantity: kotlin.Int? = null, + var shipDate: java.time.OffsetDateTime? = null, + var complete: kotlin.Boolean? = null, + + var status: Order.Status? = null, + ) { + + companion object { } + + fun toApiModel(): Order = Order( + id = this.id, + petId = this.petId, + quantity = this.quantity, + shipDate = this.shipDate, + status = this.status, + complete = this.complete, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt new file mode 100644 index 0000000000..81296bb2f9 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/PetRoomModel.kt @@ -0,0 +1,63 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Pet") +/** +* Room model for A pet for sale in the pet store +* @param name +* @param photoUrls +* @param id +* @param category +* @param tags +* @param status pet status in the store +*/ +data class PetRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + var photoUrls: kotlin.collections.List, + + var name: kotlin.String, + var id: kotlin.Long? = null, + var category: Category? = null, + + var status: Pet.Status? = null, + ) { + + @Ignore + var tags: kotlin.collections.List? = null + + companion object { } + + fun toApiModel(): Pet = Pet( + name = this.name, + photoUrls = this.photoUrls, + id = this.id, + category = this.category, + tags = this.tags, + status = this.status, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt new file mode 100644 index 0000000000..42f255a11f --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/TagRoomModel.kt @@ -0,0 +1,49 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "Tag") +/** +* Room model for A tag for a pet +* @param id +* @param name +*/ +data class TagRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var name: kotlin.String? = null, + + ) { + + companion object { } + + fun toApiModel(): Tag = Tag( + id = this.id, + name = this.name, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt new file mode 100644 index 0000000000..f0c067fc19 --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/models/room/UserRoomModel.kt @@ -0,0 +1,67 @@ +/** + * OpenAPI Petstore + * + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models.room + +import androidx.room.Entity +import androidx.room.Ignore +import androidx.room.PrimaryKey +import org.openapitools.client.models.* + + +@Entity(tableName = "User") +/** +* Room model for A User who is purchasing from the pet store +* @param id +* @param username +* @param firstName +* @param lastName +* @param email +* @param password +* @param phone +* @param userStatus User Status +*/ +data class UserRoomModel ( + @PrimaryKey(autoGenerate = true) var roomTableId: Int, + + var id: kotlin.Long? = null, + var username: kotlin.String? = null, + var firstName: kotlin.String? = null, + var lastName: kotlin.String? = null, + var email: kotlin.String? = null, + var password: kotlin.String? = null, + var phone: kotlin.String? = null, + var userStatus: kotlin.Int? = null, + + ) { + + companion object { } + + fun toApiModel(): User = User( + id = this.id, + username = this.username, + firstName = this.firstName, + lastName = this.lastName, + email = this.email, + password = this.password, + phone = this.phone, + userStatus = this.userStatus, + ) +} diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt new file mode 100644 index 0000000000..965eeae66e --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt @@ -0,0 +1,119 @@ +package org.openapitools.client.request + +import com.android.volley.NetworkResponse +import com.android.volley.ParseError +import com.android.volley.Request +import com.android.volley.Response +import com.android.volley.toolbox.HttpHeaderParser +import com.google.gson.Gson +import com.google.gson.GsonBuilder +import com.google.gson.JsonSyntaxException +import java.io.UnsupportedEncodingException +import java.nio.charset.Charset +import java.net.HttpURLConnection +import java.lang.reflect.Type +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.OffsetDateTime + +import org.openapitools.client.infrastructure.OffsetDateTimeAdapter +import org.openapitools.client.infrastructure.LocalDateTimeAdapter +import org.openapitools.client.infrastructure.LocalDateAdapter +import org.openapitools.client.infrastructure.ByteArrayAdapter + +class GsonRequest( + method: Int, + url: String, + private val body: Any?, + private val headers: Map?, + private val params: MutableMap?, + private val contentTypeForBody: String?, + private val encodingForParams: String?, + private val gsonAdapters: Map?, + private val type: Type, + private val listener: Response.Listener, + errorListener: Response.ErrorListener +) : Request(method, url, errorListener) { + + val gsonBuilder: GsonBuilder = GsonBuilder() + .registerTypeAdapter(OffsetDateTime::class.java, OffsetDateTimeAdapter()) + .registerTypeAdapter(LocalDateTime::class.java, LocalDateTimeAdapter()) + .registerTypeAdapter(LocalDate::class.java, LocalDateAdapter()) + .registerTypeAdapter(ByteArray::class.java, ByteArrayAdapter()) + .apply { + gsonAdapters?.forEach { + this.registerTypeAdapter(it.key, it.value) + } + } + + val gson: Gson by lazy { + gsonBuilder.create() + } + + private var response: NetworkResponse? = null + + override fun deliverResponse(response: T?) { + listener.onResponse(response) + } + + override fun getParams(): MutableMap? = params ?: super.getParams() + + override fun getBodyContentType(): String = contentTypeForBody ?: super.getBodyContentType() + + override fun getParamsEncoding(): String = encodingForParams ?: super.getParamsEncoding() + + override fun getHeaders(): MutableMap { + val combined = HashMap() + combined.putAll(super.getHeaders()) + if (headers != null) { + combined.putAll(headers) + } + return combined + } + + override fun getBody(): ByteArray? { + if (body != null) { + return gson.toJson(body).toByteArray(Charsets.UTF_8) + } + return super.getBody() + } + + override fun parseNetworkResponse(response: NetworkResponse?): Response { + return try { + this.response = copyTo(response) + val json = String( + response?.data ?: ByteArray(0), + Charset.forName(HttpHeaderParser.parseCharset(response?.headers)) + ) + Response.success( + gson.fromJson(json, type), + HttpHeaderParser.parseCacheHeaders(response) + ) + } catch (e: UnsupportedEncodingException) { + Response.error(ParseError(e)) + } catch (e: JsonSyntaxException) { + Response.error(ParseError(e)) + } + } + + private fun copyTo(response: NetworkResponse?): NetworkResponse { + return if (response != null) { + NetworkResponse( + response.statusCode, + response.data, + response.notModified, + response.networkTimeMs, + response.allHeaders + ) + } else { + // Return an empty response. + NetworkResponse( + HttpURLConnection.HTTP_BAD_METHOD, + ByteArray(0), + false, + 0, + emptyList() + ) + } + } +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt new file mode 100644 index 0000000000..599db0bc0d --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt @@ -0,0 +1,64 @@ +package org.openapitools.client.request + +import com.android.volley.Request +import com.android.volley.Response +import java.io.UnsupportedEncodingException +import java.lang.reflect.Type +import java.net.URLEncoder +import java.text.ParseException +import java.text.SimpleDateFormat +import java.util.* +import java.time.format.DateTimeFormatter +import java.time.OffsetDateTime +import java.time.LocalDate + + +interface IRequestFactory { + + companion object { + /** + * ISO 8601 date time format. + * @see https://en.wikipedia.org/wiki/ISO_8601 + */ + fun formatDateTime(datetime: OffsetDateTime) = DateTimeFormatter.ISO_INSTANT.format(datetime) + fun formatDate(date: LocalDate) = DateTimeFormatter.ISO_LOCAL_DATE.format(date) + + fun escapeString(str: String): String { + return try { + URLEncoder.encode(str, "UTF-8") + } catch (e: UnsupportedEncodingException) { + str + } + } + + fun parameterToString(param: Any?) = + when (param) { + null -> "" + is OffsetDateTime -> formatDateTime(param) + is Collection<*> -> { + val b = StringBuilder() + for (o in param) { + if (b.isNotEmpty()) { + b.append(",") + } + b.append(o.toString()) + } + b.toString() + } + else -> param.toString() + } + } + + + fun build( + method: Int, + url : String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener): Request +} \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt new file mode 100644 index 0000000000..2bcf9d2d9c --- /dev/null +++ b/samples/client/petstore/kotlin-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt @@ -0,0 +1,87 @@ +// Knowing the details of an operation it will produce a call to a Volley Request constructor +package org.openapitools.client.request + + +import com.android.volley.Request +import com.android.volley.Response +import android.util.Base64 +import org.openapitools.client.request.IRequestFactory.Companion.escapeString +import java.lang.reflect.Type +import java.util.Locale +import java.util.UUID + +class RequestFactory(private val headerFactories : List<() -> Map> = listOf(), private val postProcessors :List <(Request<*>) -> Unit> = listOf(), private val gsonAdapters: Map = mapOf()): IRequestFactory { + + companion object Authentication { + // Where a header factory requires parameters a client will need to bind these + // TODO Generate appropriate header factories based on settings + // Api Key auth supports query header and cookie. + // Query is supported in the path generation only with a hardcoded value. + // TODO: Not sure about cookie auth form + // If implementing api key in query parameter use the ^isKeyInHeader property + + val apiKeyAuthHeaderFactoryBuilder = { + paramName: String, apiKeyPrefix: String?, apiKey: String? -> { + mapOf(paramName to + if (apiKeyPrefix != null) { + "$apiKeyPrefix $apiKey" + } else { + apiKey!! + } + ) + } + } + + // TODO: Oauth not implemented yet - comment out below as OAuth does not exist + } + + + /** + * {@inheritDoc} + */ + @Suppress("UNCHECKED_CAST") + override fun build( + method: Int, + url: String, + body: Any?, + headers: Map?, + queryParams: Map?, + formParams: Map?, + contentTypeForBody: String?, + type: Type, + responseListener: Response.Listener, + errorListener: Response.ErrorListener + ): Request { + val afterMarketHeaders = (headers?.toMutableMap() ?: mutableMapOf()) + // Factory built and aftermarket + // Merge the after market headers on top of the base ones in case we are overriding per call auth + val allHeaders = headerFactories.fold(afterMarketHeaders) { acc, factory -> (acc + factory.invoke()).toMutableMap() } + + // If we decide to support auth parameters in the url, then you will reference them by supplying a url string + // with known variable name refernces in the string. We will then apply + val updatedUrl = if (!queryParams.isNullOrEmpty()) { + queryParams.asSequence().fold("$url?") {acc, param -> + "$acc${escapeString(param.key)}=${escapeString(param.value)}&" + }.trimEnd('&') + } else { + url + } + + val request = GsonRequest( + method, + updatedUrl, + body, + allHeaders, + formParams?.toMutableMap(), + contentTypeForBody, + null, + gsonAdapters, + type, + responseListener, + errorListener) + + postProcessors.forEach{ it.invoke(request)} + + return request + } +} From 1757c4d2ea8a2570bd616609ab7348e7183bd333 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Mon, 20 Dec 2021 17:44:18 +0800 Subject: [PATCH 38/54] Test kotlin volley sample in the CI (#11156) * test kotlin volley sample in the ci * update samples * Revert "update samples" This reverts commit 9a0da130760a4a597e4ceef59d1538594893f724. --- .github/workflows/samples-kotlin.yaml | 1 + README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/samples-kotlin.yaml b/.github/workflows/samples-kotlin.yaml index d1d812cbad..83d748e9f0 100644 --- a/.github/workflows/samples-kotlin.yaml +++ b/.github/workflows/samples-kotlin.yaml @@ -29,6 +29,7 @@ jobs: # needs Android configured #- samples/client/petstore/kotlin-json-request-string - samples/client/petstore/kotlin-jvm-okhttp4-coroutines + - samples/client/petstore/kotlin-jvm-volley - samples/client/petstore/kotlin-moshi-codegen - samples/client/petstore/kotlin-multiplatform - samples/client/petstore/kotlin-nonpublic diff --git a/README.md b/README.md index 804104dd96..8995481136 100644 --- a/README.md +++ b/README.md @@ -917,6 +917,7 @@ Here is a list of template creators: * JMeter: @davidkiss * Kotlin: @jimschubert [:heart:](https://www.patreon.com/jimschubert) * Kotlin (MultiPlatform): @andrewemery + * Kotlin (Volley): @alisters * Lua: @daurnimator * Nim: @hokamoto * OCaml: @cgensoul From c305c71715652fc2075122534fa049a28f750ff3 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@users.noreply.github.com> Date: Tue, 21 Dec 2021 07:40:13 +0000 Subject: [PATCH 39/54] [DefaultCodegen] generate unknown default case (#11078) * [DefaultCodegen] generate unknown default case * [DefaultCodegen] replace Swift custom implementation with the DefaultCodegen implementation * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case * [DefaultCodegen] update docs * [DefaultCodegen] fix Swift enum case name * [DefaultCodegen] generate unknown default case * [DefaultCodegen] generate unknown default case --- bin/configs/kotlin-enum-default-value.yaml | 1 + bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml | 1 + bin/configs/swift5-frozenEnums.yaml | 2 +- docs/generators/ada-server.md | 1 + docs/generators/ada.md | 1 + docs/generators/android.md | 1 + docs/generators/apache2.md | 1 + docs/generators/apex.md | 1 + docs/generators/asciidoc.md | 1 + docs/generators/avro-schema.md | 1 + docs/generators/bash.md | 1 + docs/generators/c.md | 1 + docs/generators/clojure.md | 1 + docs/generators/cpp-qt-client.md | 1 + docs/generators/cpp-qt-qhttpengine-server.md | 1 + docs/generators/cpp-tiny.md | 1 + docs/generators/cpp-tizen.md | 1 + docs/generators/cpp-ue4.md | 1 + docs/generators/crystal.md | 1 + docs/generators/cwiki.md | 1 + docs/generators/dart-dio-next.md | 1 + docs/generators/dart-dio.md | 1 + docs/generators/dart-jaguar.md | 1 + docs/generators/dart.md | 1 + docs/generators/dynamic-html.md | 1 + docs/generators/elixir.md | 1 + docs/generators/fsharp-functions.md | 1 + docs/generators/groovy.md | 1 + docs/generators/haskell-http-client.md | 1 + docs/generators/haskell-yesod.md | 1 + docs/generators/haskell.md | 1 + docs/generators/html.md | 1 + docs/generators/html2.md | 1 + docs/generators/java-inflector.md | 1 + docs/generators/java-micronaut-client.md | 1 + docs/generators/java-msf4j.md | 1 + docs/generators/java-pkmst.md | 1 + docs/generators/java-play-framework.md | 1 + docs/generators/java-undertow-server.md | 1 + docs/generators/java-vertx-web.md | 1 + docs/generators/java-vertx.md | 1 + docs/generators/java.md | 1 + docs/generators/javascript-apollo.md | 1 + docs/generators/javascript-closure-angular.md | 1 + docs/generators/javascript-flowtyped.md | 1 + docs/generators/javascript.md | 1 + docs/generators/jaxrs-cxf-cdi.md | 1 + docs/generators/jaxrs-cxf-client.md | 1 + docs/generators/jaxrs-cxf-extended.md | 1 + docs/generators/jaxrs-cxf.md | 1 + docs/generators/jaxrs-jersey.md | 1 + docs/generators/jaxrs-resteasy-eap.md | 1 + docs/generators/jaxrs-resteasy.md | 1 + docs/generators/jaxrs-spec.md | 1 + docs/generators/jmeter.md | 1 + docs/generators/k6.md | 1 + docs/generators/markdown.md | 1 + docs/generators/nim.md | 1 + docs/generators/nodejs-express-server.md | 1 + docs/generators/ocaml.md | 1 + docs/generators/openapi-yaml.md | 1 + docs/generators/openapi.md | 1 + docs/generators/php-dt.md | 1 + docs/generators/php-laravel.md | 1 + docs/generators/php-lumen.md | 1 + docs/generators/php-mezzio-ph.md | 1 + docs/generators/php-silex-deprecated.md | 1 + docs/generators/php-slim-deprecated.md | 1 + docs/generators/php-slim4.md | 1 + docs/generators/php-symfony.md | 1 + docs/generators/php.md | 1 + docs/generators/plantuml.md | 1 + docs/generators/python-aiohttp.md | 1 + docs/generators/python-blueplanet.md | 1 + docs/generators/python-fastapi.md | 1 + docs/generators/python-flask.md | 1 + docs/generators/ruby.md | 1 + docs/generators/scala-akka-http-server.md | 1 + docs/generators/scala-akka.md | 1 + docs/generators/scala-gatling.md | 1 + .../generators/scala-httpclient-deprecated.md | 1 + docs/generators/scala-lagom-server.md | 1 + docs/generators/scala-play-server.md | 1 + docs/generators/scala-sttp.md | 1 + docs/generators/scalatra.md | 1 + docs/generators/scalaz.md | 1 + docs/generators/spring.md | 1 + docs/generators/swift4-deprecated.md | 1 + docs/generators/swift5.md | 2 +- docs/generators/typescript-angular.md | 1 + .../typescript-angularjs-deprecated.md | 1 + docs/generators/typescript-aurelia.md | 1 + docs/generators/typescript-axios.md | 1 + docs/generators/typescript-fetch.md | 1 + docs/generators/typescript-inversify.md | 1 + docs/generators/typescript-jquery.md | 1 + docs/generators/typescript-nestjs.md | 1 + docs/generators/typescript-node.md | 1 + docs/generators/typescript-redux-query.md | 1 + docs/generators/typescript-rxjs.md | 1 + docs/generators/typescript.md | 1 + docs/generators/wsdl-schema.md | 1 + .../codegen/CodegenConstants.java | 6 + .../openapitools/codegen/DefaultCodegen.java | 55 +++++++ .../languages/KotlinClientCodegen.java | 3 + .../languages/Swift5ClientCodegen.java | 22 +-- .../infrastructure/Serializer.kt.mustache | 6 + .../SerializerHelper.kt.mustache | 50 ++++++ .../libraries/jvm-okhttp/api.mustache | 86 +++++++++- .../src/main/resources/swift5/api.mustache | 11 ++ .../main/resources/swift5/modelEnum.mustache | 27 +--- .../modelInlineEnumDeclaration.mustache | 30 +--- .../codegen/bash/BashClientOptionsTest.java | 1 + .../codegen/dart/DartClientOptionsTest.java | 1 + .../dart/dio/DartDioClientOptionsTest.java | 1 + .../dio/DartDioNextClientOptionsTest.java | 1 + .../elixir/ElixirClientOptionsTest.java | 1 + .../HaskellServantOptionsTest.java | 1 + .../HaskellYesodServerOptionsTest.java | 1 + .../lumen/PhpLumenServerOptionsTest.java | 1 + .../options/BashClientOptionsProvider.java | 2 + .../options/DartClientOptionsProvider.java | 2 + .../options/DartDioClientOptionsProvider.java | 2 + .../DartDioNextClientOptionsProvider.java | 2 + .../options/ElixirClientOptionsProvider.java | 2 + .../HaskellServantOptionsProvider.java | 2 + .../HaskellYesodServerOptionsProvider.java | 2 + .../options/PhpClientOptionsProvider.java | 2 + .../PhpLumenServerOptionsProvider.java | 2 + .../PhpSilexServerOptionsProvider.java | 2 + .../PhpSlim4ServerOptionsProvider.java | 2 + .../options/PhpSlimServerOptionsProvider.java | 2 + .../options/RubyClientOptionsProvider.java | 2 + .../ScalaAkkaClientOptionsProvider.java | 2 + .../ScalaHttpClientOptionsProvider.java | 2 + .../options/Swift4OptionsProvider.java | 93 ----------- .../options/Swift5OptionsProvider.java | 4 +- ...ypeScriptAngularClientOptionsProvider.java | 2 + ...eScriptAngularJsClientOptionsProvider.java | 2 + ...ypeScriptAureliaClientOptionsProvider.java | 2 + .../TypeScriptFetchClientOptionsProvider.java | 2 + ...TypeScriptNestjsClientOptionsProvider.java | 2 + .../TypeScriptNodeClientOptionsProvider.java | 2 + .../codegen/php/PhpClientOptionsTest.java | 1 + .../codegen/ruby/RubyClientOptionsTest.java | 1 + .../scalaakka/ScalaAkkaClientOptionsTest.java | 1 + .../ScalaHttpClientOptionsTest.java | 1 + .../silex/PhpSilexServerOptionsTest.java | 1 + .../slim/PhpSlimServerOptionsTest.java | 1 + .../slim4/PhpSlim4ServerOptionsTest.java | 1 + .../codegen/swift4/Swift4CodegenTest.java | 147 ------------------ .../codegen/swift4/Swift4ModelEnumTest.java | 133 ---------------- .../codegen/swift4/Swift4ModelTest.java | 125 --------------- .../codegen/swift4/Swift4OptionsTest.java | 52 ------- .../codegen/swift5/Swift5OptionsTest.java | 2 +- .../TypeScriptAureliaClientOptionsTest.java | 1 + .../TypeScriptFetchClientOptionsTest.java | 1 + .../TypeScriptAngularClientOptionsTest.java | 1 + .../TypeScriptAngularJsClientOptionsTest.java | 1 + .../TypeScriptNestjsClientOptionsTest.java | 1 + .../TypeScriptNodeClientOptionsTest.java | 1 + .../.openapi-generator/FILES | 1 + .../openapitools/client/apis/DefaultApi.kt | 2 + .../client/infrastructure/Serializer.kt | 2 + .../client/infrastructure/SerializerHelper.kt | 12 ++ .../ModelWithEnumPropertyHavingDefault.kt | 5 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 6 +- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../kotlin-okhttp3/.openapi-generator/FILES | 1 + .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../client/infrastructure/Serializer.kt | 2 + .../client/infrastructure/SerializerHelper.kt | 14 ++ .../org/openapitools/client/models/Order.kt | 5 +- .../org/openapitools/client/models/Pet.kt | 5 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../org/openapitools/client/apis/EnumApi.kt | 2 + .../org/openapitools/client/apis/PetApi.kt | 22 ++- .../org/openapitools/client/apis/StoreApi.kt | 2 + .../org/openapitools/client/apis/UserApi.kt | 4 +- .../Classes/OpenAPIs/Models/EnumArrays.swift | 12 +- .../Classes/OpenAPIs/Models/EnumClass.swift | 6 +- .../Classes/OpenAPIs/Models/EnumTest.swift | 34 +--- .../Classes/OpenAPIs/Models/MapTest.swift | 6 +- .../Classes/OpenAPIs/Models/Order.swift | 6 +- .../Classes/OpenAPIs/Models/OuterEnum.swift | 6 +- .../Classes/OpenAPIs/Models/Pet.swift | 6 +- 212 files changed, 674 insertions(+), 764 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java delete mode 100644 modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java create mode 100644 samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt create mode 100644 samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt diff --git a/bin/configs/kotlin-enum-default-value.yaml b/bin/configs/kotlin-enum-default-value.yaml index 3d8c9f57a8..ddb00c5528 100644 --- a/bin/configs/kotlin-enum-default-value.yaml +++ b/bin/configs/kotlin-enum-default-value.yaml @@ -6,3 +6,4 @@ additionalProperties: artifactId: kotlin-enum-default-value serializableModel: "true" dateLibrary: java8 + enumUnknownDefaultCase: true diff --git a/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml b/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml index f8be34a2f0..13baa85c9a 100644 --- a/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml +++ b/bin/configs/kotlin-jvm-okhttp3-okhttp3.yaml @@ -5,3 +5,4 @@ inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml templateDir: modules/openapi-generator/src/main/resources/kotlin-client additionalProperties: artifactId: kotlin-petstore-okhttp3 + enumUnknownDefaultCase: true diff --git a/bin/configs/swift5-frozenEnums.yaml b/bin/configs/swift5-frozenEnums.yaml index 64dc04a4f8..38ca413f35 100644 --- a/bin/configs/swift5-frozenEnums.yaml +++ b/bin/configs/swift5-frozenEnums.yaml @@ -7,6 +7,6 @@ additionalProperties: podAuthors: "" podSummary: PetstoreClient sortParamsByRequiredFlag: false - generateFrozenEnums: false + enumUnknownDefaultCase: true projectName: PetstoreClient podHomepage: https://github.com/openapitools/openapi-generator diff --git a/docs/generators/ada-server.md b/docs/generators/ada-server.md index 237bb29682..f88751432c 100644 --- a/docs/generators/ada-server.md +++ b/docs/generators/ada-server.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|

          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| diff --git a/docs/generators/ada.md b/docs/generators/ada.md index 06e4052431..3c08371fe2 100644 --- a/docs/generators/ada.md +++ b/docs/generators/ada.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|GNAT project name| |defaultProject| diff --git a/docs/generators/android.md b/docs/generators/android.md index f2c6442c6e..12e99f75cf 100644 --- a/docs/generators/android.md +++ b/docs/generators/android.md @@ -16,6 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version for use in the generated build.gradle and pom.xml| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |groupId|groupId for use in the generated build.gradle and pom.xml| |null| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/apache2.md b/docs/generators/apache2.md index 8e02718be2..0db25b032c 100644 --- a/docs/generators/apache2.md +++ b/docs/generators/apache2.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/apex.md b/docs/generators/apex.md index f5179a9d7e..89dfd44654 100644 --- a/docs/generators/apex.md +++ b/docs/generators/apex.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |classPrefix|Prefix for generated classes. Set this to avoid overwriting existing classes in your org.| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |namedCredential|The named credential name for the HTTP callouts| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/asciidoc.md b/docs/generators/asciidoc.md index 0e309aa541..80f949644c 100644 --- a/docs/generators/asciidoc.md +++ b/docs/generators/asciidoc.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |groupId|groupId in generated pom.xml| |null| |headerAttributes|generation of asciidoc header meta data attributes (set to false to suppress, default: true)| |true| |infoEmail|an email address to contact for inquiries about the application| |null| diff --git a/docs/generators/avro-schema.md b/docs/generators/avro-schema.md index 2637a92274..cbb7dd6e3f 100644 --- a/docs/generators/avro-schema.md +++ b/docs/generators/avro-schema.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |packageName|package for generated classes (where supported)| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/bash.md b/docs/generators/bash.md index a8d3fe1693..590f535c54 100644 --- a/docs/generators/bash.md +++ b/docs/generators/bash.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |curlOptions|Default cURL options| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |generateBashCompletion|Whether to generate the Bash completion script| |false| |generateZshCompletion|Whether to generate the Zsh completion script| |false| |hostEnvironmentVariable|Name of environment variable where host can be defined (e.g. PETSTORE_HOST='http://api.openapitools.org:8080')| |null| diff --git a/docs/generators/c.md b/docs/generators/c.md index 98f84c4587..c6e5c35372 100644 --- a/docs/generators/c.md +++ b/docs/generators/c.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/clojure.md b/docs/generators/clojure.md index f5fce29a05..cf7b0c3bc0 100644 --- a/docs/generators/clojure.md +++ b/docs/generators/clojure.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |baseNamespace|the base/top namespace (Default: generated from projectName)| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectDescription|description of the project (Default: using info.description or "Client library of <projectName>")| |null| diff --git a/docs/generators/cpp-qt-client.md b/docs/generators/cpp-qt-client.md index 96be28abb0..4bb53da53f 100644 --- a/docs/generators/cpp-qt-client.md +++ b/docs/generators/cpp-qt-client.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |optionalProjectFile|Generate client.pri.| |true| diff --git a/docs/generators/cpp-qt-qhttpengine-server.md b/docs/generators/cpp-qt-qhttpengine-server.md index efd57d28d7..6126b80c25 100644 --- a/docs/generators/cpp-qt-qhttpengine-server.md +++ b/docs/generators/cpp-qt-qhttpengine-server.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelNamePrefix|Prefix that will be prepended to all model names.| |OAI| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/cpp-tiny.md b/docs/generators/cpp-tiny.md index 1c90b5cbe8..4da8351e58 100644 --- a/docs/generators/cpp-tiny.md +++ b/docs/generators/cpp-tiny.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |controller|name of microcontroller (e.g esp32 or esp8266)| |esp32| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| diff --git a/docs/generators/cpp-tizen.md b/docs/generators/cpp-tizen.md index c38ec6f5e5..7f5b106c04 100644 --- a/docs/generators/cpp-tizen.md +++ b/docs/generators/cpp-tizen.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |reservedWordPrefix|Prefix to prepend to reserved words in order to avoid conflicts| |r_| diff --git a/docs/generators/cpp-ue4.md b/docs/generators/cpp-ue4.md index b41a208e0e..be06301a99 100644 --- a/docs/generators/cpp-ue4.md +++ b/docs/generators/cpp-ue4.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |cppNamespace|C++ namespace (convention: name::space::for::api).| |OpenAPI| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |optionalProjectFile|Generate Build.cs| |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/crystal.md b/docs/generators/crystal.md index 93a893215c..b79135246b 100644 --- a/docs/generators/crystal.md +++ b/docs/generators/crystal.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/cwiki.md b/docs/generators/cwiki.md index 0c09a33293..d10f1d303e 100644 --- a/docs/generators/cwiki.md +++ b/docs/generators/cwiki.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| diff --git a/docs/generators/dart-dio-next.md b/docs/generators/dart-dio-next.md index d644e35b04..869645f7da 100644 --- a/docs/generators/dart-dio-next.md +++ b/docs/generators/dart-dio-next.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Specify Date library|
          **core**
          [DEFAULT] Dart core library (DateTime)
          **timemachine**
          Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
          |core| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| diff --git a/docs/generators/dart-dio.md b/docs/generators/dart-dio.md index 9368dc7e7f..e3b6ac9563 100644 --- a/docs/generators/dart-dio.md +++ b/docs/generators/dart-dio.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **core**
          Dart core library (DateTime)
          **timemachine**
          Time Machine is date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.
          |core| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |nullableFields|Make all fields nullable in the JSON payload| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/dart-jaguar.md b/docs/generators/dart-jaguar.md index 068b5728f0..769fa166da 100644 --- a/docs/generators/dart-jaguar.md +++ b/docs/generators/dart-jaguar.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |nullableFields|Is the null fields should be in the JSON payload| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/dart.md b/docs/generators/dart.md index cb783be681..73f113808b 100644 --- a/docs/generators/dart.md +++ b/docs/generators/dart.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |pubAuthor|Author name in generated pubspec| |null| diff --git a/docs/generators/dynamic-html.md b/docs/generators/dynamic-html.md index 6c0076fc7f..771cecc8b1 100644 --- a/docs/generators/dynamic-html.md +++ b/docs/generators/dynamic-html.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |groupId|groupId in generated pom.xml| |null| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/elixir.md b/docs/generators/elixir.md index cb8bd35d33..543f116ddb 100644 --- a/docs/generators/elixir.md +++ b/docs/generators/elixir.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay.Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |licenseHeader|The license header to prepend to the top of all source files.| |null| diff --git a/docs/generators/fsharp-functions.md b/docs/generators/fsharp-functions.md index bb16f39fa7..de363c1ca6 100644 --- a/docs/generators/fsharp-functions.md +++ b/docs/generators/fsharp-functions.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |licenseName|The name of the license| |NoLicense| |licenseUrl|The URL of the license| |http://localhost| diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md index 858464a52e..96df596870 100644 --- a/docs/generators/groovy.md +++ b/docs/generators/groovy.md @@ -24,6 +24,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/haskell-http-client.md b/docs/generators/haskell-http-client.md index 0e8a667446..f287982ab7 100644 --- a/docs/generators/haskell-http-client.md +++ b/docs/generators/haskell-http-client.md @@ -21,6 +21,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateTimeParseFormat|overrides the format string used to parse a datetime| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |generateEnums|Generate specific datatypes for OpenAPI enums| |true| |generateFormUrlEncodedInstances|Generate FromForm/ToForm instances for models that are used by operations that produce or consume application/x-www-form-urlencoded| |true| |generateLenses|Generate Lens optics for Models| |true| diff --git a/docs/generators/haskell-yesod.md b/docs/generators/haskell-yesod.md index 415a6f0062..e4f8bd5a36 100644 --- a/docs/generators/haskell-yesod.md +++ b/docs/generators/haskell-yesod.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiModuleName|name of the API module (Default: generated from info.title or "API")| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |projectName|name of the project (Default: generated from info.title or "openapi-haskell-yesod-server")| |null| diff --git a/docs/generators/haskell.md b/docs/generators/haskell.md index 5ce44c462a..75dfe15ca5 100644 --- a/docs/generators/haskell.md +++ b/docs/generators/haskell.md @@ -11,6 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiPackage|package for generated api classes| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/html.md b/docs/generators/html.md index 225daac754..0ece134692 100644 --- a/docs/generators/html.md +++ b/docs/generators/html.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| diff --git a/docs/generators/html2.md b/docs/generators/html2.md index e69d26edf6..40dc30a42e 100644 --- a/docs/generators/html2.md +++ b/docs/generators/html2.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|artifact version in generated pom.xml. This also becomes part of the generated library's filename| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |groupId|groupId in generated pom.xml| |null| |infoEmail|an email address to contact for inquiries about the application| |null| |infoUrl|a URL where users can get more information about the application| |null| diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md index bb4d9dbb23..309bc1a3db 100644 --- a/docs/generators/java-inflector.md +++ b/docs/generators/java-inflector.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md index 95e4cf76c3..98ce5396a9 100644 --- a/docs/generators/java-micronaut-client.md +++ b/docs/generators/java-micronaut-client.md @@ -28,6 +28,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md index cddf3dde0b..d3a7aa4bd2 100644 --- a/docs/generators/java-msf4j.md +++ b/docs/generators/java-msf4j.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md index 073b381962..1f7b1f7e26 100644 --- a/docs/generators/java-pkmst.md +++ b/docs/generators/java-pkmst.md @@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |eurekaUri|Eureka URI| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |com.prokarma| diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md index f7bf3373c7..851e0c567a 100644 --- a/docs/generators/java-play-framework.md +++ b/docs/generators/java-play-framework.md @@ -29,6 +29,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true| diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md index 77d069151b..f240e94909 100644 --- a/docs/generators/java-undertow-server.md +++ b/docs/generators/java-undertow-server.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md index 1c14df7a90..0113598776 100644 --- a/docs/generators/java-vertx-web.md +++ b/docs/generators/java-vertx-web.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md index 78b0508c01..435c1a1226 100644 --- a/docs/generators/java-vertx.md +++ b/docs/generators/java-vertx.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/java.md b/docs/generators/java.md index 4d086325a0..9f432edc97 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -30,6 +30,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |dynamicOperations|Generate operations dynamically at runtime from an OAS| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |errorObjectType|Error Object type. (This option is for okhttp-gson-next-gen only)| |null| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |gradleProperties|Append additional Gradle proeprties to the gradle.properties file| |null| diff --git a/docs/generators/javascript-apollo.md b/docs/generators/javascript-apollo.md index 44a7ccac56..260fc98094 100644 --- a/docs/generators/javascript-apollo.md +++ b/docs/generators/javascript-apollo.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |emitJSDoc|generate JSDoc comments| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/javascript-closure-angular.md b/docs/generators/javascript-closure-angular.md index 8d9c3b14a1..891b35cb93 100644 --- a/docs/generators/javascript-closure-angular.md +++ b/docs/generators/javascript-closure-angular.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/javascript-flowtyped.md b/docs/generators/javascript-flowtyped.md index 51ac05927d..a6fcea0533 100644 --- a/docs/generators/javascript-flowtyped.md +++ b/docs/generators/javascript-flowtyped.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/javascript.md b/docs/generators/javascript.md index a0bb2d24c9..962b9ffc40 100644 --- a/docs/generators/javascript.md +++ b/docs/generators/javascript.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |emitJSDoc|generate JSDoc comments| |true| |emitModelMethods|generate getters and setters for model properties| |false| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|root package for generated code| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md index b604285fdb..621f0dc3a7 100644 --- a/docs/generators/jaxrs-cxf-cdi.md +++ b/docs/generators/jaxrs-cxf-cdi.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateBuilders|Whether to generate builders for models.| |false| |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md index 36393f588a..ad1c609003 100644 --- a/docs/generators/jaxrs-cxf-client.md +++ b/docs/generators/jaxrs-cxf-client.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md index b8e1da7361..0eef8cacd4 100644 --- a/docs/generators/jaxrs-cxf-extended.md +++ b/docs/generators/jaxrs-cxf-extended.md @@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |generateNonSpringApplication|Generate non-Spring application| |false| diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md index 5958bcdd2e..80b178858a 100644 --- a/docs/generators/jaxrs-cxf.md +++ b/docs/generators/jaxrs-cxf.md @@ -27,6 +27,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |generateNonSpringApplication|Generate non-Spring application| |false| diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md index 076d72881e..15584410d1 100644 --- a/docs/generators/jaxrs-jersey.md +++ b/docs/generators/jaxrs-jersey.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false| diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md index ed99a6037e..247353cbb3 100644 --- a/docs/generators/jaxrs-resteasy-eap.md +++ b/docs/generators/jaxrs-resteasy-eap.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md index e7e1a5fd22..ff9fab072f 100644 --- a/docs/generators/jaxrs-resteasy.md +++ b/docs/generators/jaxrs-resteasy.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false| |groupId|groupId in generated pom.xml| |org.openapitools| diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md index 3f7e3c6de5..621122f6ea 100644 --- a/docs/generators/jaxrs-spec.md +++ b/docs/generators/jaxrs-spec.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |generateBuilders|Whether to generate builders for models.| |false| |generatePom|Whether to generate pom.xml if the file does not already exist.| |true| diff --git a/docs/generators/jmeter.md b/docs/generators/jmeter.md index 1618e2c1ad..71584a1e79 100644 --- a/docs/generators/jmeter.md +++ b/docs/generators/jmeter.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/k6.md b/docs/generators/k6.md index 4c0e735816..529527a890 100644 --- a/docs/generators/k6.md +++ b/docs/generators/k6.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/markdown.md b/docs/generators/markdown.md index 8d7cb99838..4d87a35f96 100644 --- a/docs/generators/markdown.md +++ b/docs/generators/markdown.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/nim.md b/docs/generators/nim.md index 23957ff2d5..3d90efad15 100644 --- a/docs/generators/nim.md +++ b/docs/generators/nim.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/nodejs-express-server.md b/docs/generators/nodejs-express-server.md index a96fa3ec24..9fffa3c28b 100644 --- a/docs/generators/nodejs-express-server.md +++ b/docs/generators/nodejs-express-server.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |serverPort|TCP port to listen on.| |null| diff --git a/docs/generators/ocaml.md b/docs/generators/ocaml.md index f9f922feee..597f07b841 100644 --- a/docs/generators/ocaml.md +++ b/docs/generators/ocaml.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/openapi-yaml.md b/docs/generators/openapi-yaml.md index d305a85f0d..4476c79000 100644 --- a/docs/generators/openapi-yaml.md +++ b/docs/generators/openapi-yaml.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |outputFile|Output filename| |openapi/openapi.yaml| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/openapi.md b/docs/generators/openapi.md index caf9e4c9e6..53ea3bf812 100644 --- a/docs/generators/openapi.md +++ b/docs/generators/openapi.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |outputFileName|Output file name| |openapi.json| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/docs/generators/php-dt.md b/docs/generators/php-dt.md index 6f9dae6380..a4a6eac2b7 100644 --- a/docs/generators/php-dt.md +++ b/docs/generators/php-dt.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-laravel.md b/docs/generators/php-laravel.md index fa6717217a..09e61d56c1 100644 --- a/docs/generators/php-laravel.md +++ b/docs/generators/php-laravel.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-lumen.md b/docs/generators/php-lumen.md index 1c39477ad4..562b26a589 100644 --- a/docs/generators/php-lumen.md +++ b/docs/generators/php-lumen.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-mezzio-ph.md b/docs/generators/php-mezzio-ph.md index 35bedda05f..7abb3408bc 100644 --- a/docs/generators/php-mezzio-ph.md +++ b/docs/generators/php-mezzio-ph.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-silex-deprecated.md b/docs/generators/php-silex-deprecated.md index 9df926cce1..9b4d5b39b6 100644 --- a/docs/generators/php-silex-deprecated.md +++ b/docs/generators/php-silex-deprecated.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/php-slim-deprecated.md b/docs/generators/php-slim-deprecated.md index d6f8b35c7f..15c4d36ba8 100644 --- a/docs/generators/php-slim-deprecated.md +++ b/docs/generators/php-slim-deprecated.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-slim4.md b/docs/generators/php-slim4.md index ae6cc1cb65..ca1bd3b6a1 100644 --- a/docs/generators/php-slim4.md +++ b/docs/generators/php-slim4.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/php-symfony.md b/docs/generators/php-symfony.md index 4d268ab389..0a231dbd2e 100644 --- a/docs/generators/php-symfony.md +++ b/docs/generators/php-symfony.md @@ -16,6 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |composerVendorName|The vendor name used in the composer package name. The template uses {{composerVendorName}}/{{composerProjectName}} for the composer package name. e.g. yaypets| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/php.md b/docs/generators/php.md index dcee69588f..c84e12c36f 100644 --- a/docs/generators/php.md +++ b/docs/generators/php.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |artifactVersion|The version to use in the composer package version field. e.g. 1.2.3| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |true| |invokerPackage|The main namespace to use for all classes. e.g. Yay\Pets| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/plantuml.md b/docs/generators/plantuml.md index 2413b540ef..7a37ad0d18 100644 --- a/docs/generators/plantuml.md +++ b/docs/generators/plantuml.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| |sortModelPropertiesByRequiredFlag|Sort model properties to place required parameters before optional parameters.| |true| diff --git a/docs/generators/python-aiohttp.md b/docs/generators/python-aiohttp.md index e986c14fd9..14ffd17422 100644 --- a/docs/generators/python-aiohttp.md +++ b/docs/generators/python-aiohttp.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |defaultController|default controller| |default_controller| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |featureCORS|use flask-cors for handling CORS requests| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |packageName|python package name (convention: snake_case).| |openapi_server| diff --git a/docs/generators/python-blueplanet.md b/docs/generators/python-blueplanet.md index 020c239e30..049e3424eb 100644 --- a/docs/generators/python-blueplanet.md +++ b/docs/generators/python-blueplanet.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |defaultController|default controller| |default_controller| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |featureCORS|use flask-cors for handling CORS requests| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |packageName|python package name (convention: snake_case).| |openapi_server| diff --git a/docs/generators/python-fastapi.md b/docs/generators/python-fastapi.md index 2143321f2d..4e321ff9e5 100644 --- a/docs/generators/python-fastapi.md +++ b/docs/generators/python-fastapi.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |packageName|python package name (convention: snake_case).| |openapi_server| |packageVersion|python package version.| |1.0.0| diff --git a/docs/generators/python-flask.md b/docs/generators/python-flask.md index f65ec823a8..a0a5f44b20 100644 --- a/docs/generators/python-flask.md +++ b/docs/generators/python-flask.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |defaultController|default controller| |default_controller| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |featureCORS|use flask-cors for handling CORS requests| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |packageName|python package name (convention: snake_case).| |openapi_server| diff --git a/docs/generators/ruby.md b/docs/generators/ruby.md index 5cd52c8c27..6937905b9e 100644 --- a/docs/generators/ruby.md +++ b/docs/generators/ruby.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |gemAuthor|gem author (only one is supported).| |OpenAPI-Generator| |gemAuthorEmail|gem author email (only one is supported).| |null| |gemDescription|gem description. | |This gem maps to a REST API| diff --git a/docs/generators/scala-akka-http-server.md b/docs/generators/scala-akka-http-server.md index 3727fc6fdf..3d27821c23 100644 --- a/docs/generators/scala-akka-http-server.md +++ b/docs/generators/scala-akka-http-server.md @@ -16,6 +16,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |groupId|groupId in generated pom.xml| |org.openapitools| |invokerPackage|root package for generated code| |org.openapitools.server| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/scala-akka.md b/docs/generators/scala-akka.md index f2c9cecdab..1cc19c6216 100644 --- a/docs/generators/scala-akka.md +++ b/docs/generators/scala-akka.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |mainPackage|Top-level package name, which defines 'apiPackage', 'modelPackage', 'invokerPackage'| |org.openapitools.client| |modelPackage|package for generated models| |null| diff --git a/docs/generators/scala-gatling.md b/docs/generators/scala-gatling.md index 2477cb6848..6daaef5d65 100644 --- a/docs/generators/scala-gatling.md +++ b/docs/generators/scala-gatling.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-httpclient-deprecated.md b/docs/generators/scala-httpclient-deprecated.md index adf4649ffc..4bd12dca95 100644 --- a/docs/generators/scala-httpclient-deprecated.md +++ b/docs/generators/scala-httpclient-deprecated.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-lagom-server.md b/docs/generators/scala-lagom-server.md index 8c583afcaa..ed197a23e5 100644 --- a/docs/generators/scala-lagom-server.md +++ b/docs/generators/scala-lagom-server.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scala-play-server.md b/docs/generators/scala-play-server.md index 7be64e0f10..aeab7fd253 100644 --- a/docs/generators/scala-play-server.md +++ b/docs/generators/scala-play-server.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |basePackage|Base package in which supporting classes are generated.| |org.openapitools| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |generateCustomExceptions|If set, generates custom exception types.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| diff --git a/docs/generators/scala-sttp.md b/docs/generators/scala-sttp.md index 0e12f7695d..9425f8f5c9 100644 --- a/docs/generators/scala-sttp.md +++ b/docs/generators/scala-sttp.md @@ -13,6 +13,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |jodaTimeVersion|The version of joda-time library| |2.10.10| |json4sVersion|The version of json4s library| |3.6.11| |jsonLibrary|Json library to use. Possible values are: json4s and circe.| |json4s| diff --git a/docs/generators/scalatra.md b/docs/generators/scalatra.md index aab1bd98c2..9159c798f2 100644 --- a/docs/generators/scalatra.md +++ b/docs/generators/scalatra.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/scalaz.md b/docs/generators/scalaz.md index 87dc8b0e5e..18520f5e3b 100644 --- a/docs/generators/scalaz.md +++ b/docs/generators/scalaz.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |dateLibrary|Option. Date library to use|
          **joda**
          Joda (for legacy app)
          **java8**
          Java 8 native JSR310 (preferred for JDK 1.8+)
          |java8| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPackage|package for generated models| |null| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| diff --git a/docs/generators/spring.md b/docs/generators/spring.md index 8f834fdf27..34e4a6a266 100644 --- a/docs/generators/spring.md +++ b/docs/generators/spring.md @@ -31,6 +31,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fullJavaUtil|whether to use fully qualified name for classes under java.util. This option only works for Java API client| |false| |groupId|groupId in generated pom.xml| |org.openapitools| |hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false| diff --git a/docs/generators/swift4-deprecated.md b/docs/generators/swift4-deprecated.md index ef9fed5d5a..cf1e1f65df 100644 --- a/docs/generators/swift4-deprecated.md +++ b/docs/generators/swift4-deprecated.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |lenientTypeCast|Accept and cast values for simple types (string->bool, string->int, int->string)| |false| diff --git a/docs/generators/swift5.md b/docs/generators/swift5.md index 9404a2fd45..95f50fca7f 100644 --- a/docs/generators/swift5.md +++ b/docs/generators/swift5.md @@ -11,7 +11,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |apiNamePrefix|Prefix that will be appended to all API names ('tags'). Default: empty string. e.g. Pet => Pet.| |null| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| -|generateFrozenEnums|Generate frozen enums (default: true)| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |generateModelAdditionalProperties|Generate model additional properties (default: true)| |true| |hashableModels|Make hashable models (default: true)| |true| |hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |true| diff --git a/docs/generators/typescript-angular.md b/docs/generators/typescript-angular.md index 2083b09cad..9421c54646 100644 --- a/docs/generators/typescript-angular.md +++ b/docs/generators/typescript-angular.md @@ -14,6 +14,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| diff --git a/docs/generators/typescript-angularjs-deprecated.md b/docs/generators/typescript-angularjs-deprecated.md index 9363a6958d..c094849a07 100644 --- a/docs/generators/typescript-angularjs-deprecated.md +++ b/docs/generators/typescript-angularjs-deprecated.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |nullSafeAdditionalProps|Set to make additional properties types declare that their indexer may return undefined| |false| diff --git a/docs/generators/typescript-aurelia.md b/docs/generators/typescript-aurelia.md index aaad28dd75..23b71ae41a 100644 --- a/docs/generators/typescript-aurelia.md +++ b/docs/generators/typescript-aurelia.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 8dfc77b52d..3cfeda7858 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| |npmRepository|Use this property to set an url of your private npmRepo in the package.json| |null| diff --git a/docs/generators/typescript-fetch.md b/docs/generators/typescript-fetch.md index f8e9cd2328..3fe83380da 100644 --- a/docs/generators/typescript-fetch.md +++ b/docs/generators/typescript-fetch.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-inversify.md b/docs/generators/typescript-inversify.md index 38077cb2b4..21e44eac43 100644 --- a/docs/generators/typescript-inversify.md +++ b/docs/generators/typescript-inversify.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-jquery.md b/docs/generators/typescript-jquery.md index fcff7abe19..030fdd2e57 100644 --- a/docs/generators/typescript-jquery.md +++ b/docs/generators/typescript-jquery.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |jqueryAlreadyImported|When using this in legacy app using mix of typescript and javascript, this will only declare jquery and not import it| |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| diff --git a/docs/generators/typescript-nestjs.md b/docs/generators/typescript-nestjs.md index 50e9acb167..a3f0b52a05 100644 --- a/docs/generators/typescript-nestjs.md +++ b/docs/generators/typescript-nestjs.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fileNaming|Naming convention for the output files: 'camelCase', 'kebab-case'.| |camelCase| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelFileSuffix|The suffix of the file of the generated model (model<suffix>.ts).| |null| diff --git a/docs/generators/typescript-node.md b/docs/generators/typescript-node.md index 388dfd551b..5de2704531 100644 --- a/docs/generators/typescript-node.md +++ b/docs/generators/typescript-node.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-redux-query.md b/docs/generators/typescript-redux-query.md index dd79fa1a43..f2266c0970 100644 --- a/docs/generators/typescript-redux-query.md +++ b/docs/generators/typescript-redux-query.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name| |camelCase| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript-rxjs.md b/docs/generators/typescript-rxjs.md index 5099917998..40921ae7f5 100644 --- a/docs/generators/typescript-rxjs.md +++ b/docs/generators/typescript-rxjs.md @@ -12,6 +12,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| |enumNameSuffix|Suffix that will be appended to all enum names.| |Enum| |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |PascalCase| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |modelPropertyNaming|Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name. Only change it if you provide your own run-time code for (de-)serialization of models| |original| |npmName|The name under which you want to publish generated npm package. Required to generate a full package| |null| diff --git a/docs/generators/typescript.md b/docs/generators/typescript.md index bff28b7390..9c6eea23c0 100644 --- a/docs/generators/typescript.md +++ b/docs/generators/typescript.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |fileContentDataType|Specifies the type to use for the content of a file - i.e. Blob (Browser, Deno) / Buffer (node)| |Buffer| |framework|Specify the framework which should be used in the client code.|
          **fetch-api**
          fetch-api
          **jquery**
          jquery
          |fetch-api| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| diff --git a/docs/generators/wsdl-schema.md b/docs/generators/wsdl-schema.md index 7842f85674..a2af113986 100644 --- a/docs/generators/wsdl-schema.md +++ b/docs/generators/wsdl-schema.md @@ -10,6 +10,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |allowUnicodeIdentifiers|boolean, toggles whether unicode identifiers are allowed in names or not, default is false| |false| |disallowAdditionalPropertiesIfNotPresent|If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.|
          **false**
          The 'additionalProperties' implementation is compliant with the OAS and JSON schema specifications.
          **true**
          Keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default.
          |true| |ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true| +|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
          **false**
          No changes to the enum's are made, this is the default option.
          **true**
          With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.
          |false| |hostname|the hostname of the service| |null| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| |prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index bb7aa069fe..ffbd0c5e0a 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -386,6 +386,12 @@ public class CodegenConstants { public static final String DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT_DESC = "If false, the 'additionalProperties' implementation (set to true by default) is compliant with the OAS and JSON schema specifications. " + "If true (default), keep the old (incorrect) behaviour that 'additionalProperties' is set to false by default."; + + public static final String ENUM_UNKNOWN_DEFAULT_CASE = "enumUnknownDefaultCase"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_DESC = + "If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response." + + "With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case."; + public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP = "useOneOfDiscriminatorLookup"; public static final String USE_ONEOF_DISCRIMINATOR_LOOKUP_DESC = "Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped."; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index a9780140f4..e28f4a03c3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -253,6 +253,11 @@ public class DefaultCodegen implements CodegenConfig { // See CodegenConstants.java for more details. protected boolean disallowAdditionalPropertiesIfNotPresent = true; + // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. + // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. + protected boolean enumUnknownDefaultCase = false; + protected String enumUnknownDefaultCaseName = "unknown_default_open_api"; + // make openapi available to all methods protected OpenAPI openAPI; @@ -376,6 +381,10 @@ public class DefaultCodegen implements CodegenConfig { this.setDisallowAdditionalPropertiesIfNotPresent(Boolean.parseBoolean(additionalProperties .get(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT).toString())); } + if (additionalProperties.containsKey(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE)) { + this.setEnumUnknownDefaultCase(Boolean.parseBoolean(additionalProperties + .get(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE).toString())); + } } /*** @@ -1302,6 +1311,14 @@ public class DefaultCodegen implements CodegenConfig { this.disallowAdditionalPropertiesIfNotPresent = val; } + public Boolean getEnumUnknownDefaultCase() { + return enumUnknownDefaultCase; + } + + public void setEnumUnknownDefaultCase(boolean val) { + this.enumUnknownDefaultCase = val; + } + public Boolean getAllowUnicodeIdentifiers() { return allowUnicodeIdentifiers; } @@ -1639,6 +1656,18 @@ public class DefaultCodegen implements CodegenConfig { cliOptions.add(disallowAdditionalPropertiesIfNotPresentOpt); this.setDisallowAdditionalPropertiesIfNotPresent(true); + CliOption enumUnknownDefaultCaseOpt = CliOption.newBoolean( + CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, + CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE_DESC).defaultValue(Boolean.FALSE.toString()); + Map enumUnknownDefaultCaseOpts = new HashMap<>(); + enumUnknownDefaultCaseOpts.put("false", + "No changes to the enum's are made, this is the default option."); + enumUnknownDefaultCaseOpts.put("true", + "With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case."); + enumUnknownDefaultCaseOpt.setEnum(enumUnknownDefaultCaseOpts); + cliOptions.add(enumUnknownDefaultCaseOpt); + this.setEnumUnknownDefaultCase(false); + // initialize special character mapping initializeSpecialCharacterMapping(); @@ -5888,6 +5917,32 @@ public class DefaultCodegen implements CodegenConfig { enumVar.put("isString", isDataTypeString(dataType)); enumVars.add(enumVar); } + + if (enumUnknownDefaultCase) { + // If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response. + // With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case. + Map enumVar = new HashMap<>(); + String enumName = enumUnknownDefaultCaseName; + + String enumValue; + if (isDataTypeString(dataType)) { + enumValue = enumUnknownDefaultCaseName; + } else { + // This is a dummy value that attempts to avoid collisions with previously specified cases. + // Int.max / 192 + // The number 192 that is used to calculate this random value, is the Swift Evolution proposal for frozen/non-frozen enums. + // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) + // Since this functionality was born in the Swift 5 generator and latter on broth to all generatorss + // https://github.com/OpenAPITools/openapi-generator/pull/11013 + enumValue = String.valueOf(11184809); + } + + enumVar.put("name", toEnumVarName(enumName, dataType)); + enumVar.put("value", toEnumValue(enumValue, dataType)); + enumVar.put("isString", isDataTypeString(dataType)); + enumVars.add(enumVar); + } + return enumVars; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java index b0d272d075..9ebab55c3f 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/KotlinClientCodegen.java @@ -582,6 +582,9 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen { switch (getSerializationLibrary()) { case moshi: + if (enumUnknownDefaultCase) { + supportingFiles.add(new SupportingFile("jvm-common/infrastructure/SerializerHelper.kt.mustache", infrastructureFolder, "SerializerHelper.kt")); + } supportingFiles.add(new SupportingFile("jvm-common/infrastructure/UUIDAdapter.kt.mustache", infrastructureFolder, "UUIDAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateAdapter.kt.mustache", infrastructureFolder, "LocalDateAdapter.kt")); supportingFiles.add(new SupportingFile("jvm-common/infrastructure/LocalDateTimeAdapter.kt.mustache", infrastructureFolder, "LocalDateTimeAdapter.kt")); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 4610b7ded0..21e7a03c88 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -66,7 +66,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig public static final String SWIFT_PACKAGE_PATH = "swiftPackagePath"; public static final String USE_CLASSES = "useClasses"; public static final String USE_BACKTICK_ESCAPES = "useBacktickEscapes"; - public static final String GENERATE_FROZEN_ENUMS = "generateFrozenEnums"; public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES = "generateModelAdditionalProperties"; public static final String HASHABLE_MODELS = "hashableModels"; public static final String MAP_FILE_BINARY_TO_DATA = "mapFileBinaryToData"; @@ -91,7 +90,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig protected boolean useClasses = false; protected boolean useBacktickEscapes = false; protected boolean generateModelAdditionalProperties = true; - protected boolean generateFrozenEnums = true; protected boolean hashableModels = true; protected boolean mapFileBinaryToData = false; protected String[] responseAs = new String[0]; @@ -283,9 +281,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig cliOptions.add(new CliOption(USE_BACKTICK_ESCAPES, "Escape reserved words using backticks (default: false)") .defaultValue(Boolean.FALSE.toString())); - cliOptions.add(new CliOption(GENERATE_FROZEN_ENUMS, - "Generate frozen enums (default: true)") - .defaultValue(Boolean.TRUE.toString())); cliOptions.add(new CliOption(GENERATE_MODEL_ADDITIONAL_PROPERTIES, "Generate model additional properties (default: true)") .defaultValue(Boolean.TRUE.toString())); @@ -490,13 +485,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig setUseBacktickEscapes(convertPropertyToBooleanAndWriteBack(USE_BACKTICK_ESCAPES)); } - // Setup generateFrozenEnums option. If true, enums will strictly include - // cases matching the spec. If false, enums will also include an extra catch-all case. - if (additionalProperties.containsKey(GENERATE_FROZEN_ENUMS)) { - setGenerateFrozenEnums(convertPropertyToBooleanAndWriteBack(GENERATE_FROZEN_ENUMS)); - } - additionalProperties.put(GENERATE_FROZEN_ENUMS, generateFrozenEnums); - if (additionalProperties.containsKey(GENERATE_MODEL_ADDITIONAL_PROPERTIES)) { setGenerateModelAdditionalProperties(convertPropertyToBooleanAndWriteBack(GENERATE_MODEL_ADDITIONAL_PROPERTIES)); } @@ -955,10 +943,6 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig this.useBacktickEscapes = useBacktickEscapes; } - public void setGenerateFrozenEnums(boolean generateFrozenEnums) { - this.generateFrozenEnums = generateFrozenEnums; - } - public void setGenerateModelAdditionalProperties(boolean generateModelAdditionalProperties) { this.generateModelAdditionalProperties = generateModelAdditionalProperties; } @@ -988,6 +972,12 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig return "empty"; } + if (enumUnknownDefaultCase) { + if (name.equals(enumUnknownDefaultCaseName)) { + return camelize(name, true); + } + } + // Reserved Name String nameLowercase = StringUtils.lowerCase(name); if (isReservedWord(nameLowercase)) { diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache index e3e570e7a0..884e16846b 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/Serializer.kt.mustache @@ -2,6 +2,9 @@ package {{packageName}}.infrastructure {{#moshi}} import com.squareup.moshi.Moshi +{{#enumUnknownDefaultCase}} +import com.squareup.moshi.adapters.EnumJsonAdapter +{{/enumUnknownDefaultCase}} {{^moshiCodeGen}} import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory {{/moshiCodeGen}} @@ -68,6 +71,9 @@ import java.util.concurrent.atomic.AtomicLong @JvmStatic val moshi: Moshi by lazy { +{{#enumUnknownDefaultCase}} + SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder) +{{/enumUnknownDefaultCase}} moshiBuilder.build() } {{/moshi}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache new file mode 100644 index 0000000000..fbf67a75dd --- /dev/null +++ b/modules/openapi-generator/src/main/resources/kotlin-client/jvm-common/infrastructure/SerializerHelper.kt.mustache @@ -0,0 +1,50 @@ +package {{packageName}}.infrastructure + +{{#moshi}} +import com.squareup.moshi.Moshi +{{#enumUnknownDefaultCase}} +import com.squareup.moshi.adapters.EnumJsonAdapter +{{/enumUnknownDefaultCase}} +{{/moshi}} + +{{#nonPublicApi}}internal {{/nonPublicApi}}object SerializerHelper { +{{#moshi}} + fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder { + return moshiBuilder +{{#enumUnknownDefaultCase}} +{{#models}} +{{#model}} +{{#isEnum}} +{{#allowableValues}} +{{#enumVars}} +{{#-last}} + .add({{modelPackage}}.{{classname}}::class.java, EnumJsonAdapter.create({{modelPackage}}.{{classname}}::class.java) + .withUnknownFallback({{modelPackage}}.{{classname}}.{{&name}})) +{{/-last}} +{{/enumVars}} +{{/allowableValues}} +{{/isEnum}} +{{^isEnum}} +{{^isAlias}} +{{#hasEnums}} +{{#vars}} +{{#isEnum}} +{{#allowableValues}} +{{#enumVars}} +{{#-last}} + .add({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}::class.java, EnumJsonAdapter.create({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}::class.java) + .withUnknownFallback({{modelPackage}}.{{classname}}.{{{nameInCamelCase}}}.{{&name}})) +{{/-last}} +{{/enumVars}} +{{/allowableValues}} +{{/isEnum}} +{{/vars}} +{{/hasEnums}} +{{/isAlias}} +{{/isEnum}} +{{/model}} +{{/models}} +{{/enumUnknownDefaultCase}} + } +{{/moshi}} +} diff --git a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache index f7a01d9dfb..7817289fa1 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache @@ -6,6 +6,25 @@ import java.io.IOException {{#imports}}import {{import}} {{/imports}} +{{^multiplatform}} +{{#gson}} +import com.google.gson.annotations.SerializedName +{{/gson}} +{{#moshi}} +import com.squareup.moshi.Json +{{/moshi}} +{{#jackson}} +import com.fasterxml.jackson.annotation.JsonProperty +{{/jackson}} +{{#kotlinx_serialization}} +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable +{{/kotlinx_serialization}} +{{/multiplatform}} +{{#multiplatform}} +import kotlinx.serialization.* +{{/multiplatform}} + {{^doNotUseRxAndCoroutines}} {{#useCoroutines}} import kotlinx.coroutines.Dispatchers @@ -35,6 +54,65 @@ import {{packageName}}.infrastructure.toMultiValue } {{#operation}} + {{#allParams}} + {{#isEnum}} + /** + * enum for parameter {{paramName}} + */ + {{#nonPublicApi}}internal {{/nonPublicApi}}enum class {{enumName}}_{{operationId}}(val value: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}kotlin.String{{/isContainer}}) { + {{^enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^multiplatform}} + {{#moshi}} + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/moshi}} + {{#gson}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/gson}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/jackson}} + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/kotlinx_serialization}} + {{/multiplatform}} + {{#multiplatform}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/multiplatform}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{#enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^-last}} + {{^multiplatform}} + {{#moshi}} + @Json(name = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/moshi}} + {{#gson}} + @SerializedName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/gson}} + {{#jackson}} + @JsonProperty(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/jackson}} + {{#kotlinx_serialization}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/kotlinx_serialization}} + {{/multiplatform}} + {{#multiplatform}} + @SerialName(value = {{^isString}}"{{/isString}}{{{value}}}{{^isString}}"{{/isString}}) {{&name}}({{{value}}}), + {{/multiplatform}} + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} + ; + } + + {{/isEnum}} + {{/allParams}} /** * {{summary}} * {{notes}} @@ -51,7 +129,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}}{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} @@ -85,7 +163,7 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { + {{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : ApiResponse<{{#returnType}}{{{returnType}}}?{{/returnType}}{{^returnType}}Unit?{{/returnType}}>{{^doNotUseRxAndCoroutines}}{{#useCoroutines}} = withContext(Dispatchers.IO){{/useCoroutines}}{{/doNotUseRxAndCoroutines}} { {{#isDeprecated}} @Suppress("DEPRECATION") {{/isDeprecated}} @@ -105,10 +183,10 @@ import {{packageName}}.infrastructure.toMultiValue {{#isDeprecated}} @Deprecated(message = "This operation is deprecated.") {{/isDeprecated}} - fun {{operationId}}RequestConfig({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}> { + fun {{operationId}}RequestConfig({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}kotlin.collections.List<{{enumName}}_{{operationId}}>{{/isContainer}}{{^isContainer}}{{enumName}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : RequestConfig<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map{{/hasFormParams}}{{/hasBodyParam}}> { val localVariableBody = {{#hasBodyParam}}{{#bodyParams}}{{{paramName}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to {{{paramName}}}{{^-last}}, {{/-last}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}} val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mutableMapOf() -{{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() +{{/hasQueryParams}}{{#hasQueryParams}}mutableMapOf>() .apply { {{#queryParams}} {{^required}} diff --git a/modules/openapi-generator/src/main/resources/swift5/api.mustache b/modules/openapi-generator/src/main/resources/swift5/api.mustache index e5cd7ea449..9cf516b0c2 100644 --- a/modules/openapi-generator/src/main/resources/swift5/api.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/api.mustache @@ -30,11 +30,22 @@ extension {{projectName}}API { * enum for parameter {{paramName}} */ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, CaseIterable{{#useVapor}}, Content{{/useVapor}} { + {{^enumUnknownDefaultCase}} {{#allowableValues}} {{#enumVars}} case {{name}} = {{{value}}} {{/enumVars}} {{/allowableValues}} + {{/enumUnknownDefaultCase}} + {{#enumUnknownDefaultCase}} + {{#allowableValues}} + {{#enumVars}} + {{^-last}} + case {{name}} = {{{value}}} + {{/-last}} + {{/enumVars}} + {{/allowableValues}} + {{/enumUnknownDefaultCase}} } {{/isEnum}} {{/allParams}} diff --git a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache index 08f7bf9ee4..2b28d7c008 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelEnum.mustache @@ -1,32 +1,7 @@ -{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{^generateFrozenEnums}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/generateFrozenEnums}} { +{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{classname}}: {{dataType}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} -{{^generateFrozenEnums}} - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. -{{#isString}} - case unknownDefaultOpenAPI = "unknown_default_open_api" -{{/isString}} -{{#isNumeric}} - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // -{{/isNumeric}} -{{#isInteger}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 -{{/isInteger}} -{{#isDouble}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 -{{/isDouble}} -{{#isFloat}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 -{{/isFloat}} -{{/generateFrozenEnums}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache index 1dd9c55b16..445f568738 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelInlineEnumDeclaration.mustache @@ -1,35 +1,7 @@ - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{^generateFrozenEnums}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/generateFrozenEnums}} { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, {{#useVapor}}Content, Hashable{{/useVapor}}{{^useVapor}}Codable{{/useVapor}}, CaseIterable{{#enumUnknownDefaultCase}}{{#isInteger}}, CaseIterableDefaultsLast{{/isInteger}}{{#isFloat}}, CaseIterableDefaultsLast{{/isFloat}}{{#isDouble}}, CaseIterableDefaultsLast{{/isDouble}}{{#isString}}, CaseIterableDefaultsLast{{/isString}}{{#isContainer}}, CaseIterableDefaultsLast{{/isContainer}}{{/enumUnknownDefaultCase}} { {{#allowableValues}} {{#enumVars}} case {{{name}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} - {{^generateFrozenEnums}} - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - {{#isString}} - case unknownDefaultOpenAPI = "unknown_default_open_api" - {{/isString}} - {{#isContainer}} - case unknownDefaultOpenAPI = "unknown_default_open_api" - {{/isContainer}} - {{#isNumeric}} - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // - {{/isNumeric}} - {{#isInteger}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 - {{/isInteger}} - {{#isDouble}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 - {{/isDouble}} - {{#isFloat}} - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 - {{/isFloat}} - {{/generateFrozenEnums}} } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java index 1d08eab2be..11b557d2ae 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/bash/BashClientOptionsTest.java @@ -58,6 +58,7 @@ public class BashClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setApiKeyAuthEnvironmentVariable( BashClientOptionsProvider.APIKEY_AUTH_ENVIRONMENT_VARIABLE_NAME); verify(clientCodegen).setAllowUnicodeIdentifiers(Boolean.valueOf(BashClientOptionsProvider.ALLOW_UNICODE_IDENTIFIERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(BashClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java index 62693bf854..1b268561e5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/DartClientOptionsTest.java @@ -50,5 +50,6 @@ public class DartClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setPubHomepage(DartClientOptionsProvider.PUB_HOMEPAGE_VALUE); verify(clientCodegen).setSourceFolder(DartClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartClientOptionsProvider.USE_ENUM_EXTENSION)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java index 478d243580..9008b713bb 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioClientOptionsTest.java @@ -52,5 +52,6 @@ public class DartDioClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioClientOptionsProvider.DATE_LIBRARY); verify(clientCodegen).setNullableFields(Boolean.parseBoolean(DartDioClientOptionsProvider.NULLABLE_FIELDS)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java index f2237e4fba..61c386b274 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/dart/dio/DartDioNextClientOptionsTest.java @@ -51,5 +51,6 @@ public class DartDioNextClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setUseEnumExtension(Boolean.parseBoolean(DartDioNextClientOptionsProvider.USE_ENUM_EXTENSION)); verify(clientCodegen).setDateLibrary(DartDioNextClientCodegen.DATE_LIBRARY_DEFAULT); verify(clientCodegen).setLibrary(DartDioNextClientCodegen.SERIALIZATION_LIBRARY_DEFAULT); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(DartDioNextClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java index 41fe7cbbbb..a969cc1741 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/elixir/ElixirClientOptionsTest.java @@ -42,5 +42,6 @@ public class ElixirClientOptionsTest extends AbstractOptionsTest { @Override protected void verifyOptions() { verify(clientCodegen).setModuleName(ElixirClientOptionsProvider.INVOKER_PACKAGE_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(ElixirClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java index 769dcbedbd..40d4cbba43 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellservant/HaskellServantOptionsTest.java @@ -43,5 +43,6 @@ public class HaskellServantOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setModelPackage(HaskellServantOptionsProvider.MODEL_PACKAGE_VALUE); verify(clientCodegen).setApiPackage(HaskellServantOptionsProvider.API_PACKAGE_VALUE); verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(HaskellServantOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(HaskellServantOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java index 07d317b23d..128b10a086 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/haskellyesod/HaskellYesodServerOptionsTest.java @@ -25,5 +25,6 @@ public class HaskellYesodServerOptionsTest extends AbstractOptionsTest { protected void verifyOptions() { verify(clientCodegen).setProjectName(HaskellYesodServerOptionsProvider.PROJECT_NAME_VALUE); verify(clientCodegen).setApiModuleName(HaskellYesodServerOptionsProvider.API_MODULE_NAME_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(HaskellYesodServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java index 4a79464569..73af635bb0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/lumen/PhpLumenServerOptionsTest.java @@ -48,5 +48,6 @@ public class PhpLumenServerOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setPackageName(PhpLumenServerOptionsProvider.PACKAGE_NAME_VALUE); verify(clientCodegen).setSrcBasePath(PhpLumenServerOptionsProvider.SRC_BASE_PATH_VALUE); verify(clientCodegen).setArtifactVersion(PhpLumenServerOptionsProvider.ARTIFACT_VERSION_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpLumenServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java index b2c8415fdc..338a9e5ea1 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/BashClientOptionsProvider.java @@ -39,6 +39,7 @@ public class BashClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -72,6 +73,7 @@ public class BashClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java index 464560449f..5e468090be 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartClientOptionsProvider.java @@ -39,6 +39,7 @@ public class DartClientOptionsProvider implements OptionsProvider { public static final String USE_ENUM_EXTENSION = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -65,6 +66,7 @@ public class DartClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put("serializationLibrary", "custom") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java index fa6bb3eead..e974ddd849 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioClientOptionsProvider.java @@ -41,6 +41,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider { public static final String PUB_AUTHOR_VALUE = "Author"; public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; public static final String PUB_HOMEPAGE_VALUE = "Homepage"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -68,6 +69,7 @@ public class DartDioClientOptionsProvider implements OptionsProvider { .put(DartDioClientCodegen.NULLABLE_FIELDS, NULLABLE_FIELDS) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java index b03f2a9721..cda6e36cfc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/DartDioNextClientOptionsProvider.java @@ -37,6 +37,7 @@ public class DartDioNextClientOptionsProvider implements OptionsProvider { public static final String PUB_AUTHOR_VALUE = "Author"; public static final String PUB_AUTHOR_EMAIL_VALUE = "author@homepage"; public static final String PUB_HOMEPAGE_VALUE = "Homepage"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -64,6 +65,7 @@ public class DartDioNextClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java index bd39161584..32b7b3d341 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ElixirClientOptionsProvider.java @@ -25,6 +25,7 @@ import java.util.Map; public class ElixirClientOptionsProvider implements OptionsProvider { public static final String INVOKER_PACKAGE_VALUE = "Yay.Pets"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -45,6 +46,7 @@ public class ElixirClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java index 728b44ef38..892a753ce9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellServantOptionsProvider.java @@ -31,6 +31,7 @@ public class HaskellServantOptionsProvider implements OptionsProvider { public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -50,6 +51,7 @@ public class HaskellServantOptionsProvider implements OptionsProvider { .put(HaskellServantCodegen.PROP_SERVE_STATIC, HaskellServantCodegen.PROP_SERVE_STATIC_DEFAULT.toString()) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java index 230c2243a8..66fd08f19a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/HaskellYesodServerOptionsProvider.java @@ -14,6 +14,7 @@ public class HaskellYesodServerOptionsProvider implements OptionsProvider { public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String PROJECT_NAME_VALUE = "openapi-haskell-yesod-server"; public static final String API_MODULE_NAME_VALUE = "API"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -32,6 +33,7 @@ public class HaskellYesodServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(HaskellYesodServerCodegen.PROJECT_NAME, PROJECT_NAME_VALUE) .put(HaskellYesodServerCodegen.API_MODULE_NAME, API_MODULE_NAME_VALUE) + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java index b2a987d924..21ce7e748c 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpClientOptionsProvider.java @@ -36,6 +36,7 @@ public class PhpClientOptionsProvider implements OptionsProvider { public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -60,6 +61,7 @@ public class PhpClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java index 25d34b16d8..3c0779cf5f 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpLumenServerOptionsProvider.java @@ -36,6 +36,7 @@ public class PhpLumenServerOptionsProvider implements OptionsProvider { public static final String ARTIFACT_VERSION_VALUE = "1.0.0-SNAPSHOT"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -59,6 +60,7 @@ public class PhpLumenServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java index b6c55c7a27..900aab03c7 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSilexServerOptionsProvider.java @@ -28,6 +28,7 @@ public class PhpSilexServerOptionsProvider implements OptionsProvider { public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -44,6 +45,7 @@ public class PhpSilexServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java index 3295ed9510..2e6a8f6ee6 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlim4ServerOptionsProvider.java @@ -38,6 +38,7 @@ public class PhpSlim4ServerOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String PSR7_IMPLEMENTATION_VALUE = "zend-diactoros"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -62,6 +63,7 @@ public class PhpSlim4ServerOptionsProvider implements OptionsProvider { .put(PhpSlim4ServerCodegen.PSR7_IMPLEMENTATION, PSR7_IMPLEMENTATION_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java index 4a40588c0e..be1d495713 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/PhpSlimServerOptionsProvider.java @@ -36,6 +36,7 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider { public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -59,6 +60,7 @@ public class PhpSlimServerOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java index 9d5c63f9d2..807c0035bd 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/RubyClientOptionsProvider.java @@ -40,6 +40,7 @@ public class RubyClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String LIBRARY = "typhoeus"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -68,6 +69,7 @@ public class RubyClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.LIBRARY, LIBRARY) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java index 62909fb5b3..7c4e5d4a1b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaAkkaClientOptionsProvider.java @@ -34,6 +34,7 @@ public class ScalaAkkaClientOptionsProvider implements OptionsProvider { public static final String MAIN_PACKAGE_VALUE = "net.test"; public static final String MODEL_PROPERTY_NAMING = "camelCase"; public static final String DATE_LIBRARY = "joda"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override @@ -57,6 +58,7 @@ public class ScalaAkkaClientOptionsProvider implements OptionsProvider { .put("dateLibrary", DATE_LIBRARY) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java index ac3c7f713c..c8c56053cf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/ScalaHttpClientOptionsProvider.java @@ -33,6 +33,7 @@ public class ScalaHttpClientOptionsProvider implements OptionsProvider { public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; public static final String DATE_LIBRARY = "joda"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -54,6 +55,7 @@ public class ScalaHttpClientOptionsProvider implements OptionsProvider { .put("dateLibrary", DATE_LIBRARY) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java deleted file mode 100644 index 038c40121d..0000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift4OptionsProvider.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.options; - -import com.google.common.collect.ImmutableMap; -import org.openapitools.codegen.CodegenConstants; -import org.openapitools.codegen.languages.Swift4Codegen; - -import java.util.Map; - -public class Swift4OptionsProvider implements OptionsProvider { - public static final String SORT_PARAMS_VALUE = "false"; - public static final String SORT_MODEL_PROPERTIES_VALUE = "false"; - public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; - public static final String PROJECT_NAME_VALUE = "Swagger"; - public static final String RESPONSE_AS_VALUE = "test"; - public static final String NON_PUBLIC_API_REQUIRED_VALUE = "false"; - public static final String UNWRAP_REQUIRED_VALUE = "true"; - public static final String OBJC_COMPATIBLE_VALUE = "false"; - public static final String LENIENT_TYPE_CAST_VALUE = "false"; - public static final String POD_SOURCE_VALUE = "{ :git => 'git@github.com:swagger-api/swagger-mustache.git'," + - " :tag => 'v1.0.0-SNAPSHOT' }"; - public static final String POD_VERSION_VALUE = "v1.0.0-SNAPSHOT"; - public static final String POD_AUTHORS_VALUE = "podAuthors"; - public static final String POD_SOCIAL_MEDIA_URL_VALUE = "podSocialMediaURL"; - public static final String POD_DOCSET_URL_VALUE = "podDocsetURL"; - public static final String POD_LICENSE_VALUE = "'Apache License, Version 2.0'"; - public static final String POD_HOMEPAGE_VALUE = "podHomepage"; - public static final String POD_SUMMARY_VALUE = "podSummary"; - public static final String POD_DESCRIPTION_VALUE = "podDescription"; - public static final String POD_SCREENSHOTS_VALUE = "podScreenshots"; - public static final String POD_DOCUMENTATION_URL_VALUE = "podDocumentationURL"; - public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace"; - public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; - public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; - - @Override - public String getLanguage() { - return "swift4"; - } - - @Override - public Map createOptions() { - ImmutableMap.Builder builder = new ImmutableMap.Builder(); - return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) - .put(CodegenConstants.SORT_MODEL_PROPERTIES_BY_REQUIRED_FLAG, SORT_MODEL_PROPERTIES_VALUE) - .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) - .put(Swift4Codegen.PROJECT_NAME, PROJECT_NAME_VALUE) - .put(Swift4Codegen.RESPONSE_AS, RESPONSE_AS_VALUE) - .put(CodegenConstants.NON_PUBLIC_API, NON_PUBLIC_API_REQUIRED_VALUE) - .put(Swift4Codegen.UNWRAP_REQUIRED, UNWRAP_REQUIRED_VALUE) - .put(Swift4Codegen.OBJC_COMPATIBLE, OBJC_COMPATIBLE_VALUE) - .put(Swift4Codegen.LENIENT_TYPE_CAST, LENIENT_TYPE_CAST_VALUE) - .put(Swift4Codegen.POD_SOURCE, POD_SOURCE_VALUE) - .put(CodegenConstants.POD_VERSION, POD_VERSION_VALUE) - .put(Swift4Codegen.POD_AUTHORS, POD_AUTHORS_VALUE) - .put(Swift4Codegen.POD_SOCIAL_MEDIA_URL, POD_SOCIAL_MEDIA_URL_VALUE) - .put(Swift4Codegen.POD_DOCSET_URL, POD_DOCSET_URL_VALUE) - .put(Swift4Codegen.POD_LICENSE, POD_LICENSE_VALUE) - .put(Swift4Codegen.POD_HOMEPAGE, POD_HOMEPAGE_VALUE) - .put(Swift4Codegen.POD_SUMMARY, POD_SUMMARY_VALUE) - .put(Swift4Codegen.POD_DESCRIPTION, POD_DESCRIPTION_VALUE) - .put(Swift4Codegen.POD_SCREENSHOTS, POD_SCREENSHOTS_VALUE) - .put(Swift4Codegen.POD_DOCUMENTATION_URL, POD_DOCUMENTATION_URL_VALUE) - .put(Swift4Codegen.SWIFT_USE_API_NAMESPACE, SWIFT_USE_API_NAMESPACE_VALUE) - .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") - .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) - .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) - .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") - .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") - .build(); - } - - @Override - public boolean isServer() { - return false; - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java index 4df5b89d5b..003e5b4b5b 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/Swift5OptionsProvider.java @@ -48,7 +48,6 @@ public class Swift5OptionsProvider implements OptionsProvider { public static final String REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE = "false"; public static final String SWIFT_USE_API_NAMESPACE_VALUE = "swiftUseApiNamespace"; public static final String USE_BACKTICKS_ESCAPES_VALUE = "false"; - public static final String GENERATE_FROZEN_ENUMS_VALUE = "true"; public static final String GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE = "true"; public static final String HASHABLE_MODELS_VALUE = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; @@ -56,6 +55,7 @@ public class Swift5OptionsProvider implements OptionsProvider { public static final String LIBRARY_VALUE = "alamofire"; public static final String USE_SPM_FILE_STRUCTURE_VALUE = "false"; public static final String SWIFT_PACKAGE_PATH_VALUE = ""; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -96,11 +96,11 @@ public class Swift5OptionsProvider implements OptionsProvider { .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(Swift5ClientCodegen.USE_SPM_FILE_STRUCTURE, USE_SPM_FILE_STRUCTURE_VALUE) .put(Swift5ClientCodegen.SWIFT_PACKAGE_PATH, SWIFT_PACKAGE_PATH_VALUE) - .put(Swift5ClientCodegen.GENERATE_FROZEN_ENUMS, GENERATE_FROZEN_ENUMS_VALUE) .put(Swift5ClientCodegen.GENERATE_MODEL_ADDITIONAL_PROPERTIES, GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE) .put(Swift5ClientCodegen.HASHABLE_MODELS, HASHABLE_MODELS_VALUE) .put(Swift5ClientCodegen.MAP_FILE_BINARY_TO_DATA, "false") .put(Swift5ClientCodegen.USE_CLASSES, "false") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java index aa67286b97..b3d82668ec 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularClientOptionsProvider.java @@ -50,6 +50,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { public static String SERVICE_FILE_SUFFIX = ".service"; public static String MODEL_SUFFIX = ""; public static String MODEL_FILE_SUFFIX = ""; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -91,6 +92,7 @@ public class TypeScriptAngularClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(TypeScriptAngularClientCodegen.QUERY_PARAM_OBJECT_FORMAT, QUERY_PARAM_OBJECT_FORMAT_VALUE) + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java index 1b9c8a58e1..fd62de4e03 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAngularJsClientOptionsProvider.java @@ -35,6 +35,7 @@ public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider public static final String ENUM_PROPERTY_NAMING_VALUE = "PascalCase"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -57,6 +58,7 @@ public class TypeScriptAngularJsClientOptionsProvider implements OptionsProvider .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java index 939a0fad97..7cc5631fec 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptAureliaClientOptionsProvider.java @@ -38,6 +38,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { private static final String NPM_VERSION = "1.0.0"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -63,6 +64,7 @@ public class TypeScriptAureliaClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java index f33f1c437d..5c2fb91f72 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptFetchClientOptionsProvider.java @@ -42,6 +42,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { public static final String TYPESCRIPT_THREE_PLUS = "true"; public static final String WITHOUT_RUNTIME_CHECKS = "true"; public static final String SAGAS_AND_RECORDS = "false"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -74,6 +75,7 @@ public class TypeScriptFetchClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java index d86f586e15..d7143efcfc 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNestjsClientOptionsProvider.java @@ -46,6 +46,7 @@ public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider { public static String SERVICE_FILE_SUFFIX = ".service"; public static String MODEL_SUFFIX = ""; public static String MODEL_FILE_SUFFIX = ""; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -84,6 +85,7 @@ public class TypeScriptNestjsClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") .put(TypeScriptNestjsClientCodegen.FILE_NAMING, FILE_NAMING_VALUE) + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java index fb2b6a741d..a82306a542 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/TypeScriptNodeClientOptionsProvider.java @@ -41,6 +41,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { public static final String API_SUFFIX = "Api"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = "true"; + public static final String ENUM_UNKNOWN_DEFAULT_CASE_VALUE = "false"; @Override public String getLanguage() { @@ -67,6 +68,7 @@ public class TypeScriptNodeClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, PREPEND_FORM_OR_BODY_PARAMETERS_VALUE) .put(CodegenConstants.LEGACY_DISCRIMINATOR_BEHAVIOR, "true") .put(CodegenConstants.DISALLOW_ADDITIONAL_PROPERTIES_IF_NOT_PRESENT, "true") + .put(CodegenConstants.ENUM_UNKNOWN_DEFAULT_CASE, ENUM_UNKNOWN_DEFAULT_CASE_VALUE) .build(); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java index 8479c3441a..0432dec115 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/php/PhpClientOptionsTest.java @@ -48,5 +48,6 @@ public class PhpClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setPackageName(PhpClientOptionsProvider.PACKAGE_NAME_VALUE); verify(clientCodegen).setSrcBasePath(PhpClientOptionsProvider.SRC_BASE_PATH_VALUE); verify(clientCodegen).setArtifactVersion(PhpClientOptionsProvider.ARTIFACT_VERSION_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java index 6c338ad66b..c44d3d9b1a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/ruby/RubyClientOptionsTest.java @@ -50,5 +50,6 @@ public class RubyClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setGemSummary(RubyClientOptionsProvider.GEM_SUMMARY_VALUE); verify(clientCodegen).setGemAuthor(RubyClientOptionsProvider.GEM_AUTHOR_VALUE); verify(clientCodegen).setGemAuthorEmail(RubyClientOptionsProvider.GEM_AUTHOR_EMAIL_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(RubyClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java index fbb919e9fa..fbcece61d9 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalaakka/ScalaAkkaClientOptionsTest.java @@ -47,5 +47,6 @@ public class ScalaAkkaClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(ScalaAkkaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setMainPackage(ScalaAkkaClientOptionsProvider.MAIN_PACKAGE_VALUE); verify(clientCodegen).setModelPropertyNaming(ScalaAkkaClientOptionsProvider.MODEL_PROPERTY_NAMING); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(ScalaAkkaClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java index a70da4206b..33692fab60 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/scalahttpclient/ScalaHttpClientOptionsTest.java @@ -48,5 +48,6 @@ public class ScalaHttpClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setSourceFolder(ScalaHttpClientOptionsProvider.SOURCE_FOLDER_VALUE); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(ScalaHttpClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setDateLibrary(ScalaHttpClientOptionsProvider.DATE_LIBRARY,false); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(ScalaHttpClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java index d7dcc1a280..9ea6f43e43 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/silex/PhpSilexServerOptionsTest.java @@ -41,5 +41,6 @@ public class PhpSilexServerOptionsTest extends AbstractOptionsTest { @Override protected void verifyOptions() { verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSilexServerOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpSilexServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java index ad6fb48b27..e436efed1a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim/PhpSlimServerOptionsTest.java @@ -48,5 +48,6 @@ public class PhpSlimServerOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setSrcBasePath(PhpSlimServerOptionsProvider.SRC_BASE_PATH_VALUE); verify(clientCodegen).setArtifactVersion(PhpSlimServerOptionsProvider.ARTIFACT_VERSION_VALUE); verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlimServerOptionsProvider.SORT_PARAMS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpSlimServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java index 499e6bec63..b9c76e6b64 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/slim4/PhpSlim4ServerOptionsTest.java @@ -49,6 +49,7 @@ public class PhpSlim4ServerOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setArtifactVersion(PhpSlim4ServerOptionsProvider.ARTIFACT_VERSION_VALUE); verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(PhpSlim4ServerOptionsProvider.SORT_PARAMS_VALUE)); verify(clientCodegen).setPsr7Implementation(PhpSlim4ServerOptionsProvider.PSR7_IMPLEMENTATION_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(PhpSlim4ServerOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java deleted file mode 100644 index aeef2b73ed..0000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4CodegenTest.java +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.Operation; -import org.openapitools.codegen.CodegenOperation; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - - -public class Swift4CodegenTest { - - Swift4Codegen swiftCodegen = new Swift4Codegen(); - - @Test(enabled = true) - public void testCapitalizedReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("AS", null), "_as"); - } - - @Test(enabled = true) - public void testReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("Public", null), "_public"); - } - - @Test(enabled = true) - public void shouldNotBreakNonReservedWord() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("Error", null), "error"); - } - - @Test(enabled = true) - public void shouldNotBreakCorrectName() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("EntryName", null), "entryName"); - } - - @Test(enabled = true) - public void testSingleWordAllCaps() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("VALUE", null), "value"); - } - - @Test(enabled = true) - public void testSingleWordLowercase() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("value", null), "value"); - } - - @Test(enabled = true) - public void testCapitalsWithUnderscore() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY_NAME", null), "entryName"); - } - - @Test(enabled = true) - public void testCapitalsWithDash() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY-NAME", null), "entryName"); - } - - @Test(enabled = true) - public void testCapitalsWithSpace() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("ENTRY NAME", null), "entryName"); - } - - @Test(enabled = true) - public void testLowercaseWithUnderscore() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("entry_name", null), "entryName"); - } - - @Test(enabled = true) - public void testStartingWithNumber() throws Exception { - Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName", null), "_123entryName"); - Assert.assertEquals(swiftCodegen.toEnumVarName("123Entry_name", null), "_123entryName"); - Assert.assertEquals(swiftCodegen.toEnumVarName("123EntryName123", null), "_123entryName123"); - } - - @Test(description = "returns Data when response format is binary", enabled = true) - public void binaryDataTest() { - // TODO update json file - - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/binaryDataTest.json"); - final DefaultCodegen codegen = new Swift4Codegen(); - codegen.setOpenAPI(openAPI); - final String path = "/tests/binaryResponse"; - final Operation p = openAPI.getPaths().get(path).getPost(); - final CodegenOperation op = codegen.fromOperation(path, "post", p, null); - - Assert.assertEquals(op.returnType, "URL"); - Assert.assertEquals(op.bodyParam.dataType, "URL"); - Assert.assertTrue(op.bodyParam.isBinary); - Assert.assertTrue(op.responses.get(0).isBinary); - } - - @Test(description = "returns Date when response format is date", enabled = true) - public void dateTest() { - final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/datePropertyTest.json"); - final DefaultCodegen codegen = new Swift4Codegen(); - codegen.setOpenAPI(openAPI); - final String path = "/tests/dateResponse"; - final Operation p = openAPI.getPaths().get(path).getPost(); - final CodegenOperation op = codegen.fromOperation(path, "post", p, null); - - Assert.assertEquals(op.returnType, "Date"); - Assert.assertEquals(op.bodyParam.dataType, "Date"); - } - - @Test(enabled = true) - public void testDefaultPodAuthors() throws Exception { - // Given - - // When - swiftCodegen.processOpts(); - - // Then - final String podAuthors = (String) swiftCodegen.additionalProperties().get(Swift4Codegen.POD_AUTHORS); - Assert.assertEquals(podAuthors, Swift4Codegen.DEFAULT_POD_AUTHORS); - } - - @Test(enabled = true) - public void testPodAuthors() throws Exception { - // Given - final String openAPIDevs = "OpenAPI Devs"; - swiftCodegen.additionalProperties().put(Swift4Codegen.POD_AUTHORS, openAPIDevs); - - // When - swiftCodegen.processOpts(); - - // Then - final String podAuthors = (String) swiftCodegen.additionalProperties().get(Swift4Codegen.POD_AUTHORS); - Assert.assertEquals(podAuthors, openAPIDevs); - } - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java deleted file mode 100644 index 2b7696ba53..0000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelEnumTest.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.IntegerSchema; -import io.swagger.v3.oas.models.media.NumberSchema; -import io.swagger.v3.oas.models.media.Schema; -import io.swagger.v3.oas.models.media.StringSchema; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -import java.math.BigDecimal; -import java.util.Arrays; - -@SuppressWarnings("static-method") -public class Swift4ModelEnumTest { - @Test(description = "convert a java model with an string enum and a default value") - public void convertStringDefaultValueTest() { - final StringSchema enumSchema = new StringSchema(); - enumSchema.setEnum(Arrays.asList("VALUE1", "VALUE2", "VALUE3")); - enumSchema.setDefault("VALUE2"); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "String"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, ".value2"); - Assert.assertEquals(enumVar.baseType, "String"); - Assert.assertTrue(enumVar.isEnum); - } - - @Test(description = "convert a java model with an reserved word string enum and a default value") - public void convertReservedWordStringDefaultValueTest() { - final StringSchema enumSchema = new StringSchema(); - enumSchema.setEnum(Arrays.asList("1st", "2nd", "3rd")); - enumSchema.setDefault("2nd"); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "String"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "._2nd"); - Assert.assertEquals(enumVar.baseType, "String"); - Assert.assertTrue(enumVar.isEnum); - } - - @Test(description = "convert a java model with an integer enum and a default value") - public void convertIntegerDefaultValueTest() { - final IntegerSchema enumSchema = new IntegerSchema(); - enumSchema.setEnum(Arrays.asList(1, 2, 3)); - enumSchema.setDefault(2); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "Int"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "._2"); - Assert.assertEquals(enumVar.baseType, "Int"); - Assert.assertTrue(enumVar.isEnum); - } - - @Test(description = "convert a java model with an number enum and a default value") - public void convertNumberDefaultValueTest() { - final NumberSchema enumSchema = new NumberSchema(); - enumSchema.setEnum(Arrays.asList(new BigDecimal(10), new BigDecimal(100), new BigDecimal(1000))); - enumSchema.setDefault(new BigDecimal((100))); - final Schema model = new Schema().type("object").addProperties("name", enumSchema); - - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", model); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", model); - - Assert.assertEquals(cm.vars.size(), 1); - - final CodegenProperty enumVar = cm.vars.get(0); - Assert.assertEquals(enumVar.baseName, "name"); - Assert.assertEquals(enumVar.dataType, "Double"); - Assert.assertEquals(enumVar.datatypeWithEnum, "Name"); - Assert.assertEquals(enumVar.name, "name"); - Assert.assertEquals(enumVar.defaultValue, "._100"); - Assert.assertEquals(enumVar.baseType, "Double"); - Assert.assertTrue(enumVar.isEnum); - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java deleted file mode 100644 index f87ad85738..0000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4ModelTest.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.media.*; -import io.swagger.v3.parser.util.SchemaTypeUtil; -import org.openapitools.codegen.CodegenModel; -import org.openapitools.codegen.CodegenProperty; -import org.openapitools.codegen.DefaultCodegen; -import org.openapitools.codegen.TestUtils; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.testng.Assert; -import org.testng.annotations.Test; - -@SuppressWarnings("static-method") -public class Swift4ModelTest { - - @Test(description = "convert a simple java model", enabled = true) - public void simpleModelTest() { - final Schema schema = new Schema() - .description("a sample model") - .addProperties("id", new IntegerSchema().format(SchemaTypeUtil.INTEGER64_FORMAT)) - .addProperties("name", new StringSchema()) - .addProperties("createdAt", new DateTimeSchema()) - .addProperties("binary", new BinarySchema()) - .addProperties("byte", new ByteArraySchema()) - .addProperties("uuid", new UUIDSchema()) - .addProperties("dateOfBirth", new DateSchema()) - .addRequiredItem("id") - .addRequiredItem("name") - .discriminator(new Discriminator().propertyName("test")); - final DefaultCodegen codegen = new Swift4Codegen(); - OpenAPI openAPI = TestUtils.createOpenAPIWithOneSchema("sample", schema); - codegen.setOpenAPI(openAPI); - final CodegenModel cm = codegen.fromModel("sample", schema); - - Assert.assertEquals(cm.name, "sample"); - Assert.assertEquals(cm.classname, "Sample"); - Assert.assertEquals(cm.description, "a sample model"); - Assert.assertEquals(cm.vars.size(), 7); - Assert.assertEquals(cm.getDiscriminatorName(),"test"); - - final CodegenProperty property1 = cm.vars.get(0); - Assert.assertEquals(property1.baseName, "id"); - Assert.assertEquals(property1.dataType, "Int64"); - Assert.assertEquals(property1.name, "id"); - Assert.assertNull(property1.defaultValue); - Assert.assertEquals(property1.baseType, "Int64"); - Assert.assertTrue(property1.required); - Assert.assertTrue(property1.isPrimitiveType); - Assert.assertFalse(property1.isContainer); - - final CodegenProperty property2 = cm.vars.get(1); - Assert.assertEquals(property2.baseName, "name"); - Assert.assertEquals(property2.dataType, "String"); - Assert.assertEquals(property2.name, "name"); - Assert.assertNull(property2.defaultValue); - Assert.assertEquals(property2.baseType, "String"); - Assert.assertTrue(property2.required); - Assert.assertTrue(property2.isPrimitiveType); - Assert.assertFalse(property2.isContainer); - - final CodegenProperty property3 = cm.vars.get(2); - Assert.assertEquals(property3.baseName, "createdAt"); - Assert.assertEquals(property3.dataType, "Date"); - Assert.assertEquals(property3.name, "createdAt"); - Assert.assertNull(property3.defaultValue); - Assert.assertEquals(property3.baseType, "Date"); - Assert.assertFalse(property3.required); - Assert.assertFalse(property3.isContainer); - - final CodegenProperty property4 = cm.vars.get(3); - Assert.assertEquals(property4.baseName, "binary"); - Assert.assertEquals(property4.dataType, "URL"); - Assert.assertEquals(property4.name, "binary"); - Assert.assertNull(property4.defaultValue); - Assert.assertEquals(property4.baseType, "URL"); - Assert.assertFalse(property4.required); - Assert.assertFalse(property4.isContainer); - - final CodegenProperty property5 = cm.vars.get(4); - Assert.assertEquals(property5.baseName, "byte"); - Assert.assertEquals(property5.dataType, "Data"); - Assert.assertEquals(property5.name, "byte"); - Assert.assertNull(property5.defaultValue); - Assert.assertEquals(property5.baseType, "Data"); - Assert.assertFalse(property5.required); - Assert.assertFalse(property5.isContainer); - - final CodegenProperty property6 = cm.vars.get(5); - Assert.assertEquals(property6.baseName, "uuid"); - Assert.assertEquals(property6.dataType, "UUID"); - Assert.assertEquals(property6.name, "uuid"); - Assert.assertNull(property6.defaultValue); - Assert.assertEquals(property6.baseType, "UUID"); - Assert.assertFalse(property6.required); - Assert.assertFalse(property6.isContainer); - - final CodegenProperty property7 = cm.vars.get(6); - Assert.assertEquals(property7.baseName, "dateOfBirth"); - Assert.assertEquals(property7.dataType, "Date"); - Assert.assertEquals(property7.name, "dateOfBirth"); - Assert.assertNull(property7.defaultValue); - Assert.assertEquals(property7.baseType, "Date"); - Assert.assertFalse(property7.required); - Assert.assertFalse(property7.isContainer); - } - -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java deleted file mode 100644 index dc4aa7d094..0000000000 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift4/Swift4OptionsTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech) - * Copyright 2018 SmartBear Software - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.openapitools.codegen.swift4; - -import org.openapitools.codegen.AbstractOptionsTest; -import org.openapitools.codegen.CodegenConfig; -import org.openapitools.codegen.languages.Swift4Codegen; -import org.openapitools.codegen.options.Swift4OptionsProvider; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; - -public class Swift4OptionsTest extends AbstractOptionsTest { - private Swift4Codegen clientCodegen = mock(Swift4Codegen.class, mockSettings); - - public Swift4OptionsTest() { - super(new Swift4OptionsProvider()); - } - - @Override - protected CodegenConfig getCodegenConfig() { - return clientCodegen; - } - - @SuppressWarnings("unused") - @Override - protected void verifyOptions() { - verify(clientCodegen).setSortParamsByRequiredFlag(Boolean.valueOf(Swift4OptionsProvider.SORT_PARAMS_VALUE)); - verify(clientCodegen).setProjectName(Swift4OptionsProvider.PROJECT_NAME_VALUE); - verify(clientCodegen).setResponseAs(Swift4OptionsProvider.RESPONSE_AS_VALUE.split(",")); - verify(clientCodegen).setNonPublicApi(Boolean.parseBoolean(Swift4OptionsProvider.NON_PUBLIC_API_REQUIRED_VALUE)); - verify(clientCodegen).setUnwrapRequired(Boolean.parseBoolean(Swift4OptionsProvider.UNWRAP_REQUIRED_VALUE)); - verify(clientCodegen).setObjcCompatible(Boolean.parseBoolean(Swift4OptionsProvider.OBJC_COMPATIBLE_VALUE)); - verify(clientCodegen).setLenientTypeCast(Boolean.parseBoolean(Swift4OptionsProvider.LENIENT_TYPE_CAST_VALUE)); - verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift4OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); - } -} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java index 0550f03de2..20f6c3f46a 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/swift5/Swift5OptionsTest.java @@ -49,8 +49,8 @@ public class Swift5OptionsTest extends AbstractOptionsTest { verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(Swift5OptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setReadonlyProperties(Boolean.parseBoolean(Swift5OptionsProvider.READONLY_PROPERTIES_VALUE)); verify(clientCodegen).setRemoveMigrationProjectNameClass(Boolean.parseBoolean(Swift5OptionsProvider.REMOVE_MIGRATION_PROJECT_NAME_CLASS_VALUE)); - verify(clientCodegen).setGenerateFrozenEnums(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_FROZEN_ENUMS_VALUE)); verify(clientCodegen).setGenerateModelAdditionalProperties(Boolean.parseBoolean(Swift5OptionsProvider.GENERATE_MODEL_ADDITIONAL_PROPERTIES_VALUE)); verify(clientCodegen).setHashableModels(Boolean.parseBoolean(Swift5OptionsProvider.HASHABLE_MODELS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(Swift5OptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java index cd247de119..be1801e640 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/aurelia/TypeScriptAureliaClientOptionsTest.java @@ -45,5 +45,6 @@ public class TypeScriptAureliaClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setParamNaming(TypeScriptAureliaClientOptionsProvider.PARAM_NAMING_VALUE); verify(clientCodegen).setSupportsES6(TypeScriptAureliaClientOptionsProvider.SUPPORTS_ES6_VALUE); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAureliaClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptAureliaClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java index 7b29653b31..afd91bd472 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/fetch/TypeScriptFetchClientOptionsTest.java @@ -48,5 +48,6 @@ public class TypeScriptFetchClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setTypescriptThreePlus(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.TYPESCRIPT_THREE_PLUS)); verify(clientCodegen).setWithoutRuntimeChecks(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.WITHOUT_RUNTIME_CHECKS)); verify(clientCodegen).setSagasAndRecords(Boolean.valueOf(TypeScriptFetchClientOptionsProvider.SAGAS_AND_RECORDS)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptFetchClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java index 5359b81e6a..38b1f0ee4d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangular/TypeScriptAngularClientOptionsTest.java @@ -47,5 +47,6 @@ public class TypeScriptAngularClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); verify(clientCodegen).setQueryParamObjectFormat(TypeScriptAngularClientOptionsProvider.QUERY_PARAM_OBJECT_FORMAT_VALUE); verify(clientCodegen).setParamNaming(TypeScriptAngularClientOptionsProvider.PARAM_NAMING_VALUE); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptAngularClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java index 54710992d9..b2c9c066b8 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptangularjs/TypeScriptAngularJsClientOptionsTest.java @@ -45,5 +45,6 @@ public class TypeScriptAngularJsClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setParamNaming(TypeScriptAngularJsClientOptionsProvider.PARAM_NAMING_VALUE); verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.SUPPORTS_ES6_VALUE)); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptAngularJsClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptAngularJsClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java index 5f2138a66c..ba042c8471 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnestjs/TypeScriptNestjsClientOptionsTest.java @@ -46,5 +46,6 @@ public class TypeScriptNestjsClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptNestjsClientOptionsProvider.SUPPORTS_ES6_VALUE)); verify(clientCodegen).setStringEnums(Boolean.parseBoolean(TypeScriptNestjsClientOptionsProvider.STRING_ENUMS_VALUE)); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptNestjsClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptNestjsClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java index 414c63dd27..680759c870 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/typescriptnode/TypeScriptNodeClientOptionsTest.java @@ -45,5 +45,6 @@ public class TypeScriptNodeClientOptionsTest extends AbstractOptionsTest { verify(clientCodegen).setParamNaming(TypeScriptNodeClientOptionsProvider.PARAM_NAMING_VALUE); verify(clientCodegen).setSupportsES6(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.SUPPORTS_ES6_VALUE)); verify(clientCodegen).setPrependFormOrBodyParameters(Boolean.valueOf(TypeScriptNodeClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); + verify(clientCodegen).setEnumUnknownDefaultCase(Boolean.parseBoolean(TypeScriptNodeClientOptionsProvider.ENUM_UNKNOWN_DEFAULT_CASE_VALUE)); } } diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES index 66329670bf..edff1ccea7 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/FILES @@ -22,6 +22,7 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt index ef0c183338..3925a4181e 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.ModelWithEnumPropertyHavingDefault +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index e22592e47d..755f8240ed 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,6 +1,7 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory object Serializer { @@ -18,6 +19,7 @@ object Serializer { @JvmStatic val moshi: Moshi by lazy { + SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder) moshiBuilder.build() } } diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt new file mode 100644 index 0000000000..d3789e4823 --- /dev/null +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt @@ -0,0 +1,12 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter + +object SerializerHelper { + fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder { + return moshiBuilder + .add(org.openapitools.client.models.ModelWithEnumPropertyHavingDefault.PropertyName::class.java, EnumJsonAdapter.create(org.openapitools.client.models.ModelWithEnumPropertyHavingDefault.PropertyName::class.java) + .withUnknownFallback(org.openapitools.client.models.ModelWithEnumPropertyHavingDefault.PropertyName.unknownDefaultOpenApi)) + } +} diff --git a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt index 80f0176dc0..16982beb88 100644 --- a/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt +++ b/samples/client/petstore/kotlin-enum-default-value/src/main/kotlin/org/openapitools/client/models/ModelWithEnumPropertyHavingDefault.kt @@ -43,10 +43,11 @@ data class ModelWithEnumPropertyHavingDefault ( /** * * - * Values: vALUE + * Values: vALUE,unknownDefaultOpenApi */ enum class PropertyName(val value: kotlin.String) { - @Json(name = "VALUE") vALUE("VALUE"); + @Json(name = "VALUE") vALUE("VALUE"), + @Json(name = "unknown_default_open_api") unknownDefaultOpenApi("unknown_default_open_api"); } } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b..54b52a8118 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.google.gson.annotations.SerializedName + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..5dff82cca1 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.google.gson.annotations.SerializedName + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..3cd3a17289 100644 --- a/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.google.gson.annotations.SerializedName + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b..b07f6fb114 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.fasterxml.jackson.annotation.JsonProperty + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @JsonProperty(value = "available") AVAILABLE("available"), + @JsonProperty(value = "pending") PENDING("pending"), + @JsonProperty(value = "sold") SOLD("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..5f5f7ecffe 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.fasterxml.jackson.annotation.JsonProperty + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..332503b189 100644 --- a/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.fasterxml.jackson.annotation.JsonProperty + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index dcb8d97586..5c62ed5b98 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -247,7 +249,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } @@ -320,7 +322,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun getAllPetsRequestConfig(lastUpdated: java.time.OffsetDateTime?) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { if (lastUpdated != null) { put("lastUpdated", listOf(parseDateToQueryString(lastUpdated))) diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..916a865f7a 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..1c294b5e22 100644 --- a/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 1cd9901c0f..6b26a13e51 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.google.gson.annotations.SerializedName + import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient @@ -187,6 +189,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @SerializedName(value = "available") available("available"), + @SerializedName(value = "pending") pending("pending"), + @SerializedName(value = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -200,7 +212,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { + suspend fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List = withContext(Dispatchers.IO) { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return@withContext when (localVarResponse.responseType) { @@ -228,7 +240,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { + suspend fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> = withContext(Dispatchers.IO) { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return@withContext request>( @@ -242,9 +254,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -322,7 +334,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 430d9449c4..ffa098db6c 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.google.gson.annotations.SerializedName + import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index d318fa7477..724e2d6fd2 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.google.gson.annotations.SerializedName + import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import org.openapitools.client.infrastructure.ApiClient @@ -445,7 +447,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b..601ca6b01f 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..916a865f7a 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..1c294b5e22 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 33d1e110f1..4eefd44019 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas ) } + /** + * enum for parameter status + */ + internal enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index 02201f04d4..e5d64330d9 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 3475e9c469..363f3924a0 100644 --- a/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ internal class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(ba */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 8f8335f8b7..9e40a8d6be 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List? { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index b35fda4472..a305a6661a 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index 87ad7db896..bc8b00bc28 100644 --- a/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES index c7a409ac16..2710ee4244 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/FILES @@ -31,6 +31,7 @@ src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt src/main/kotlin/org/openapitools/client/infrastructure/URIAdapter.kt src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt src/main/kotlin/org/openapitools/client/models/Category.kt diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b..601ca6b01f 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..916a865f7a 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..1c294b5e22 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt index e22592e47d..755f8240ed 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt @@ -1,6 +1,7 @@ package org.openapitools.client.infrastructure import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory object Serializer { @@ -18,6 +19,7 @@ object Serializer { @JvmStatic val moshi: Moshi by lazy { + SerializerHelper.addEnumUnknownDefaultCase(moshiBuilder) moshiBuilder.build() } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt new file mode 100644 index 0000000000..e00c195ee2 --- /dev/null +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/infrastructure/SerializerHelper.kt @@ -0,0 +1,14 @@ +package org.openapitools.client.infrastructure + +import com.squareup.moshi.Moshi +import com.squareup.moshi.adapters.EnumJsonAdapter + +object SerializerHelper { + fun addEnumUnknownDefaultCase(moshiBuilder: Moshi.Builder): Moshi.Builder { + return moshiBuilder + .add(org.openapitools.client.models.Order.Status::class.java, EnumJsonAdapter.create(org.openapitools.client.models.Order.Status::class.java) + .withUnknownFallback(org.openapitools.client.models.Order.Status.unknownDefaultOpenApi)) + .add(org.openapitools.client.models.Pet.Status::class.java, EnumJsonAdapter.create(org.openapitools.client.models.Pet.Status::class.java) + .withUnknownFallback(org.openapitools.client.models.Pet.Status.unknownDefaultOpenApi)) + } +} diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt index 1c87feb697..7195f33669 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -60,12 +60,13 @@ data class Order ( /** * Order Status * - * Values: placed,approved,delivered + * Values: placed,approved,delivered,unknownDefaultOpenApi */ enum class Status(val value: kotlin.String) { @Json(name = "placed") placed("placed"), @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); + @Json(name = "delivered") delivered("delivered"), + @Json(name = "unknown_default_open_api") unknownDefaultOpenApi("unknown_default_open_api"); } } diff --git a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt index fb28ee9222..801bd2a822 100644 --- a/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -62,12 +62,13 @@ data class Pet ( /** * pet status in the store * - * Values: available,pending,sold + * Values: available,pending,sold,unknownDefaultOpenApi */ enum class Status(val value: kotlin.String) { @Json(name = "available") available("available"), @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); + @Json(name = "sold") sold("sold"), + @Json(name = "unknown_default_open_api") unknownDefaultOpenApi("unknown_default_open_api"); } } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index 40c875dcdc..870811a2c9 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..916a865f7a 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..1c294b5e22 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b..601ca6b01f 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..916a865f7a 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..1c294b5e22 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt index 9e39ffb9d0..325c66305b 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt +++ b/samples/client/petstore/kotlin-uppercase-enum/src/main/kotlin/org/openapitools/client/apis/EnumApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.PetEnum +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt index b774e10e7b..601ca6b01f 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt @@ -25,6 +25,8 @@ import java.io.IOException import org.openapitools.client.models.ModelApiResponse import org.openapitools.client.models.Pet +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -185,6 +187,16 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { ) } + /** + * enum for parameter status + */ + enum class Status_findPetsByStatus(val value: kotlin.String) { + @Json(name = "available") available("available"), + @Json(name = "pending") pending("pending"), + @Json(name = "sold") sold("sold"), + ; + } + /** * Finds Pets by status * Multiple status values can be provided with comma separated strings @@ -198,7 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class, UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { + fun findPetsByStatus(status: kotlin.collections.List) : kotlin.collections.List { val localVarResponse = findPetsByStatusWithHttpInfo(status = status) return when (localVarResponse.responseType) { @@ -226,7 +238,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ @Suppress("UNCHECKED_CAST") @Throws(IllegalStateException::class, IOException::class) - fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { + fun findPetsByStatusWithHttpInfo(status: kotlin.collections.List) : ApiResponse?> { val localVariableConfig = findPetsByStatusRequestConfig(status = status) return request>( @@ -240,9 +252,9 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { * @param status Status values that need to be considered for filter * @return RequestConfig */ - fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { + fun findPetsByStatusRequestConfig(status: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("status", toMultiValue(status.toList(), "csv")) } @@ -320,7 +332,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { @Deprecated(message = "This operation is deprecated.") fun findPetsByTagsRequestConfig(tags: kotlin.collections.List) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("tags", toMultiValue(tags.toList(), "csv")) } diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt index d9cc68f004..916a865f7a 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.Order +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt index efbff79281..1c294b5e22 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt @@ -24,6 +24,8 @@ import java.io.IOException import org.openapitools.client.models.User +import com.squareup.moshi.Json + import org.openapitools.client.infrastructure.ApiClient import org.openapitools.client.infrastructure.ApiResponse import org.openapitools.client.infrastructure.ClientException @@ -443,7 +445,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { */ fun loginUserRequestConfig(username: kotlin.String, password: kotlin.String) : RequestConfig { val localVariableBody = null - val localVariableQuery: MultiValueMap = mutableMapOf>() + val localVariableQuery: MultiValueMap = mutableMapOf>() .apply { put("username", listOf(username.toString())) put("password", listOf(password.toString())) diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift index 321066b9f4..e41babad70 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift @@ -15,20 +15,12 @@ public struct EnumArrays: Codable, Hashable { public enum JustSymbol: String, Codable, CaseIterable, CaseIterableDefaultsLast { case greaterThanOrEqualTo = ">=" case dollar = "$" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public enum ArrayEnum: String, Codable, CaseIterable, CaseIterableDefaultsLast { case fish = "fish" case crab = "crab" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var justSymbol: JustSymbol? public var arrayEnum: [ArrayEnum]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift index eef3045b29..232f04f3dd 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift @@ -14,9 +14,5 @@ public enum EnumClass: String, Codable, CaseIterable, CaseIterableDefaultsLast { case abc = "_abc" case efg = "-efg" case xyz = "(xyz)" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift index d6a96c72d9..72eaac6069 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift @@ -16,49 +16,23 @@ public struct EnumTest: Codable, Hashable { case upper = "UPPER" case lower = "lower" case empty = "" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public enum EnumStringRequired: String, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" case lower = "lower" case empty = "" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public enum EnumInteger: Int, Codable, CaseIterable, CaseIterableDefaultsLast { case _1 = 1 case number1 = -1 - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + case unknownDefaultOpenApi = 11184809 } public enum EnumNumber: Double, Codable, CaseIterable, CaseIterableDefaultsLast { case _11 = 1.1 case number12 = -1.2 - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - // - // 192, used to calculate the raw value, was the Swift Evolution proposal for - // frozen/non-frozen enums. - // [SE-0192](https://github.com/apple/swift-evolution/blob/master/proposals/0192-non-exhaustive-enums.md) - // - case unknownDefaultOpenAPI = -11184809 // Int.min / 192 + case unknownDefaultOpenApi = 11184809 } public var enumString: EnumString? public var enumStringRequired: EnumStringRequired diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift index c0b5a36945..fcae4e7e93 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -15,11 +15,7 @@ public struct MapTest: Codable, Hashable { public enum MapOfEnumString: String, Codable, CaseIterable, CaseIterableDefaultsLast { case upper = "UPPER" case lower = "lower" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var mapMapOfString: [String: [String: String]]? public var mapOfEnumString: [String: String]? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift index 5615d10ff4..57c1c4f866 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Order.swift @@ -16,11 +16,7 @@ public struct Order: Codable, Hashable { case placed = "placed" case approved = "approved" case delivered = "delivered" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var id: Int64? public var petId: Int64? diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift index e418b2c445..4c1af47007 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift @@ -14,9 +14,5 @@ public enum OuterEnum: String, Codable, CaseIterable, CaseIterableDefaultsLast { case placed = "placed" case approved = "approved" case delivered = "delivered" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 81afbc4b2a..45b4cff8e1 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -16,11 +16,7 @@ public struct Pet: Codable, Hashable { case available = "available" case pending = "pending" case sold = "sold" - // This case is a catch-all generated by OpenAPI such that the enum is "non-frozen". - // If new enum cases are added that are unknown to the spec/client, they are safely - // decoded to this case. The raw value of this case is a dummy value that attempts - // to avoids collisions with previously specified cases. - case unknownDefaultOpenAPI = "unknown_default_open_api" + case unknownDefaultOpenApi = "unknown_default_open_api" } public var id: Int64? public var category: Category? From e3788ce44ed8c61843ae0a8b8adab032982439a4 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Dec 2021 15:48:47 +0800 Subject: [PATCH 40/54] update doc for okhttp-gson-nextgen --- docs/generators/java.md | 2 +- .../org/openapitools/codegen/languages/JavaClientCodegen.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/generators/java.md b/docs/generators/java.md index 9f432edc97..cdab88d701 100644 --- a/docs/generators/java.md +++ b/docs/generators/java.md @@ -40,7 +40,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |invokerPackage|root package for generated code| |org.openapitools.client| |java8|Use Java8 classes instead of third party equivalents. Starting in 5.x, JDK8 is the default and the support for JDK7, JDK6 has been dropped|
          **true**
          Use Java 8 classes such as Base64
          **false**
          Various third party libraries as needed
          |true| |legacyDiscriminatorBehavior|Set to false for generators with better support for discriminators. (Python, Java, Go, PowerShell, C#have this enabled by default).|
          **true**
          The mapping in the discriminator includes descendent schemas that allOf inherit from self and the discriminator mapping schemas in the OAS document.
          **false**
          The mapping in the discriminator includes any descendent schemas that allOf inherit from self, any oneOf schemas, any anyOf schemas, any x-discriminator-values, and the discriminator mapping schemas in the OAS document AND Codegen validates that oneOf and anyOf schemas contain the required discriminator and throws an error if the discriminator is missing.
          |true| -|library|library template (sub-template) to use|
          **jersey1**
          HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
          **jersey2**
          HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
          **feign**
          HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
          **okhttp-gson**
          [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
          **okhttp-gson-nextgen**
          HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release.
          **retrofit2**
          HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
          **resttemplate**
          HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
          **webclient**
          HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
          **resteasy**
          HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
          **vertx**
          HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
          **google-api-client**
          HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
          **rest-assured**
          HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
          **native**
          HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
          **microprofile**
          HTTP client: Microprofile client 1.x. JSON processing: JSON-B
          **apache-httpclient**
          HTTP client: Apache httpclient 4.x
          |okhttp-gson| +|library|library template (sub-template) to use|
          **jersey1**
          HTTP client: Jersey client 1.19.x. JSON processing: Jackson 2.9.x. Enable gzip request encoding using '-DuseGzipFeature=true'. IMPORTANT NOTE: jersey 1.x is no longer actively maintained so please upgrade to 'jersey2' or other HTTP libraries instead.
          **jersey2**
          HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x
          **feign**
          HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x.
          **okhttp-gson**
          [DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'.
          **okhttp-gson-nextgen**
          HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release. IMPORTANT: this may subject to breaking changes without further notice.
          **retrofit2**
          HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)
          **resttemplate**
          HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x
          **webclient**
          HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x
          **resteasy**
          HTTP client: Resteasy client 3.x. JSON processing: Jackson 2.9.x
          **vertx**
          HTTP client: VertX client 3.x. JSON processing: Jackson 2.9.x
          **google-api-client**
          HTTP client: Google API client 1.x. JSON processing: Jackson 2.9.x
          **rest-assured**
          HTTP client: rest-assured : 4.x. JSON processing: Gson 2.x or Jackson 2.10.x. Only for Java 8
          **native**
          HTTP client: Java native HttpClient. JSON processing: Jackson 2.9.x. Only for Java11+
          **microprofile**
          HTTP client: Microprofile client 1.x. JSON processing: JSON-B
          **apache-httpclient**
          HTTP client: Apache httpclient 4.x
          |okhttp-gson| |licenseName|The name of the license| |Unlicense| |licenseUrl|The URL of the license| |http://unlicense.org| |microprofileFramework|Framework for microprofile. Possible values "kumuluzee"| |null| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java index f675c9a9c3..2d4a3214b0 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java @@ -174,7 +174,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen supportedLibraries.put(JERSEY2, "HTTP client: Jersey client 2.25.1. JSON processing: Jackson 2.9.x"); supportedLibraries.put(FEIGN, "HTTP client: OpenFeign 10.x. JSON processing: Jackson 2.9.x."); supportedLibraries.put(OKHTTP_GSON, "[DEFAULT] HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); - supportedLibraries.put(OKHTTP_GSON_NEXTGEN, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release."); + supportedLibraries.put(OKHTTP_GSON_NEXTGEN, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.8.x.'. Better support for oneOf/anyOf with breaking changes. Will replace `okhttp-gson` in the 6.0.0 release. IMPORTANT: this may subject to breaking changes without further notice."); supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.x. JSON processing: Gson 2.x (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2/3]=true'. (RxJava 1.x or 2.x or 3.x)"); supportedLibraries.put(RESTTEMPLATE, "HTTP client: Spring RestTemplate 4.x. JSON processing: Jackson 2.9.x"); supportedLibraries.put(WEBCLIENT, "HTTP client: Spring WebClient 5.x. JSON processing: Jackson 2.9.x"); From 6269a9810c427422f99d9eb63e4831e70de17c6f Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Dec 2021 18:20:13 +0800 Subject: [PATCH 41/54] Prepare 5.3.1 release (#11161) * prepare v5.3.1 release * update samples --- modules/openapi-generator-cli/pom.xml | 2 +- modules/openapi-generator-core/pom.xml | 2 +- modules/openapi-generator-gradle-plugin/gradle.properties | 2 +- modules/openapi-generator-gradle-plugin/pom.xml | 2 +- .../samples/local-spec/gradle.properties | 2 +- modules/openapi-generator-maven-plugin/examples/java-client.xml | 2 +- modules/openapi-generator-maven-plugin/examples/kotlin.xml | 2 +- .../examples/multi-module/java-client/pom.xml | 2 +- .../examples/non-java-invalid-spec.xml | 2 +- modules/openapi-generator-maven-plugin/examples/non-java.xml | 2 +- modules/openapi-generator-maven-plugin/examples/spring.xml | 2 +- modules/openapi-generator-maven-plugin/pom.xml | 2 +- modules/openapi-generator-online/pom.xml | 2 +- modules/openapi-generator/pom.xml | 2 +- pom.xml | 2 +- .../csharp-netcore-complex-files/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-streaming/.openapi-generator/VERSION | 2 +- samples/client/petstore/R/.openapi-generator/VERSION | 2 +- samples/client/petstore/apex/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/c/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-qt/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restsdk/client/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.h | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.h | 2 +- samples/client/petstore/cpp-restsdk/client/IHttpBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.h | 2 +- .../client/petstore/cpp-restsdk/client/MultipartFormData.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/MultipartFormData.h | 2 +- samples/client/petstore/cpp-restsdk/client/Object.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/Object.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.h | 2 +- .../client/petstore/cpp-restsdk/client/model/ApiResponse.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.h | 2 +- samples/client/petstore/cpp-tiny/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-ue4/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.travis.yml | 2 +- samples/client/petstore/crystal/spec/spec_helper.cr | 2 +- samples/client/petstore/crystal/src/petstore.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/pet_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/store_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/user_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_client.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_error.cr | 2 +- samples/client/petstore/crystal/src/petstore/configuration.cr | 2 +- .../client/petstore/crystal/src/petstore/models/api_response.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/category.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/order.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/pet.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/tag.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/user.cr | 2 +- .../.openapi-generator/VERSION | 2 +- .../OpenAPIClient-httpclient/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net47/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net5.0/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClient/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION | 2 +- .../OpenAPIClientCoreAndNet47/.openapi-generator/VERSION | 2 +- .../petstore/csharp/OpenAPIClient/.openapi-generator/VERSION | 2 +- samples/client/petstore/elixir/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/groovy/.openapi-generator/VERSION | 2 +- .../petstore/haskell-http-client/.openapi-generator/VERSION | 2 +- .../petstore/java-micronaut-client/.openapi-generator/VERSION | 2 +- .../petstore/java/apache-httpclient/.openapi-generator/VERSION | 2 +- .../petstore/java/feign-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/feign/.openapi-generator/VERSION | 2 +- .../petstore/java/google-api-client/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/jersey1/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8-localdatetime/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../java/microprofile-rest-client/.openapi-generator/VERSION | 2 +- .../petstore/java/native-async/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/native/.openapi-generator/VERSION | 2 +- .../okhttp-gson-dynamicOperations/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-nextgen/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-parcelableModel/.openapi-generator/VERSION | 2 +- .../client/petstore/java/okhttp-gson/.openapi-generator/VERSION | 2 +- .../java/rest-assured-jackson/.openapi-generator/VERSION | 2 +- .../petstore/java/rest-assured/.openapi-generator/VERSION | 2 +- .../client/petstore/java/resteasy/.openapi-generator/VERSION | 2 +- .../java/resttemplate-withXml/.openapi-generator/VERSION | 2 +- .../petstore/java/resttemplate/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2-play26/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx3/.openapi-generator/VERSION | 2 +- .../petstore/java/vertx-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/vertx/.openapi-generator/VERSION | 2 +- .../java/webclient-nulable-arrays/.openapi-generator/VERSION | 2 +- .../client/petstore/java/webclient/.openapi-generator/VERSION | 2 +- .../client/petstore/javascript-es6/.openapi-generator/VERSION | 2 +- .../petstore/javascript-promise-es6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/script.js | 2 +- .../kotlin-enum-default-value/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin-gson/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-jackson/.openapi-generator/VERSION | 2 +- .../kotlin-json-request-string/.openapi-generator/VERSION | 2 +- .../kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-jvm-volley/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-moshi-codegen/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-multiplatform/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nonpublic/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nullable/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-okhttp3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-retrofit2/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-string/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-threetenbp/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-uppercase-enum/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/nim/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/core-data/.openapi-generator/VERSION | 2 +- samples/client/petstore/objc/default/.openapi-generator/VERSION | 2 +- samples/client/petstore/perl/.openapi-generator/VERSION | 2 +- .../client/petstore/php-dt-modern/.openapi-generator/VERSION | 2 +- samples/client/petstore/php-dt/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../php/OpenAPIClient-php/lib/Model/DeprecatedObject.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HealthCheckResult.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php | 2 +- .../lib/Model/OuterEnumIntegerDefaultValue.php | 2 +- .../OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- samples/client/petstore/powershell/.openapi-generator/VERSION | 2 +- .../client/petstore/python-asyncio/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../client/petstore/python-tornado/.openapi-generator/VERSION | 2 +- samples/client/petstore/python/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/lib/petstore.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/default_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/store_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/configuration.rb | 2 +- .../lib/petstore/models/additional_properties_class.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/animal.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/array_of_number_only.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/array_test.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/category.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/class_model.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/client.rb | 2 +- .../ruby-faraday/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_test.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/file.rb | 2 +- .../ruby-faraday/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/format_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/health_check_result.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_response_default.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/list.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../ruby-faraday/lib/petstore/models/model200_response.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/model_return.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/name.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/nullable_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/number_only.rb | 2 +- .../lib/petstore/models/object_with_deprecated_fields.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/order.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_composite.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/outer_enum.rb | 2 +- .../lib/petstore/models/outer_enum_default_value.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../ruby-faraday/lib/petstore/models/read_only_first.rb | 2 +- .../ruby-faraday/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby-faraday/petstore.gemspec | 2 +- samples/client/petstore/ruby-faraday/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/spec_helper.rb | 2 +- samples/client/petstore/ruby/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby/lib/petstore.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/another_fake_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/default_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/pet_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/store_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_error.rb | 2 +- samples/client/petstore/ruby/lib/petstore/configuration.rb | 2 +- .../ruby/lib/petstore/models/additional_properties_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/animal.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/api_response.rb | 2 +- .../ruby/lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/array_of_number_only.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/array_test.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/category.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/class_model.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/client.rb | 2 +- .../petstore/ruby/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_test.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/file.rb | 2 +- .../petstore/ruby/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/foo.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/format_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/has_only_read_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/health_check_result.rb | 2 +- .../ruby/lib/petstore/models/inline_response_default.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/list.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../petstore/ruby/lib/petstore/models/model200_response.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/model_return.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/name.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/nullable_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/number_only.rb | 2 +- .../ruby/lib/petstore/models/object_with_deprecated_fields.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/order.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/outer_composite.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb | 2 +- .../ruby/lib/petstore/models/outer_enum_default_value.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../ruby/lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/pet.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/read_only_first.rb | 2 +- .../petstore/ruby/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/tag.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby/petstore.gemspec | 2 +- samples/client/petstore/ruby/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby/spec/spec_helper.rb | 2 +- .../petstore/rust/hyper/petstore/.openapi-generator/VERSION | 2 +- .../rust/reqwest/petstore-async/.openapi-generator/VERSION | 2 +- .../petstore/rust/reqwest/petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-akka/.openapi-generator/VERSION | 2 +- .../scala-httpclient-deprecated/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-sttp/.openapi-generator/VERSION | 2 +- .../petstore/spring-cloud-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-cloud-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-cloud/.openapi-generator/VERSION | 2 +- .../spring-cloud/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-stubs/.openapi-generator/VERSION | 2 +- .../spring-stubs/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/swift5/alamofireLibrary/.openapi-generator/VERSION | 2 +- .../swift5/asyncAwaitLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/combineLibrary/.openapi-generator/VERSION | 2 +- .../client/petstore/swift5/default/.openapi-generator/VERSION | 2 +- .../petstore/swift5/deprecated/.openapi-generator/VERSION | 2 +- .../petstore/swift5/frozenEnums/.openapi-generator/VERSION | 2 +- .../petstore/swift5/nonPublicApi/.openapi-generator/VERSION | 2 +- .../petstore/swift5/objcCompatible/.openapi-generator/VERSION | 2 +- samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION | 2 +- .../swift5/promisekitLibrary/.openapi-generator/VERSION | 2 +- .../swift5/readonlyProperties/.openapi-generator/VERSION | 2 +- .../petstore/swift5/resultLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION | 2 +- .../swift5/urlsessionLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/vaporLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/x-swift-hashable/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/single-request-parameter/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/with-prefixed-module-name/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../typescript-aurelia/default/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript-axios/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/test-petstore/.openapi-generator/VERSION | 2 +- .../builds/with-complex-headers/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../with-single-request-parameters/.openapi-generator/VERSION | 2 +- .../builds/default-v3.0/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/default/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/enum/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/multiple-parameters/.openapi-generator/VERSION | 2 +- .../prefix-parameter-interfaces/.openapi-generator/VERSION | 2 +- .../builds/sagas-and-records/.openapi-generator/VERSION | 2 +- .../builds/typescript-three-plus/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/without-runtime-checks/.openapi-generator/VERSION | 2 +- .../petstore/typescript-inversify/.openapi-generator/VERSION | 2 +- .../typescript-jquery/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-jquery/npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/npm/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../typescript-rxjs/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/with-progress-subscriber/.openapi-generator/VERSION | 2 +- .../config/petstore/protobuf-schema/.openapi-generator/VERSION | 2 +- samples/meta-codegen/lib/pom.xml | 2 +- samples/meta-codegen/usage/.openapi-generator/VERSION | 2 +- samples/openapi3/client/elm/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/go-experimental/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/python/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api/usage_api.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_client.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_error.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/configuration.rb | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/api_client_spec.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/configuration_spec.rb | 2 +- .../extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb | 2 +- .../x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec | 2 +- .../features/dynamic-servers/python/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/dynamic_servers.gemspec | 2 +- .../client/features/dynamic-servers/ruby/lib/dynamic_servers.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_client.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_error.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/configuration.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/version.rb | 2 +- .../features/dynamic-servers/ruby/spec/api_client_spec.rb | 2 +- .../features/dynamic-servers/ruby/spec/configuration_spec.rb | 2 +- .../client/features/dynamic-servers/ruby/spec/spec_helper.rb | 2 +- .../ruby-client/.openapi-generator/VERSION | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore.rb | 2 +- .../ruby-client/lib/petstore/api/usage_api.rb | 2 +- .../ruby-client/lib/petstore/api_client.rb | 2 +- .../ruby-client/lib/petstore/api_error.rb | 2 +- .../ruby-client/lib/petstore/configuration.rb | 2 +- .../ruby-client/lib/petstore/models/array_alias.rb | 2 +- .../ruby-client/lib/petstore/models/map_alias.rb | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore/version.rb | 2 +- .../generate-alias-as-model/ruby-client/petstore.gemspec | 2 +- .../generate-alias-as-model/ruby-client/spec/api_client_spec.rb | 2 +- .../ruby-client/spec/configuration_spec.rb | 2 +- .../generate-alias-as-model/ruby-client/spec/spec_helper.rb | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart-dio/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- .../jersey2-java8-special-characters/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../openapi3/client/petstore/python/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript/builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript/builds/deno/.openapi-generator/VERSION | 2 +- .../typescript/builds/inversify/.openapi-generator/VERSION | 2 +- .../typescript/builds/jquery/.openapi-generator/VERSION | 2 +- .../typescript/builds/object_params/.openapi-generator/VERSION | 2 +- samples/schema/petstore/ktorm/.openapi-generator/VERSION | 2 +- samples/schema/petstore/mysql/.openapi-generator/VERSION | 2 +- samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.0/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.1/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-5.0/.openapi-generator/VERSION | 2 +- samples/server/petstore/aspnetcore/.openapi-generator/VERSION | 2 +- samples/server/petstore/cpp-pistache/.openapi-generator/VERSION | 2 +- .../cpp-qt-qhttpengine-server/.openapi-generator/VERSION | 2 +- .../server/petstore/erlang-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-api-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-chi-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-echo-server/.openapi-generator/VERSION | 2 +- .../petstore/go-gin-api-server/.openapi-generator/VERSION | 2 +- .../petstore/go-server-required/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-servant/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-yesod/.openapi-generator/VERSION | 2 +- samples/server/petstore/java-msf4j/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-async/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-no-interface/.openapi-generator/VERSION | 2 +- .../java-play-framework-no-nullable/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/java-play-framework/.openapi-generator/VERSION | 2 +- .../server/petstore/java-undertow/.openapi-generator/VERSION | 2 +- .../server/petstore/java-vertx-web/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-non-spring-app/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/default-value/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/default/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-spec-interface/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey1/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey2/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-server/ktor/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin-server/ktor/README.md | 2 +- .../kotlin-springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/kotlin/org/openapitools/api/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/UserApi.kt | 2 +- .../kotlin-springboot-modelMutable/.openapi-generator/VERSION | 2 +- .../kotlin-springboot-reactive/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-springboot/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-laravel/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-lumen/.openapi-generator/VERSION | 2 +- .../petstore/php-mezzio-ph-modern/.openapi-generator/VERSION | 2 +- .../server/petstore/php-mezzio-ph/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim4/.openapi-generator/VERSION | 2 +- .../php-symfony/SymfonyBundle-php/.openapi-generator/VERSION | 2 +- .../python-aiohttp-srclayout/.openapi-generator/VERSION | 2 +- .../server/petstore/python-aiohttp/.openapi-generator/VERSION | 2 +- .../petstore/python-blueplanet/.openapi-generator/VERSION | 2 +- .../server/petstore/python-fastapi/.openapi-generator/VERSION | 2 +- samples/server/petstore/python-flask/.openapi-generator/VERSION | 2 +- .../rust-server/output/multipart-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/no-example-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/openapi-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/ops-v3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../output/ping-bearer-auth/.openapi-generator/VERSION | 2 +- .../output/rust-server-test/.openapi-generator/VERSION | 2 +- .../spring-mvc-default-value/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/TestHeadersApi.java | 2 +- .../src/main/java/org/openapitools/api/TestQueryParamsApi.java | 2 +- .../petstore/spring-mvc-j8-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-j8-localdatetime/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/spring-mvc-no-nullable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/server/petstore/spring-mvc/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-beanvalidation/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate-j8/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-implicitHeaders/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-reactive/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-useoptional/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-virtualan/.openapi-generator/VERSION | 2 +- .../java/org/openapitools/virtualan/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/FakeApi.java | 2 +- .../org/openapitools/virtualan/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/UserApi.java | 2 +- samples/server/petstore/springboot/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/UserApi.java | 2 +- 697 files changed, 697 insertions(+), 697 deletions(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 6a7fbbda1b..3c12f8f791 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-core/pom.xml b/modules/openapi-generator-core/pom.xml index 166ba14131..911c03c857 100644 --- a/modules/openapi-generator-core/pom.xml +++ b/modules/openapi-generator-core/pom.xml @@ -6,7 +6,7 @@ openapi-generator-project org.openapitools - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-gradle-plugin/gradle.properties b/modules/openapi-generator-gradle-plugin/gradle.properties index e623391d60..c8fbf0f82a 100644 --- a/modules/openapi-generator-gradle-plugin/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/gradle.properties @@ -1,5 +1,5 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.3.1-SNAPSHOT +openApiGeneratorVersion=5.3.1 # /RELEASE_VERSION # BEGIN placeholders diff --git a/modules/openapi-generator-gradle-plugin/pom.xml b/modules/openapi-generator-gradle-plugin/pom.xml index c1b8953d83..6c6b9696d2 100644 --- a/modules/openapi-generator-gradle-plugin/pom.xml +++ b/modules/openapi-generator-gradle-plugin/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties index 0d00f845a9..08301dcb0b 100644 --- a/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties +++ b/modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties @@ -1,3 +1,3 @@ # RELEASE_VERSION -openApiGeneratorVersion=5.3.1-SNAPSHOT +openApiGeneratorVersion=5.3.1 # /RELEASE_VERSION diff --git a/modules/openapi-generator-maven-plugin/examples/java-client.xml b/modules/openapi-generator-maven-plugin/examples/java-client.xml index f37560b686..b82befe826 100644 --- a/modules/openapi-generator-maven-plugin/examples/java-client.xml +++ b/modules/openapi-generator-maven-plugin/examples/java-client.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/kotlin.xml b/modules/openapi-generator-maven-plugin/examples/kotlin.xml index e7ebc5a124..4960964cef 100644 --- a/modules/openapi-generator-maven-plugin/examples/kotlin.xml +++ b/modules/openapi-generator-maven-plugin/examples/kotlin.xml @@ -15,7 +15,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml index be8c5cb67b..f632bfc882 100644 --- a/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml +++ b/modules/openapi-generator-maven-plugin/examples/multi-module/java-client/pom.xml @@ -19,7 +19,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml index cf242a94ba..4fc8acf728 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/non-java.xml b/modules/openapi-generator-maven-plugin/examples/non-java.xml index 60018a26e6..1ccbb790ea 100644 --- a/modules/openapi-generator-maven-plugin/examples/non-java.xml +++ b/modules/openapi-generator-maven-plugin/examples/non-java.xml @@ -13,7 +13,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/examples/spring.xml b/modules/openapi-generator-maven-plugin/examples/spring.xml index 967d49a165..3bb8d3a51b 100644 --- a/modules/openapi-generator-maven-plugin/examples/spring.xml +++ b/modules/openapi-generator-maven-plugin/examples/spring.xml @@ -20,7 +20,7 @@ org.openapitools openapi-generator-maven-plugin - 5.3.1-SNAPSHOT + 5.3.1 diff --git a/modules/openapi-generator-maven-plugin/pom.xml b/modules/openapi-generator-maven-plugin/pom.xml index 1726f2e9e8..908c44da29 100644 --- a/modules/openapi-generator-maven-plugin/pom.xml +++ b/modules/openapi-generator-maven-plugin/pom.xml @@ -5,7 +5,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator-online/pom.xml b/modules/openapi-generator-online/pom.xml index 031cadea6c..c8e77f5df3 100644 --- a/modules/openapi-generator-online/pom.xml +++ b/modules/openapi-generator-online/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/modules/openapi-generator/pom.xml b/modules/openapi-generator/pom.xml index 7fbb9f96c3..15e0de2c60 100644 --- a/modules/openapi-generator/pom.xml +++ b/modules/openapi-generator/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 ../.. diff --git a/pom.xml b/pom.xml index 6dd63afc4b..3b27eb856d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom openapi-generator-project - 5.3.1-SNAPSHOT + 5.3.1 https://github.com/openapitools/openapi-generator diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION +++ b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp index 5d0f4a6475..885c229bfe 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h index 0e05b25a77..c2db5dc08c 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp index e691c52743..bd0cb8c0e9 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h index 9a254ad71e..d65ddb6b2f 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp index 82fc4f3c11..928bf8e041 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h index 9916a29e2c..bced883bee 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp index 22dabc4bef..eac0d66ff3 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h index 991e7a9f22..bfa0d19bbf 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h index 6655271d91..a5adf55cf8 100644 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp index 780f48f91e..b47bc2c5bd 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h index 5774baebae..c50267c56e 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 4d75c83b3e..75d1bb01cf 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h index 0e94211a66..831ffa9f4e 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp index d3085c0a7e..d8f3ee4340 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h index 0d48bd7aa0..d260399229 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp index a0ac8abe4f..968df9a487 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ b/samples/client/petstore/cpp-restsdk/client/Object.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h index 16b430c404..6bcec36c02 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ b/samples/client/petstore/cpp-restsdk/client/Object.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp index 08ff5e5772..2c2236f7d2 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h index bfe7bc38c8..a6bf7fcbcc 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp index 11f4d22ff5..7171938cad 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h index ded6008b51..5d35de7fc3 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp index 0cc08823dc..bc13700dfd 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h index a4a8f2e94e..0b2a614433 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp index 5473fd4704..214e69dcbe 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h index 3a1587556f..86a703fae9 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp index 56ec361b78..3250fef9ca 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h index 81233b6cb5..7ecefb5492 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp index 41a9930e46..4fc8ad8b5c 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h index 6f3a452e0d..a10e8c34f4 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp index f43a844f89..76867745ec 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h index a319e72ada..b5f8b346b3 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp index 90e3aab5d6..eafb5845d5 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h index ccccea9a60..a6f8d69325 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp index 2002040f14..074b337eda 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/User.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h index 181736a5a9..588445311b 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/model/User.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1-SNAPSHOT. + * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/crystal/.openapi-generator/VERSION b/samples/client/petstore/crystal/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/crystal/.openapi-generator/VERSION +++ b/samples/client/petstore/crystal/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/crystal/.travis.yml b/samples/client/petstore/crystal/.travis.yml index b0d669b09f..6bc76c0613 100644 --- a/samples/client/petstore/crystal/.travis.yml +++ b/samples/client/petstore/crystal/.travis.yml @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # language: crystal diff --git a/samples/client/petstore/crystal/spec/spec_helper.cr b/samples/client/petstore/crystal/spec/spec_helper.cr index 6df055fdea..901c229549 100644 --- a/samples/client/petstore/crystal/spec/spec_helper.cr +++ b/samples/client/petstore/crystal/spec/spec_helper.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # # load modules diff --git a/samples/client/petstore/crystal/src/petstore.cr b/samples/client/petstore/crystal/src/petstore.cr index 585ca028c1..95c15e0996 100644 --- a/samples/client/petstore/crystal/src/petstore.cr +++ b/samples/client/petstore/crystal/src/petstore.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # # Dependencies diff --git a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr index 813ae328c6..e2c81b3a3b 100644 --- a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/store_api.cr b/samples/client/petstore/crystal/src/petstore/api/store_api.cr index 4d05bcef67..f080f1a29a 100644 --- a/samples/client/petstore/crystal/src/petstore/api/store_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/store_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/user_api.cr b/samples/client/petstore/crystal/src/petstore/api/user_api.cr index c052abaa87..f936051d44 100644 --- a/samples/client/petstore/crystal/src/petstore/api/user_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/user_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api_client.cr b/samples/client/petstore/crystal/src/petstore/api_client.cr index a04d3b56a4..e8377faa33 100644 --- a/samples/client/petstore/crystal/src/petstore/api_client.cr +++ b/samples/client/petstore/crystal/src/petstore/api_client.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/api_error.cr b/samples/client/petstore/crystal/src/petstore/api_error.cr index a01117fbd5..482fcb9616 100644 --- a/samples/client/petstore/crystal/src/petstore/api_error.cr +++ b/samples/client/petstore/crystal/src/petstore/api_error.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # module Petstore diff --git a/samples/client/petstore/crystal/src/petstore/configuration.cr b/samples/client/petstore/crystal/src/petstore/configuration.cr index dcf7bc0c9b..d87702fb8a 100644 --- a/samples/client/petstore/crystal/src/petstore/configuration.cr +++ b/samples/client/petstore/crystal/src/petstore/configuration.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "log" diff --git a/samples/client/petstore/crystal/src/petstore/models/api_response.cr b/samples/client/petstore/crystal/src/petstore/models/api_response.cr index b9f3034a1e..0c0aa1fd1c 100644 --- a/samples/client/petstore/crystal/src/petstore/models/api_response.cr +++ b/samples/client/petstore/crystal/src/petstore/models/api_response.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/category.cr b/samples/client/petstore/crystal/src/petstore/models/category.cr index 5e24f73d28..11dcb87bad 100644 --- a/samples/client/petstore/crystal/src/petstore/models/category.cr +++ b/samples/client/petstore/crystal/src/petstore/models/category.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/order.cr b/samples/client/petstore/crystal/src/petstore/models/order.cr index 9f93b6ef45..4d03556ff8 100644 --- a/samples/client/petstore/crystal/src/petstore/models/order.cr +++ b/samples/client/petstore/crystal/src/petstore/models/order.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/pet.cr b/samples/client/petstore/crystal/src/petstore/models/pet.cr index 39ef758adc..7fb8cc4521 100644 --- a/samples/client/petstore/crystal/src/petstore/models/pet.cr +++ b/samples/client/petstore/crystal/src/petstore/models/pet.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/tag.cr b/samples/client/petstore/crystal/src/petstore/models/tag.cr index 76c99c2e07..9b95af047b 100644 --- a/samples/client/petstore/crystal/src/petstore/models/tag.cr +++ b/samples/client/petstore/crystal/src/petstore/models/tag.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/user.cr b/samples/client/petstore/crystal/src/petstore/models/user.cr index bb541138fb..7b647aaee1 100644 --- a/samples/client/petstore/crystal/src/petstore/models/user.cr +++ b/samples/client/petstore/crystal/src/petstore/models/user.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1-SNAPSHOT +#OpenAPI Generator version: 5.3.1 # require "json" diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/native-async/.openapi-generator/VERSION b/samples/client/petstore/java/native-async/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/k6/.openapi-generator/VERSION b/samples/client/petstore/k6/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/k6/.openapi-generator/VERSION +++ b/samples/client/petstore/k6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index 7ae1bf1453..da7d50e965 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator. * https://github.com/OpenAPITools/openapi-generator * - * OpenAPI generator version: 5.3.1-SNAPSHOT + * OpenAPI generator version: 5.3.1 */ diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/nim/.openapi-generator/VERSION b/samples/client/petstore/nim/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/nim/.openapi-generator/VERSION +++ b/samples/client/petstore/nim/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php-dt/.openapi-generator/VERSION b/samples/client/petstore/php-dt/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/php-dt/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index 1848ea6087..ef0239cf3c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index 98450dfdce..c46d14ceac 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index b284bfc1da..18321834a0 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 5b01b47886..2de6960003 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index 0ce7655f68..affa3d61c5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index b4084ea0f8..8af7471eba 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index f4137f4061..941de5bc55 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 9793625ce0..2011d70101 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 15c87c8833..8bd9fbe0f2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 65c30b8014..08598d5d89 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index cf51246752..34faf425f9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 4730a780c9..281c00ce1d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 94cd6c0081..0e98f27fd8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 9ac0724679..1699097ee9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index b6a77632dd..484d6d85db 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index 98656789cc..b273d72aad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index 80457e8bef..b27ff3277a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 1ab9ae8952..7ec56fb28f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 1f5442b746..86c145ba23 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 675ec09537..77cf9d7491 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index 061c4bbf2d..a10395aeb5 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 5a12e03f53..9003d71c55 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php index ce4a50797b..709840cf55 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index a8913e4d46..7019bc247b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 31c569fbff..340c9b62d4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index b075f037ce..7087c06f4b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index ca5795be26..95e659d81c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index bd4ba37593..a9b77449fb 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index 18598a117d..dab541a365 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 84ac5deed6..182bba9d0f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index cc6eec6f37..0350c9b702 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index 229691e3f9..ad12cf397c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index de6d9b2a1b..63d53152ed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 91effaad0c..1584ce6e4c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index d9c20bad20..6c2cddeab1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index d74dbb7187..aab4ab77d6 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 2c74ff0afd..12d73135f2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index b5d6024b0d..95c238707c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 50af9985b4..9cc0c37d23 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index c0148a3c95..c6f2fa418f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index f70e220357..136db271d3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index 2c6dd888ee..e99ec229be 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index ef6e0c99af..536d505ead 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index 4038d4bdd8..d178264a41 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php index a9ee861174..7fecb82803 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 8e0bfd035f..8ce7262cba 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index 0161dcb535..fe187afea2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 848fe8c710..507b3082ef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index 38cc912fa7..b6dd12bb8b 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index acdb884a64..f250dc8a6a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index bec3672715..955c64ce9a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php index 1f18ed694a..dd50c70fc3 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 5ed7cf3848..6b9279481c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index 0b9f551c97..c5a4506ed4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index 027cefe7b3..f024c4ed58 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 0d66323a9b..1e28a4712f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index ae5d4c147c..ca9f08769f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index cf82774644..b91eafd907 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1-SNAPSHOT + * OpenAPI Generator version: 5.3.1 */ /** diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/client/petstore/python-legacy/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 52888e58a2..2995b750e7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index 4bf4193b4e..df802567c9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index e3a7cd3103..6d11d8773a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index ee52929a24..20d12b5c1f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index 65485cff85..d00a18a1bf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index e0793d51f0..08f18cd4f1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index deac217eff..7c9e0fde7a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index e78912f6ec..9687de3f38 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index f6ad5e2c7a..568dd909fd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index becfa19ff9..a200afcf0a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index d7b5555cf8..b528aef09d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 7531ca6369..01f6b001ea 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index aa12eb3d75..1025187c82 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 696db1a23d..1049822b7f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 638f600b41..57c603716d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index b317724cf1..6668a18e93 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 882a63aba3..95cfe89d16 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index 438e60cb08..db3fd78685 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 23ffc61d74..61114303c8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 6edbd10d0d..33cb299c29 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 74b270bb2f..447b1573bf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index f86d40e3a3..d5c9fef37b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 6ec58e16ce..3314bca5ed 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb index a03e376856..b72cd21b93 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index f0e5b08505..40987f214e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index 4c6bf35e7f..e5c68f7983 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 5ef024fa4a..96dfcb24d7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index 597f28b713..f722acfc1d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index abbbd53eb4..aedf6b2c7e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index 87a2e68dac..f5ae1fed19 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 7a8b6dbbac..542d991d5a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index 4b78a1a4e0..ac18fe7bee 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 150c9c5fd4..4410e00a47 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index b45c4c559f..9f51cfada9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index f571546880..07be52509f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index 81cd539687..5fc7450bdf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index 7f7b06af81..a81fe7e5fd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 81d45842d3..24e2b85e72 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f4f82d05a2..73e2781755 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 250270b108..91ccd158a1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index c6415f59a1..d71c1f1bd9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index f30bc7d491..86b93dd8b2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index ceaba02c50..a41b1ddc08 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index 90ec47bc8d..ecd5e5b841 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb index 685e67faf2..25e3b018e2 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index 3302c7a6ae..e2cdc7dce1 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 7fbf354561..0b9b36ea64 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index 22fb7e25e2..b2b647d26d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index 7c6e440a2a..55244dcbcf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index ac32309217..59419e67fd 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index 88edbfe294..6807c7de36 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb index e4c1bf4cac..4b467b3de0 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 35d3a97a53..410fa168bf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 8c67c2007c..6f4a5fbd5d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index f839bdefc1..bad3c1d542 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 70f887236d..166611902e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 6d96a7f032..30e9406bf7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 536c691565..6126a809aa 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index 6afb0812db..b64d60e741 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb index ab6921a450..99b44ba573 100644 --- a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb index 449c414143..9a36ef9337 100644 --- a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb index 223647452a..389cc910f0 100644 --- a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 52888e58a2..2995b750e7 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index 4bf4193b4e..df802567c9 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb index e3a7cd3103..6d11d8773a 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index ee52929a24..20d12b5c1f 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index 65485cff85..d00a18a1bf 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 0fd7e3cf7f..9d828b5f6d 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 74b571373f..50be6c0e15 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index b2acdb1318..fd7106e359 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 7e6dff7d6b..8ab8f8520c 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index becfa19ff9..a200afcf0a 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index a0453d0292..4ee7fe94f3 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 7531ca6369..01f6b001ea 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index aa12eb3d75..1025187c82 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 696db1a23d..1049822b7f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 638f600b41..57c603716d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index b317724cf1..6668a18e93 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 882a63aba3..95cfe89d16 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 438e60cb08..db3fd78685 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 23ffc61d74..61114303c8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 6edbd10d0d..33cb299c29 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 74b270bb2f..447b1573bf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index f86d40e3a3..d5c9fef37b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 6ec58e16ce..3314bca5ed 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb index a03e376856..b72cd21b93 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index f0e5b08505..40987f214e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index 4c6bf35e7f..e5c68f7983 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 5ef024fa4a..96dfcb24d7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 597f28b713..f722acfc1d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index abbbd53eb4..aedf6b2c7e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index 87a2e68dac..f5ae1fed19 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 7a8b6dbbac..542d991d5a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/client/petstore/ruby/lib/petstore/models/foo.rb index 4b78a1a4e0..ac18fe7bee 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 150c9c5fd4..4410e00a47 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index b45c4c559f..9f51cfada9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb index f571546880..07be52509f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index 81cd539687..5fc7450bdf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index 7f7b06af81..a81fe7e5fd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 81d45842d3..24e2b85e72 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index f4f82d05a2..73e2781755 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 250270b108..91ccd158a1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index c6415f59a1..d71c1f1bd9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index f30bc7d491..86b93dd8b2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb index ceaba02c50..a41b1ddc08 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 90ec47bc8d..ecd5e5b841 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb index 685e67faf2..25e3b018e2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 3302c7a6ae..e2cdc7dce1 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 7fbf354561..0b9b36ea64 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index 22fb7e25e2..b2b647d26d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index 7c6e440a2a..55244dcbcf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index ac32309217..59419e67fd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index 88edbfe294..6807c7de36 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb index e4c1bf4cac..4b467b3de0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 35d3a97a53..410fa168bf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 8c67c2007c..6f4a5fbd5d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index f839bdefc1..bad3c1d542 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 70f887236d..166611902e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 6d96a7f032..30e9406bf7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index 536c691565..6126a809aa 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index fb9853b2f6..846cb3e9f9 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/spec/api_client_spec.rb b/samples/client/petstore/ruby/spec/api_client_spec.rb index 8f608b72b4..04d9cc79cd 100644 --- a/samples/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/spec/configuration_spec.rb b/samples/client/petstore/ruby/spec/configuration_spec.rb index 449c414143..9a36ef9337 100644 --- a/samples/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/ruby/spec/spec_helper.rb b/samples/client/petstore/ruby/spec/spec_helper.rb index 223647452a..389cc910f0 100644 --- a/samples/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/scala-akka/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-akka/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 60fe14bc55..b87ed4065e 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 0fb9fb455d..e6e78df205 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index f02a6902a5..efcfdfa6bd 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 909fe7073e..785314b56f 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 6a61280117..28845958d6 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index ec264eb0d0..9105efb7a3 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index d98b4e1441..0719fcf872 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index a09c72d480..51d842c795 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 5fa9e20f90..44d9bbf440 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 9da30d1e34..551fccda4f 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index d7a7d1303b..31712e7b2c 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 006c4fd5ef..8b76ca5753 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/.openapi-generator/VERSION b/samples/client/petstore/swift5/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index b58e80a5b2..9587ea668d 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 5.3.1-SNAPSHOT + 5.3.1 1.0.0 4.13.2 diff --git a/samples/meta-codegen/usage/.openapi-generator/VERSION b/samples/meta-codegen/usage/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/elm/.openapi-generator/VERSION b/samples/openapi3/client/elm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/elm/.openapi-generator/VERSION +++ b/samples/openapi3/client/elm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb index 38bf400267..b0324ac0bf 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb index 84e3bdc688..fa2549ca25 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb index f7fda51a46..acd170f6b6 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb index 43558c0a8d..1d9d6b85c5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb index dbf8adc10e..2c2d6ed5e1 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb index be49fe115f..92236c8711 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb index 97f9b2e832..d4b35523b2 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb index 2f9a614627..39ae825216 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb index 8704daa39c..0a68b8922b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec index 429b960dcf..29085fa88f 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec index ec29bbb2de..c5fb037a7f 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec +++ b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb index dd38bdd941..a70acea011 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb index 000b259b38..d4efa7f351 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb index 6b94cfc24e..fc7597e64f 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb index ed00fd5969..9d73ce3ffa 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb index e90670e832..f5b389637f 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb index 6547186148..1e07b74b1f 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb index 77a88330a2..8bc1b5c886 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb index 549db52d5c..84a6ac0940 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb index f8ebbcdb98..f166014690 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb index 40a130506a..ac8f867d98 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb index a126916ccb..f5a2172c57 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb index 92fe897c69..c09f358804 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb index 7e837120aa..110ca5de7b 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb index 5090bcfcb9..69251a11d2 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb index 580b8c5bd2..2550c985ef 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb index 446dd162dd..45f5b3532a 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb index f570789af1..c803b873a0 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec index 93f6b8bcd4..09ab2855fb 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb index f03fbe5455..45a8bfe213 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb index a56c37c158..dcc206c518 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb index 2af20efde2..64a0a2bc8b 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1-SNAPSHOT +OpenAPI Generator version: 5.3.1 =end diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/schema/petstore/ktorm/.openapi-generator/VERSION b/samples/schema/petstore/ktorm/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/schema/petstore/ktorm/.openapi-generator/VERSION +++ b/samples/schema/petstore/ktorm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION +++ b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/erlang-server/.openapi-generator/VERSION b/samples/server/petstore/erlang-server/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/erlang-server/.openapi-generator/VERSION +++ b/samples/server/petstore/erlang-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/go-server-required/.openapi-generator/VERSION b/samples/server/petstore/go-server-required/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/go-server-required/.openapi-generator/VERSION +++ b/samples/server/petstore/go-server-required/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index 6ec361da3c..e47cdeb550 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 5.3.1-SNAPSHOT. +Generated by OpenAPI Generator 5.3.1. ## Requires diff --git a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index fd4f3edbda..bedd82ad84 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 238dc18931..8ce2645e4d 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index 54a6805449..bb608e5c66 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION +++ b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/python-flask/.openapi-generator/VERSION b/samples/server/petstore/python-flask/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/VERSION +++ b/samples/server/petstore/python-flask/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index 032377d53c..1141853467 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java index 780e881807..81423f590b 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 204d18334c..9013faa9cb 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 8bbb762545..1d0035e021 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index a899c1e2ac..557a43e1d4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index b4e11c47fc..161749430f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index 6fd0038424..d9c5e3c16e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index ce495a26f8..a2065f673a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index 4fd628eb9a..ba64ef3188 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc..693ce02c51 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 0a15519597..598ae5ad88 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8..dfa1803e16 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc..693ce02c51 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1..743aa88a6d 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index a56d13721e..b494e974fe 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index f07fa4a7ed..d15f313c4c 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1..743aa88a6d 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8..dfa1803e16 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc..693ce02c51 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1..743aa88a6d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index e6d35a4c35..151aa6dc81 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 8ba25d828c..0c19151a97 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f1102a0f06..7f524d7af4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 9033b9ba30..21a559470b 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 29a3d124c5..25b01491b5 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 517f2743d2..4cbe795d92 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8..dfa1803e16 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc..693ce02c51 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1..743aa88a6d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index b41fa1a1b7..978eee460b 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 70ea9673e9..34e7ffdf2f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 231633cb34..ba5b622efd 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 8186ae2e5b..4948412cbf 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 01a5e332fc..58cf7cd17c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 7fce7995a8..b77c5fb5ce 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index b41fa1a1b7..978eee460b 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 70ea9673e9..34e7ffdf2f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 231633cb34..ba5b622efd 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 8186ae2e5b..4948412cbf 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 01a5e332fc..58cf7cd17c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 7fce7995a8..b77c5fb5ce 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index bf263c24b4..3aa0b58d6c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index ab909726e8..d8109c85a0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 6ee5686f74..a6c0dfd6f0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 98a0f6aa2e..0408708526 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 2591ae1d45..4534ce024d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 2e0fbbbffc..80c294ca88 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index bce3a8a848..81cbd1690c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 8bc50f63c8..7229707921 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 0badb75bc2..2a9ad13847 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 101ef0e1ac..85222405a9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index a8418c54ea..3443339b88 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 9487e29ee1..7eb94eb0b3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index e6d35a4c35..151aa6dc81 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 94827ba4a0..3cc9777cab 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f1102a0f06..7f524d7af4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index f26f3c41e4..41b8fce914 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 29a3d124c5..25b01491b5 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 517f2743d2..4cbe795d92 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index b41fa1a1b7..978eee460b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 052aa11e93..5e5c3fc8c9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 231633cb34..ba5b622efd 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index fd2d40410e..ce9171bef3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 01a5e332fc..58cf7cd17c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 7fce7995a8..b77c5fb5ce 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index e6d35a4c35..151aa6dc81 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 94827ba4a0..3cc9777cab 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index f1102a0f06..7f524d7af4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index f26f3c41e4..41b8fce914 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 29a3d124c5..25b01491b5 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 517f2743d2..4cbe795d92 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index a56d13721e..b494e974fe 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index f07fa4a7ed..d15f313c4c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1..743aa88a6d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 3cc4f54428..bcfd41bee1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 6eb817a03f..027746a2e5 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1..743aa88a6d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index b71a163e8e..575fd8a2ae 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index c36496ec99..a85c742451 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 4aa760d7a8..7b1b825d38 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index fbac4cf8c2..28c60937d7 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 7edd493e6b..d20e937d03 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index a376601558..c6f02bef5d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 4077803655..7d3cdbf0dd 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.3.1 \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index ba1b869f03..57e6c1d106 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index c22b8c03f8..dfa1803e16 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 71ce0007da..8b45339424 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index b0e4e2c2dc..693ce02c51 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index 22b5b76702..d3a44c4e9c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index fabb81f5f1..743aa88a6d 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1-SNAPSHOT). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). * https://openapi-generator.tech * Do not edit the class manually. */ From 82b77a099af27acdfbf41d47382a73226c266483 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 21 Dec 2021 19:13:29 +0800 Subject: [PATCH 42/54] update readme --- README.md | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 8995481136..f8b8df917a 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@
          -[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.3.1`): +[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`5.4.x`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/master.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) @@ -17,13 +17,6 @@ [![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/master?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) [![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/openapitools/openapi-generator/Check%20Supported%20Java%20Versions/master?label=Check%20Supported%20Java%20Versions&logo=github&logoColor=green)](https://github.com/OpenAPITools/openapi-generator/actions?query=workflow%3A%22Check+Supported+Java+Versions%22) -[5.4.x](https://github.com/OpenAPITools/openapi-generator/tree/5.4.x) (`5.4.x`): -[![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/5.4.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) -[![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/5.4.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) -[![Windows Test](https://ci.appveyor.com/api/projects/status/github/openapitools/openapi-generator?branch=5.4.x&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/WilliamCheng/openapi-generator) -[![JDK11 Build](https://cloud.drone.io/api/badges/OpenAPITools/openapi-generator/status.svg?ref=refs/heads/5.4.x)](https://cloud.drone.io/OpenAPITools/openapi-generator) -[![Bitrise](https://img.shields.io/bitrise/4a2b10a819d12b67/5.4.x?label=bitrise%3A%20Swift+4,5&token=859FMDR8QHwabCzwvZK6vQ)](https://app.bitrise.io/app/4a2b10a819d12b67) - [6.0.x](https://github.com/OpenAPITools/openapi-generator/tree/6.0.x) (`6.0.x`): [![Build Status](https://img.shields.io/travis/OpenAPITools/openapi-generator/6.0.x.svg?label=Integration%20Test)](https://travis-ci.com/OpenAPITools/openapi-generator) [![Integration Test2](https://circleci.com/gh/OpenAPITools/openapi-generator/tree/6.0.x.svg?style=shield)](https://circleci.com/gh/OpenAPITools/openapi-generator) @@ -119,8 +112,7 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------- | | 6.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/6.0.0-SNAPSHOT/) | Jan/Feb 2022 | Minor release with breaking changes (no fallback) | | 5.4.0 (upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.4.0-SNAPSHOT/) | Dec 2021 | Minor release with breaking changes (with fallback) | -| 5.3.1 (upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/5.3.1-SNAPSHOT/) | Nov/Dec 2021 | Patch release (enhancements, bug fixes, etc) | -| [5.3.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.3.0) (latest stable release) | 24.10.2021 | Minor release with breaking changes (with fallback) | +| [5.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v5.3.1) (latest stable release) | 21.12.2021 | Patch release (enhancements, bug fixes, etc) | | [4.3.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v4.3.1) | 06.05.2020 | Patch release (enhancements, bug fixes, etc) | OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0 @@ -177,16 +169,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository. If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): -JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar` +JAR location: `https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar` For **Mac/Linux** users: ```sh -wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar -O openapi-generator-cli.jar +wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar -O openapi-generator-cli.jar ``` For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g. ``` -Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar +Invoke-WebRequest -OutFile openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar ``` After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage. @@ -411,7 +403,7 @@ openapi-generator-cli version To use a specific version of "openapi-generator-cli" ```sh -openapi-generator-cli version-manager set 5.3.0 +openapi-generator-cli version-manager set 5.3.1 ``` Or install it as dev-dependency: @@ -435,7 +427,7 @@ java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar generat (if you're on Windows, replace the last command with `java -jar modules\openapi-generator-cli\target\openapi-generator-cli.jar generate -i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.0/openapi-generator-cli-5.3.0.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/5.3.1/openapi-generator-cli-5.3.1.jar) To get a list of **general** options available, please run `java -jar modules/openapi-generator-cli/target/openapi-generator-cli.jar help generate` From 588cd1532319faa9c3a937a76b402014981aeb04 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 22 Dec 2021 00:42:28 +0800 Subject: [PATCH 43/54] fix openapi-generator-cli version --- modules/openapi-generator-cli/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/openapi-generator-cli/pom.xml b/modules/openapi-generator-cli/pom.xml index 3c12f8f791..8811176792 100644 --- a/modules/openapi-generator-cli/pom.xml +++ b/modules/openapi-generator-cli/pom.xml @@ -4,7 +4,7 @@ org.openapitools openapi-generator-project - 5.3.1 + 5.4.0-SNAPSHOT ../.. From 0bbd1e59e9cf7828c93b66c3f8b85b19ac25ff1a Mon Sep 17 00:00:00 2001 From: David Gamero Date: Fri, 24 Dec 2021 10:46:02 -0500 Subject: [PATCH 44/54] useSingleRequestParameter should mark parameter optional if all properties are optional (#11135) * useSingleRequestParameter should mark parameter optional if all properties are optional * update samples --- .../src/main/resources/typescript-fetch/apis.mustache | 2 +- .../builds/default-v3.0/apis/FakeApi.ts | 10 +++++----- .../typescript-fetch/builds/enum/apis/DefaultApi.ts | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache index 74c0c77d71..bbdf2edf4a 100644 --- a/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-fetch/apis.mustache @@ -342,7 +342,7 @@ export class {{classname}} extends runtime.BaseAPI { } {{/useSingleRequestParameter}} {{#useSingleRequestParameter}} - async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request, {{/allParams.0}}initOverrides?: RequestInit): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { + async {{nickname}}({{#allParams.0}}requestParameters: {{#prefixParameterInterfaces}}{{classname}}{{/prefixParameterInterfaces}}{{operationIdCamelCase}}Request{{^hasRequiredParams}} = {}{{/hasRequiredParams}}, {{/allParams.0}}initOverrides?: RequestInit): Promise<{{{returnType}}}{{^returnType}}void{{/returnType}}> { {{#returnType}} const response = await this.{{nickname}}Raw({{#allParams.0}}requestParameters, {{/allParams.0}}initOverrides); return await response.value(); diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts index 19d5f89fce..b0a139e2f2 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/apis/FakeApi.ts @@ -232,7 +232,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of outer boolean types */ - async fakeOuterBooleanSerialize(requestParameters: FakeOuterBooleanSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterBooleanSerialize(requestParameters: FakeOuterBooleanSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterBooleanSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -261,7 +261,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of object with outer number type */ - async fakeOuterCompositeSerialize(requestParameters: FakeOuterCompositeSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterCompositeSerialize(requestParameters: FakeOuterCompositeSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterCompositeSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -290,7 +290,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of outer number types */ - async fakeOuterNumberSerialize(requestParameters: FakeOuterNumberSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterNumberSerialize(requestParameters: FakeOuterNumberSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterNumberSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -319,7 +319,7 @@ export class FakeApi extends runtime.BaseAPI { /** * Test serialization of outer string types */ - async fakeOuterStringSerialize(requestParameters: FakeOuterStringSerializeRequest, initOverrides?: RequestInit): Promise { + async fakeOuterStringSerialize(requestParameters: FakeOuterStringSerializeRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeOuterStringSerializeRaw(requestParameters, initOverrides); return await response.value(); } @@ -683,7 +683,7 @@ export class FakeApi extends runtime.BaseAPI { * To test enum parameters * To test enum parameters */ - async testEnumParameters(requestParameters: TestEnumParametersRequest, initOverrides?: RequestInit): Promise { + async testEnumParameters(requestParameters: TestEnumParametersRequest = {}, initOverrides?: RequestInit): Promise { await this.testEnumParametersRaw(requestParameters, initOverrides); } diff --git a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts index 844842111c..6706d55add 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts +++ b/samples/client/petstore/typescript-fetch/builds/enum/apis/DefaultApi.ts @@ -94,7 +94,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestGetInline(requestParameters: FakeEnumRequestGetInlineRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestGetInline(requestParameters: FakeEnumRequestGetInlineRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestGetInlineRaw(requestParameters, initOverrides); return await response.value(); } @@ -134,7 +134,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestGetRef(requestParameters: FakeEnumRequestGetRefRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestGetRef(requestParameters: FakeEnumRequestGetRefRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestGetRefRaw(requestParameters, initOverrides); return await response.value(); } @@ -161,7 +161,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestPostInline(requestParameters: FakeEnumRequestPostInlineRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestPostInlineRaw(requestParameters, initOverrides); return await response.value(); } @@ -188,7 +188,7 @@ export class DefaultApi extends runtime.BaseAPI { /** */ - async fakeEnumRequestPostRef(requestParameters: FakeEnumRequestPostRefRequest, initOverrides?: RequestInit): Promise { + async fakeEnumRequestPostRef(requestParameters: FakeEnumRequestPostRefRequest = {}, initOverrides?: RequestInit): Promise { const response = await this.fakeEnumRequestPostRefRaw(requestParameters, initOverrides); return await response.value(); } From 7ffd0711c3c3e7e08110a3e8d63e324daa1773d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vesa=20Poikaj=C3=A4rvi?= Date: Fri, 24 Dec 2021 17:49:36 +0200 Subject: [PATCH 45/54] [typescript-axios] Add option to add NodeJS imports (#10990) * [typescript-axios] Add new option to generate imports from 'url' * Added new option `withImportUrl` to be used to generate the imports needed for NodeJS support without adding DOM to TypeScript libs * [typescript-axios] Add withImportUrl support to templates * Generate imports from 'url' if withImportUrl is set to true * [typescript-axios] Generate new samples using withImportUrl * [typescript-axios] Add withImportUrl to documentation * [typescript-axios] Regenerate docs, build was still ongoing and used old param name * [typescript-axios] Rename withImportUrl to withNodeImports * Rename the parameter to support other Node imports * Add imports for form-data too if using multipartFormData * Add fix for multipart headers when running in Node with form-data package --- .../typescript-axios-with-node-imports.yaml | 7 + docs/generators/typescript-axios.md | 1 + .../TypeScriptAxiosClientCodegen.java | 2 + .../resources/typescript-axios/api.mustache | 8 + .../typescript-axios/apiInner.mustache | 10 +- .../typescript-axios/common.mustache | 3 + .../builds/with-node-imports/.gitignore | 4 + .../builds/with-node-imports/.npmignore | 1 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 8 + .../.openapi-generator/VERSION | 1 + .../builds/with-node-imports/api.ts | 1818 +++++++++++++++++ .../builds/with-node-imports/base.ts | 71 + .../builds/with-node-imports/common.ts | 139 ++ .../builds/with-node-imports/configuration.ts | 101 + .../builds/with-node-imports/git_push.sh | 57 + .../builds/with-node-imports/index.ts | 18 + 17 files changed, 2271 insertions(+), 1 deletion(-) create mode 100644 bin/configs/typescript-axios-with-node-imports.yaml create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh create mode 100644 samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts diff --git a/bin/configs/typescript-axios-with-node-imports.yaml b/bin/configs/typescript-axios-with-node-imports.yaml new file mode 100644 index 0000000000..1ed732421d --- /dev/null +++ b/bin/configs/typescript-axios-with-node-imports.yaml @@ -0,0 +1,7 @@ +generatorName: typescript-axios +outputDir: samples/client/petstore/typescript-axios/builds/with-node-imports +inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-operations-without-required-params.yaml +templateDir: modules/openapi-generator/src/main/resources/typescript-axios +additionalProperties: + withNodeImports: "true" + multipartFormData: "true" diff --git a/docs/generators/typescript-axios.md b/docs/generators/typescript-axios.md index 3cfeda7858..d489756bac 100644 --- a/docs/generators/typescript-axios.md +++ b/docs/generators/typescript-axios.md @@ -26,6 +26,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl |supportsES6|Generate code that conforms to ES6.| |false| |useSingleRequestParameter|Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.| |false| |withInterfaces|Setting this property to true will generate interfaces next to the default class implementations.| |false| +|withNodeImports|Setting this property to true adds imports for NodeJS| |false| |withSeparateModelsAndApi|Put the model and api in separate folders and in separate classes| |false| |withoutPrefixEnums|Don't prefix enum names with class names| |false| diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java index 171b0e254e..539313d513 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/TypeScriptAxiosClientCodegen.java @@ -33,6 +33,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege public static final String SEPARATE_MODELS_AND_API = "withSeparateModelsAndApi"; public static final String WITHOUT_PREFIX_ENUMS = "withoutPrefixEnums"; public static final String USE_SINGLE_REQUEST_PARAMETER = "useSingleRequestParameter"; + public static final String WITH_NODE_IMPORTS = "withNodeImports"; protected String npmRepository = null; @@ -55,6 +56,7 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege this.cliOptions.add(new CliOption(SEPARATE_MODELS_AND_API, "Put the model and api in separate folders and in separate classes", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(WITHOUT_PREFIX_ENUMS, "Don't prefix enum names with class names", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); this.cliOptions.add(new CliOption(USE_SINGLE_REQUEST_PARAMETER, "Setting this property to true will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter.", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); + this.cliOptions.add(new CliOption(WITH_NODE_IMPORTS, "Setting this property to true adds imports for NodeJS", SchemaTypeUtil.BOOLEAN_TYPE).defaultValue(Boolean.FALSE.toString())); // Templates have no mapping between formatted property names and original base names so use only "original" and remove this option removeOption(CodegenConstants.MODEL_PROPERTY_NAMING); } diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache index 140801103b..707faf3a1b 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/api.mustache @@ -5,6 +5,14 @@ {{^withSeparateModelsAndApi}} import { Configuration } from './configuration'; import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +{{#withNodeImports}} +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +{{#multipartFormData}} +import FormData from 'form-data' +{{/multipartFormData}} +{{/withNodeImports}} // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache index 14b4d67503..04812f66dd 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache @@ -5,6 +5,14 @@ import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '{{apiRelativeToRoot}}configuration'; +{{#withNodeImports}} +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +{{#multipartFormData}} +import FormData from 'form-data' +{{/multipartFormData}} +{{/withNodeImports}} // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '{{apiRelativeToRoot}}common'; @@ -184,7 +192,7 @@ export const {{classname}}AxiosParamCreator = function (configuration?: Configur {{/bodyParam}} setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions,{{#hasFormParams}}{{#multipartFormData}} ...(localVarFormParams as any).getHeaders?.(),{{/multipartFormData}}{{/hasFormParams}} ...options.headers}; {{#hasFormParams}} localVarRequestOptions.data = localVarFormParams{{#vendorExtensions}}{{^multipartFormData}}.toString(){{/multipartFormData}}{{/vendorExtensions}}; {{/hasFormParams}} diff --git a/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache index 7a057e3e44..114bb3e92f 100644 --- a/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-axios/common.mustache @@ -5,6 +5,9 @@ import { Configuration } from "./configuration"; import { RequiredError, RequestArgs } from "./base"; import { AxiosInstance, AxiosResponse } from 'axios'; +{{#withNodeImports}} +import { URL, URLSearchParams } from 'url'; +{{/withNodeImports}} /** * diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore b/samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore new file mode 100644 index 0000000000..149b576547 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.gitignore @@ -0,0 +1,4 @@ +wwwroot/*.js +node_modules +typings +dist diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore b/samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore new file mode 100644 index 0000000000..999d88df69 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.npmignore @@ -0,0 +1 @@ +# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore new file mode 100644 index 0000000000..7484ee590a --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES new file mode 100644 index 0000000000..a80cd4f07b --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/FILES @@ -0,0 +1,8 @@ +.gitignore +.npmignore +api.ts +base.ts +common.ts +configuration.ts +git_push.sh +index.ts diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION new file mode 100644 index 0000000000..4077803655 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION @@ -0,0 +1 @@ +5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts new file mode 100644 index 0000000000..81a0a29624 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/api.ts @@ -0,0 +1,1818 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from './configuration'; +import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; +// URLSearchParams not necessarily used +// @ts-ignore +import { URL, URLSearchParams } from 'url'; +import FormData from 'form-data' +// Some imports not used depending on template conditions +// @ts-ignore +import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common'; +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base'; + +/** + * Describes the result of uploading an image resource + * @export + * @interface ApiResponse + */ +export interface ApiResponse { + /** + * + * @type {number} + * @memberof ApiResponse + */ + 'code'?: number; + /** + * + * @type {string} + * @memberof ApiResponse + */ + 'type'?: string; + /** + * + * @type {string} + * @memberof ApiResponse + */ + 'message'?: string; +} +/** + * A category for a pet + * @export + * @interface Category + */ +export interface Category { + /** + * + * @type {number} + * @memberof Category + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof Category + */ + 'name'?: string; +} +/** + * An order for a pets from the pet store + * @export + * @interface Order + */ +export interface Order { + /** + * + * @type {number} + * @memberof Order + */ + 'id'?: number; + /** + * + * @type {number} + * @memberof Order + */ + 'petId'?: number; + /** + * + * @type {number} + * @memberof Order + */ + 'quantity'?: number; + /** + * + * @type {string} + * @memberof Order + */ + 'shipDate'?: string; + /** + * Order Status + * @type {string} + * @memberof Order + */ + 'status'?: OrderStatusEnum; + /** + * + * @type {boolean} + * @memberof Order + */ + 'complete'?: boolean; +} + +/** + * @export + * @enum {string} + */ +export enum OrderStatusEnum { + Placed = 'placed', + Approved = 'approved', + Delivered = 'delivered' +} + +/** + * A pet for sale in the pet store + * @export + * @interface Pet + */ +export interface Pet { + /** + * + * @type {number} + * @memberof Pet + */ + 'id'?: number; + /** + * + * @type {Category} + * @memberof Pet + */ + 'category'?: Category; + /** + * + * @type {string} + * @memberof Pet + */ + 'name': string; + /** + * + * @type {Array} + * @memberof Pet + */ + 'photoUrls': Array; + /** + * + * @type {Array} + * @memberof Pet + */ + 'tags'?: Array; + /** + * pet status in the store + * @type {string} + * @memberof Pet + */ + 'status'?: PetStatusEnum; +} + +/** + * @export + * @enum {string} + */ +export enum PetStatusEnum { + Available = 'available', + Pending = 'pending', + Sold = 'sold' +} + +/** + * A tag for a pet + * @export + * @interface Tag + */ +export interface Tag { + /** + * + * @type {number} + * @memberof Tag + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof Tag + */ + 'name'?: string; +} +/** + * A User who is purchasing from the pet store + * @export + * @interface User + */ +export interface User { + /** + * + * @type {number} + * @memberof User + */ + 'id'?: number; + /** + * + * @type {string} + * @memberof User + */ + 'username'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'firstName'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'lastName'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'email'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'password'?: string; + /** + * + * @type {string} + * @memberof User + */ + 'phone'?: string; + /** + * User Status + * @type {number} + * @memberof User + */ + 'userStatus'?: number; +} + +/** + * PetApi - axios parameter creator + * @export + */ +export const PetApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet: async (body: Pet, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('addPet', 'body', body) + const localVarPath = `/pet`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet: async (petId: number, apiKey?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('deletePet', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (apiKey !== undefined && apiKey !== null) { + localVarHeaderParameter['api_key'] = String(apiKey); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus: async (status: Array<'available' | 'pending' | 'sold'>, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'status' is not null or undefined + assertParamExists('findPetsByStatus', 'status', status) + const localVarPath = `/pet/findByStatus`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (status) { + localVarQueryParameter['status'] = status.join(COLLECTION_FORMATS.csv); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + findPetsByTags: async (tags: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'tags' is not null or undefined + assertParamExists('findPetsByTags', 'tags', tags) + const localVarPath = `/pet/findByTags`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + if (tags) { + localVarQueryParameter['tags'] = tags.join(COLLECTION_FORMATS.csv); + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById: async (petId: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('getPetById', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet: async (body: Pet, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('updatePet', 'body', body) + const localVarPath = `/pet`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm: async (petId: number, name?: string, status?: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('updatePetWithForm', 'petId', petId) + const localVarPath = `/pet/{petId}` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + if (name !== undefined) { + localVarFormParams.append('name', name as any); + } + + if (status !== undefined) { + localVarFormParams.append('status', status as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...(localVarFormParams as any).getHeaders?.(), ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile: async (petId: number, additionalMetadata?: string, file?: any, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'petId' is not null or undefined + assertParamExists('uploadFile', 'petId', petId) + const localVarPath = `/pet/{petId}/uploadImage` + .replace(`{${"petId"}}`, encodeURIComponent(String(petId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)(); + + // authentication petstore_auth required + // oauth required + await setOAuthToObject(localVarHeaderParameter, "petstore_auth", ["write:pets", "read:pets"], configuration) + + + if (additionalMetadata !== undefined) { + localVarFormParams.append('additionalMetadata', additionalMetadata as any); + } + + if (file !== undefined) { + localVarFormParams.append('file', file as any); + } + + + localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...(localVarFormParams as any).getHeaders?.(), ...options.headers}; + localVarRequestOptions.data = localVarFormParams; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * PetApi - functional programming interface + * @export + */ +export const PetApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = PetApiAxiosParamCreator(configuration) + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async addPet(body: Pet, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.addPet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deletePet(petId, apiKey, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByStatus(status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + async findPetsByTags(tags: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.findPetsByTags(tags, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getPetById(petId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getPetById(petId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePet(body: Pet, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePet(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updatePetWithForm(petId, name, status, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.uploadFile(petId, additionalMetadata, file, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * PetApi - factory interface + * @export + */ +export const PetApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = PetApiFp(configuration) + return { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + addPet(body: Pet, options?: any): AxiosPromise { + return localVarFp.addPet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deletePet(petId: number, apiKey?: string, options?: any): AxiosPromise { + return localVarFp.deletePet(petId, apiKey, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): AxiosPromise> { + return localVarFp.findPetsByStatus(status, options).then((request) => request(axios, basePath)); + }, + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + */ + findPetsByTags(tags: Array, options?: any): AxiosPromise> { + return localVarFp.findPetsByTags(tags, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getPetById(petId: number, options?: any): AxiosPromise { + return localVarFp.getPetById(petId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePet(body: Pet, options?: any): AxiosPromise { + return localVarFp.updatePet(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): AxiosPromise { + return localVarFp.updatePetWithForm(petId, name, status, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: any): AxiosPromise { + return localVarFp.uploadFile(petId, additionalMetadata, file, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * PetApi - object-oriented interface + * @export + * @class PetApi + * @extends {BaseAPI} + */ +export class PetApi extends BaseAPI { + /** + * + * @summary Add a new pet to the store + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public addPet(body: Pet, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).addPet(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Deletes a pet + * @param {number} petId Pet id to delete + * @param {string} [apiKey] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public deletePet(petId: number, apiKey?: string, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).deletePet(petId, apiKey, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple status values can be provided with comma separated strings + * @summary Finds Pets by status + * @param {Array<'available' | 'pending' | 'sold'>} status Status values that need to be considered for filter + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).findPetsByStatus(status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + * @summary Finds Pets by tags + * @param {Array} tags Tags to filter by + * @param {*} [options] Override http request option. + * @deprecated + * @throws {RequiredError} + * @memberof PetApi + */ + public findPetsByTags(tags: Array, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).findPetsByTags(tags, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a single pet + * @summary Find pet by ID + * @param {number} petId ID of pet to return + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public getPetById(petId: number, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).getPetById(petId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Update an existing pet + * @param {Pet} body Pet object that needs to be added to the store + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePet(body: Pet, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).updatePet(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Updates a pet in the store with form data + * @param {number} petId ID of pet that needs to be updated + * @param {string} [name] Updated name of the pet + * @param {string} [status] Updated status of the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public updatePetWithForm(petId: number, name?: string, status?: string, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).updatePetWithForm(petId, name, status, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary uploads an image + * @param {number} petId ID of pet to update + * @param {string} [additionalMetadata] Additional data to pass to server + * @param {any} [file] file to upload + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PetApi + */ + public uploadFile(petId: number, additionalMetadata?: string, file?: any, options?: AxiosRequestConfig) { + return PetApiFp(this.configuration).uploadFile(petId, additionalMetadata, file, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * StoreApi - axios parameter creator + * @export + */ +export const StoreApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder: async (orderId: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + assertParamExists('deleteOrder', 'orderId', orderId) + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/store/inventory`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication api_key required + await setApiKeyToObject(localVarHeaderParameter, "api_key", configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById: async (orderId: number, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'orderId' is not null or undefined + assertParamExists('getOrderById', 'orderId', orderId) + const localVarPath = `/store/order/{orderId}` + .replace(`{${"orderId"}}`, encodeURIComponent(String(orderId))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder: async (body?: Order, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/store/order`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * StoreApi - functional programming interface + * @export + */ +export const StoreApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = StoreApiAxiosParamCreator(configuration) + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteOrder(orderId: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteOrder(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getInventory(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: number; }>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getInventory(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrderById(orderId: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderById(orderId, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async placeOrder(body?: Order, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.placeOrder(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * StoreApi - factory interface + * @export + */ +export const StoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = StoreApiFp(configuration) + return { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteOrder(orderId: string, options?: any): AxiosPromise { + return localVarFp.deleteOrder(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getInventory(options?: any): AxiosPromise<{ [key: string]: number; }> { + return localVarFp.getInventory(options).then((request) => request(axios, basePath)); + }, + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getOrderById(orderId: number, options?: any): AxiosPromise { + return localVarFp.getOrderById(orderId, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + placeOrder(body?: Order, options?: any): AxiosPromise { + return localVarFp.placeOrder(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * StoreApi - object-oriented interface + * @export + * @class StoreApi + * @extends {BaseAPI} + */ +export class StoreApi extends BaseAPI { + /** + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + * @summary Delete purchase order by ID + * @param {string} orderId ID of the order that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public deleteOrder(orderId: string, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).deleteOrder(orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns a map of status codes to quantities + * @summary Returns pet inventories by status + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getInventory(options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).getInventory(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + * @summary Find purchase order by ID + * @param {number} orderId ID of pet that needs to be fetched + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public getOrderById(orderId: number, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).getOrderById(orderId, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Place an order for a pet + * @param {Order} [body] order placed for purchasing the pet + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof StoreApi + */ + public placeOrder(body?: Order, options?: AxiosRequestConfig) { + return StoreApiFp(this.configuration).placeOrder(body, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * UserApi - axios parameter creator + * @export + */ +export const UserApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser: async (body: User, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUser', 'body', body) + const localVarPath = `/user`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput: async (body: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUsersWithArrayInput', 'body', body) + const localVarPath = `/user/createWithArray`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput: async (body: Array, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('createUsersWithListInput', 'body', body) + const localVarPath = `/user/createWithList`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser: async (username: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('deleteUser', 'username', username) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName: async (username: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('getUserByName', 'username', username) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser: async (username: string, password: string, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('loginUser', 'username', username) + // verify required parameter 'password' is not null or undefined + assertParamExists('loginUser', 'password', password) + const localVarPath = `/user/login`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (username !== undefined) { + localVarQueryParameter['username'] = username; + } + + if (password !== undefined) { + localVarQueryParameter['password'] = password; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser: async (options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/user/logout`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser: async (username: string, body: User, options: AxiosRequestConfig = {}): Promise => { + // verify required parameter 'username' is not null or undefined + assertParamExists('updateUser', 'username', username) + // verify required parameter 'body' is not null or undefined + assertParamExists('updateUser', 'body', body) + const localVarPath = `/user/{username}` + .replace(`{${"username"}}`, encodeURIComponent(String(username))); + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * UserApi - functional programming interface + * @export + */ +export const UserApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = UserApiAxiosParamCreator(configuration) + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUser(body: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithArrayInput(body: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithArrayInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async createUsersWithListInput(body: Array, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.createUsersWithListInput(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async deleteUser(username: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getUserByName(username: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserByName(username, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async loginUser(username: string, password: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.loginUser(username, password, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async logoutUser(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.logoutUser(options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async updateUser(username: string, body: User, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.updateUser(username, body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * UserApi - factory interface + * @export + */ +export const UserApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = UserApiFp(configuration) + return { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUser(body: User, options?: any): AxiosPromise { + return localVarFp.createUser(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithArrayInput(body: Array, options?: any): AxiosPromise { + return localVarFp.createUsersWithArrayInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + createUsersWithListInput(body: Array, options?: any): AxiosPromise { + return localVarFp.createUsersWithListInput(body, options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + deleteUser(username: string, options?: any): AxiosPromise { + return localVarFp.deleteUser(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserByName(username: string, options?: any): AxiosPromise { + return localVarFp.getUserByName(username, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + loginUser(username: string, password: string, options?: any): AxiosPromise { + return localVarFp.loginUser(username, password, options).then((request) => request(axios, basePath)); + }, + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + logoutUser(options?: any): AxiosPromise { + return localVarFp.logoutUser(options).then((request) => request(axios, basePath)); + }, + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + updateUser(username: string, body: User, options?: any): AxiosPromise { + return localVarFp.updateUser(username, body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * UserApi - object-oriented interface + * @export + * @class UserApi + * @extends {BaseAPI} + */ +export class UserApi extends BaseAPI { + /** + * This can only be done by the logged in user. + * @summary Create user + * @param {User} body Created user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUser(body: User, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUser(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithArrayInput(body: Array, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUsersWithArrayInput(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Creates list of users with given input array + * @param {Array} body List of user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public createUsersWithListInput(body: Array, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).createUsersWithListInput(body, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Delete user + * @param {string} username The name that needs to be deleted + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public deleteUser(username: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).deleteUser(username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Get user by user name + * @param {string} username The name that needs to be fetched. Use user1 for testing. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public getUserByName(username: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).getUserByName(username, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs user into the system + * @param {string} username The user name for login + * @param {string} password The password for login in clear text + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public loginUser(username: string, password: string, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).loginUser(username, password, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * + * @summary Logs out current logged in user session + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public logoutUser(options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).logoutUser(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * This can only be done by the logged in user. + * @summary Updated user + * @param {string} username name that need to be deleted + * @param {User} body Updated user object + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof UserApi + */ + public updateUser(username: string, body: User, options?: AxiosRequestConfig) { + return UserApiFp(this.configuration).updateUser(username, body, options).then((request) => request(this.axios, this.basePath)); + } +} + + diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts new file mode 100644 index 0000000000..e23d972eeb --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/base.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +// Some imports not used depending on template conditions +// @ts-ignore +import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios'; + +export const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); + +/** + * + * @export + */ +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +/** + * + * @export + * @interface RequestArgs + */ +export interface RequestArgs { + url: string; + options: AxiosRequestConfig; +} + +/** + * + * @export + * @class BaseAPI + */ +export class BaseAPI { + protected configuration: Configuration | undefined; + + constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) { + if (configuration) { + this.configuration = configuration; + this.basePath = configuration.basePath || this.basePath; + } + } +}; + +/** + * + * @export + * @class RequiredError + * @extends {Error} + */ +export class RequiredError extends Error { + name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts new file mode 100644 index 0000000000..56fdbc9e25 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/common.ts @@ -0,0 +1,139 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { Configuration } from "./configuration"; +import { RequiredError, RequestArgs } from "./base"; +import { AxiosInstance, AxiosResponse } from 'axios'; +import { URL, URLSearchParams } from 'url'; + +/** + * + * @export + */ +export const DUMMY_BASE_URL = 'https://example.com' + +/** + * + * @throws {RequiredError} + * @export + */ +export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) { + if (paramValue === null || paramValue === undefined) { + throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`); + } +} + +/** + * + * @export + */ +export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) { + if (configuration && configuration.apiKey) { + const localVarApiKeyValue = typeof configuration.apiKey === 'function' + ? await configuration.apiKey(keyParamName) + : await configuration.apiKey; + object[keyParamName] = localVarApiKeyValue; + } +} + +/** + * + * @export + */ +export const setBasicAuthToObject = function (object: any, configuration?: Configuration) { + if (configuration && (configuration.username || configuration.password)) { + object["auth"] = { username: configuration.username, password: configuration.password }; + } +} + +/** + * + * @export + */ +export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const accessToken = typeof configuration.accessToken === 'function' + ? await configuration.accessToken() + : await configuration.accessToken; + object["Authorization"] = "Bearer " + accessToken; + } +} + +/** + * + * @export + */ +export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) { + if (configuration && configuration.accessToken) { + const localVarAccessTokenValue = typeof configuration.accessToken === 'function' + ? await configuration.accessToken(name, scopes) + : await configuration.accessToken; + object["Authorization"] = "Bearer " + localVarAccessTokenValue; + } +} + +/** + * + * @export + */ +export const setSearchParams = function (url: URL, ...objects: any[]) { + const searchParams = new URLSearchParams(url.search); + for (const object of objects) { + for (const key in object) { + if (Array.isArray(object[key])) { + searchParams.delete(key); + for (const item of object[key]) { + searchParams.append(key, item); + } + } else { + searchParams.set(key, object[key]); + } + } + } + url.search = searchParams.toString(); +} + +/** + * + * @export + */ +export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) { + const nonString = typeof value !== 'string'; + const needsSerialization = nonString && configuration && configuration.isJsonMime + ? configuration.isJsonMime(requestOptions.headers['Content-Type']) + : nonString; + return needsSerialization + ? JSON.stringify(value !== undefined ? value : {}) + : (value || ""); +} + +/** + * + * @export + */ +export const toPathString = function (url: URL) { + return url.pathname + url.search + url.hash +} + +/** + * + * @export + */ +export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) { + return >(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { + const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url}; + return axios.request(axiosRequestArgs); + }; +} diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts new file mode 100644 index 0000000000..b878045712 --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/configuration.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export interface ConfigurationParameters { + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + username?: string; + password?: string; + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + basePath?: string; + baseOptions?: any; + formDataCtor?: new () => any; +} + +export class Configuration { + /** + * parameter for apiKey security + * @param name security name + * @memberof Configuration + */ + apiKey?: string | Promise | ((name: string) => string) | ((name: string) => Promise); + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + username?: string; + /** + * parameter for basic security + * + * @type {string} + * @memberof Configuration + */ + password?: string; + /** + * parameter for oauth2 security + * @param name security name + * @param scopes oauth2 scope + * @memberof Configuration + */ + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise); + /** + * override base path + * + * @type {string} + * @memberof Configuration + */ + basePath?: string; + /** + * base options for axios calls + * + * @type {any} + * @memberof Configuration + */ + baseOptions?: any; + /** + * The FormData constructor that will be used to create multipart form data + * requests. You can inject this here so that execution environments that + * do not support the FormData class can still run the generated client. + * + * @type {new () => FormData} + */ + formDataCtor?: new () => any; + + constructor(param: ConfigurationParameters = {}) { + this.apiKey = param.apiKey; + this.username = param.username; + this.password = param.password; + this.accessToken = param.accessToken; + this.basePath = param.basePath; + this.baseOptions = param.baseOptions; + this.formDataCtor = param.formDataCtor; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public isJsonMime(mime: string): boolean { + const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i'); + return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json'); + } +} diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh b/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh new file mode 100644 index 0000000000..f53a75d4fa --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts b/samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts new file mode 100644 index 0000000000..ed3d348fdf --- /dev/null +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/index.ts @@ -0,0 +1,18 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * OpenAPI Petstore + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +export * from "./api"; +export * from "./configuration"; + From 02a51579be7f52ada22d5a6517fbb6d505d50a42 Mon Sep 17 00:00:00 2001 From: Jason Kaiser <69987919+oaklandcorp-jkaiser@users.noreply.github.com> Date: Fri, 24 Dec 2021 09:51:31 -0600 Subject: [PATCH 46/54] [typescript-angular] Support blob response types (#11085) * Fixed issue 11021 by changing the responseType to blob for accept headers that don't match text or json. * Updated samples. * Updated inline json pattern matching with an existing utility method. * Updated samples. * Fixed isJsonMime call. * Updated samples. * Fixed default response type of json when accept header is not given. * Updated samples. --- .../typescript-angular/api.service.mustache | 12 ++- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/default.service.ts | 24 +++-- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../api/pet.service.ts | 96 ++++++++++++++----- .../api/store.service.ts | 48 +++++++--- .../api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- .../api/pet.service.ts | 96 ++++++++++++++----- .../api/store.service.ts | 48 +++++++--- .../api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/default/api/pet.service.ts | 96 ++++++++++++++----- .../builds/default/api/store.service.ts | 48 +++++++--- .../builds/default/api/user.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/pet.service.ts | 96 ++++++++++++++----- .../builds/with-npm/api/store.service.ts | 48 +++++++--- .../builds/with-npm/api/user.service.ts | 96 ++++++++++++++----- 68 files changed, 3987 insertions(+), 1329 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache index b7dd7cbd94..3f5bb626a4 100644 --- a/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/openapi-generator/src/main/resources/typescript-angular/api.service.mustache @@ -349,9 +349,15 @@ export class {{classname}} { {{/hasFormParams}} {{^isResponseFile}} - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } {{/isResponseFile}} diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts index 7363f44f94..71c70d99cc 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/api/default.service.ts @@ -112,9 +112,15 @@ export class DefaultService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/`, @@ -162,9 +168,15 @@ export class DefaultService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts index 1b493ddec4..dcc8df3f3c 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -280,9 +292,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -348,9 +366,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -409,9 +433,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -476,9 +506,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -558,9 +594,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -644,9 +686,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts index d1f6b021e9..06d4df352e 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -176,9 +182,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -229,9 +241,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -289,9 +307,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts index 74920d0f56..a820ab2963 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -351,9 +375,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -417,9 +447,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -464,9 +500,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -527,9 +569,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts index 1b493ddec4..dcc8df3f3c 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -280,9 +292,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -348,9 +366,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -409,9 +433,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -476,9 +506,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -558,9 +594,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -644,9 +686,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts index d1f6b021e9..06d4df352e 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -176,9 +182,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -229,9 +241,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -289,9 +307,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts index 74920d0f56..a820ab2963 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -351,9 +375,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -417,9 +447,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -464,9 +500,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -527,9 +569,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts index 4e6194e7b1..c68d5a82d5 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -281,9 +293,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -349,9 +367,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -410,9 +434,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -477,9 +507,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -559,9 +595,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -645,9 +687,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts index 9d00e8b652..b63e9dbea8 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -177,9 +183,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -230,9 +242,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -290,9 +308,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts index 7fc46dada8..a2e40fa8a1 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -352,9 +376,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -418,9 +448,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -465,9 +501,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -528,9 +570,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts index 4e6194e7b1..c68d5a82d5 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/pet.service.ts @@ -152,9 +152,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -214,9 +220,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -281,9 +293,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -349,9 +367,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -410,9 +434,15 @@ export class PetService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -477,9 +507,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -559,9 +595,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -645,9 +687,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts index 9d00e8b652..b63e9dbea8 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/store.service.ts @@ -121,9 +121,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -177,9 +183,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -230,9 +242,15 @@ export class StoreService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -290,9 +308,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts index 7fc46dada8..a2e40fa8a1 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/api/user.service.ts @@ -129,9 +129,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -188,9 +194,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -247,9 +259,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -299,9 +317,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -352,9 +376,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -418,9 +448,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -465,9 +501,15 @@ export class UserService { } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -528,9 +570,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts index 5da186643a..e7c596ed3a 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts index 4de27ffefa..9b77dbcef1 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts index 90ef87d837..6307716523 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts index 5da186643a..e7c596ed3a 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts index 4de27ffefa..9b77dbcef1 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts index 90ef87d837..6307716523 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts index 5da186643a..e7c596ed3a 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts index 4de27ffefa..9b77dbcef1 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts index 90ef87d837..6307716523 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts index 5da186643a..e7c596ed3a 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/pet.service.ts @@ -146,9 +146,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -203,9 +209,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -264,9 +276,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -327,9 +345,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -383,9 +407,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -445,9 +475,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -522,9 +558,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -603,9 +645,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts index 4de27ffefa..9b77dbcef1 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/store.service.ts @@ -115,9 +115,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -165,9 +171,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -213,9 +225,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -268,9 +286,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts index 90ef87d837..6307716523 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/api/user.service.ts @@ -123,9 +123,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -177,9 +183,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -231,9 +243,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -278,9 +296,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -325,9 +349,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -386,9 +416,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -428,9 +464,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -486,9 +528,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts index 011ad69411..65ef3821f1 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/pet.service.ts @@ -198,9 +198,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -256,9 +262,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -318,9 +330,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -382,9 +400,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -439,9 +463,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -502,9 +532,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -580,9 +616,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -662,9 +704,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts index bad85023ee..fda474ef8d 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/store.service.ts @@ -133,9 +133,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -183,9 +189,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -232,9 +244,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -288,9 +306,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts index 0181b7c688..cd418a08ea 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/api/user.service.ts @@ -165,9 +165,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -220,9 +226,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -275,9 +287,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -323,9 +341,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -371,9 +395,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -433,9 +463,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -475,9 +511,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -534,9 +576,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts index fe9e037039..a1cdf35cb1 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts index d561fc8a01..5a0c0c2914 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts index 5635e4a002..7976ebfc80 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts index 66ca7a9fbc..8dad43c484 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts index 4d3a302a7d..819801bdcc 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts index 20a3775732..1ac75a68c0 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts index 2a0f6ba379..955dc51f05 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/pet.service.ts @@ -148,9 +148,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet`, @@ -205,9 +211,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -266,9 +278,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByStatus`, @@ -329,9 +347,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get>(`${this.configuration.basePath}/pet/findByTags`, @@ -385,9 +409,15 @@ export class PetService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -447,9 +477,15 @@ export class PetService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/pet`, @@ -524,9 +560,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('status', status) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}`, @@ -605,9 +647,15 @@ export class PetService { localVarFormParams = localVarFormParams.append('file', file) as any || localVarFormParams; } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts index a90fbb92ab..20480749e9 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/store.service.ts @@ -117,9 +117,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -167,9 +173,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get<{ [key: string]: number; }>(`${this.configuration.basePath}/store/inventory`, @@ -215,9 +227,15 @@ export class StoreService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/store/order/${encodeURIComponent(String(orderId))}`, @@ -270,9 +288,15 @@ export class StoreService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/store/order`, diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts index f3565253c9..b90b53eb44 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/api/user.service.ts @@ -125,9 +125,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user`, @@ -179,9 +185,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithArray`, @@ -233,9 +245,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.post(`${this.configuration.basePath}/user/createWithList`, @@ -280,9 +298,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.delete(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -327,9 +351,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, @@ -388,9 +418,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/login`, @@ -430,9 +466,15 @@ export class UserService { - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.get(`${this.configuration.basePath}/user/logout`, @@ -488,9 +530,15 @@ export class UserService { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } - let responseType_: 'text' | 'json' = 'json'; - if(localVarHttpHeaderAcceptSelected && localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } } return this.httpClient.put(`${this.configuration.basePath}/user/${encodeURIComponent(String(username))}`, From ac55ac9d55a7acec41568cce315d7306fb40730a Mon Sep 17 00:00:00 2001 From: Justin Black Date: Tue, 28 Dec 2021 11:39:13 -0800 Subject: [PATCH 47/54] Samples and docs regenerated (#11194) --- .../csharp-netcore-complex-files/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-streaming/.openapi-generator/VERSION | 2 +- samples/client/petstore/R/.openapi-generator/VERSION | 2 +- samples/client/petstore/apex/.openapi-generator/VERSION | 2 +- samples/client/petstore/bash/.openapi-generator/VERSION | 2 +- samples/client/petstore/c/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-qt/.openapi-generator/VERSION | 2 +- .../petstore/cpp-restsdk/client/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiClient.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ApiException.h | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/HttpContent.h | 2 +- samples/client/petstore/cpp-restsdk/client/IHttpBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/JsonBody.h | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/ModelBase.h | 2 +- .../client/petstore/cpp-restsdk/client/MultipartFormData.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/MultipartFormData.h | 2 +- samples/client/petstore/cpp-restsdk/client/Object.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/Object.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/PetApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/StoreApi.h | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/api/UserApi.h | 2 +- .../client/petstore/cpp-restsdk/client/model/ApiResponse.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Category.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Order.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Pet.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/Tag.h | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.cpp | 2 +- samples/client/petstore/cpp-restsdk/client/model/User.h | 2 +- samples/client/petstore/cpp-tiny/.openapi-generator/VERSION | 2 +- samples/client/petstore/cpp-ue4/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.openapi-generator/VERSION | 2 +- samples/client/petstore/crystal/.travis.yml | 2 +- samples/client/petstore/crystal/spec/spec_helper.cr | 2 +- samples/client/petstore/crystal/src/petstore.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/pet_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/store_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api/user_api.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_client.cr | 2 +- samples/client/petstore/crystal/src/petstore/api_error.cr | 2 +- samples/client/petstore/crystal/src/petstore/configuration.cr | 2 +- .../client/petstore/crystal/src/petstore/models/api_response.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/category.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/order.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/pet.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/tag.cr | 2 +- samples/client/petstore/crystal/src/petstore/models/user.cr | 2 +- .../.openapi-generator/VERSION | 2 +- .../OpenAPIClient-httpclient/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net47/.openapi-generator/VERSION | 2 +- .../OpenAPIClient-net5.0/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClient/.openapi-generator/VERSION | 2 +- .../csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION | 2 +- .../OpenAPIClientCoreAndNet47/.openapi-generator/VERSION | 2 +- .../petstore/csharp/OpenAPIClient/.openapi-generator/VERSION | 2 +- samples/client/petstore/elixir/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/groovy/.openapi-generator/VERSION | 2 +- .../petstore/haskell-http-client/.openapi-generator/VERSION | 2 +- .../petstore/java-micronaut-client/.openapi-generator/VERSION | 2 +- .../petstore/java/apache-httpclient/.openapi-generator/VERSION | 2 +- .../petstore/java/feign-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/feign/.openapi-generator/VERSION | 2 +- .../petstore/java/google-api-client/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/jersey1/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8-localdatetime/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../java/microprofile-rest-client/.openapi-generator/VERSION | 2 +- .../petstore/java/native-async/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/native/.openapi-generator/VERSION | 2 +- .../okhttp-gson-dynamicOperations/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-nextgen/.openapi-generator/VERSION | 2 +- .../java/okhttp-gson-parcelableModel/.openapi-generator/VERSION | 2 +- .../client/petstore/java/okhttp-gson/.openapi-generator/VERSION | 2 +- .../java/rest-assured-jackson/.openapi-generator/VERSION | 2 +- .../petstore/java/rest-assured/.openapi-generator/VERSION | 2 +- .../client/petstore/java/resteasy/.openapi-generator/VERSION | 2 +- .../java/resttemplate-withXml/.openapi-generator/VERSION | 2 +- .../petstore/java/resttemplate/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2-play26/.openapi-generator/VERSION | 2 +- .../client/petstore/java/retrofit2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx2/.openapi-generator/VERSION | 2 +- .../petstore/java/retrofit2rx3/.openapi-generator/VERSION | 2 +- .../petstore/java/vertx-no-nullable/.openapi-generator/VERSION | 2 +- samples/client/petstore/java/vertx/.openapi-generator/VERSION | 2 +- .../java/webclient-nulable-arrays/.openapi-generator/VERSION | 2 +- .../client/petstore/java/webclient/.openapi-generator/VERSION | 2 +- .../client/petstore/javascript-es6/.openapi-generator/VERSION | 2 +- .../petstore/javascript-promise-es6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/.openapi-generator/VERSION | 2 +- samples/client/petstore/k6/script.js | 2 +- .../kotlin-enum-default-value/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin-gson/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-jackson/.openapi-generator/VERSION | 2 +- .../kotlin-json-request-string/.openapi-generator/VERSION | 2 +- .../kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-jvm-volley/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-moshi-codegen/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-multiplatform/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nonpublic/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-nullable/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-okhttp3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-retrofit2/.openapi-generator/VERSION | 2 +- .../client/petstore/kotlin-string/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-threetenbp/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-uppercase-enum/.openapi-generator/VERSION | 2 +- samples/client/petstore/kotlin/.openapi-generator/VERSION | 2 +- samples/client/petstore/lua/.openapi-generator/VERSION | 2 +- samples/client/petstore/nim/.openapi-generator/VERSION | 2 +- .../client/petstore/objc/core-data/.openapi-generator/VERSION | 2 +- samples/client/petstore/objc/default/.openapi-generator/VERSION | 2 +- samples/client/petstore/perl/.openapi-generator/VERSION | 2 +- .../client/petstore/php-dt-modern/.openapi-generator/VERSION | 2 +- samples/client/petstore/php-dt/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/.openapi-generator/VERSION | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php | 2 +- .../php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/ApiException.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Configuration.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/HeaderSelector.php | 2 +- .../OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php | 2 +- .../OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/Category.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Client.php | 2 +- .../php/OpenAPIClient-php/lib/Model/DeprecatedObject.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/File.php | 2 +- .../php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php | 2 +- .../php/OpenAPIClient-php/lib/Model/HealthCheckResult.php | 2 +- .../php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php | 2 +- .../lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php | 2 +- .../php/OpenAPIClient-php/lib/Model/Model200Response.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelList.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Name.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php | 2 +- .../OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/Order.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php | 2 +- .../php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php | 2 +- .../lib/Model/OuterEnumIntegerDefaultValue.php | 2 +- .../OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php | 2 +- .../php/OpenAPIClient-php/lib/Model/SpecialModelName.php | 2 +- samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php | 2 +- .../client/petstore/php/OpenAPIClient-php/lib/Model/User.php | 2 +- .../petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php | 2 +- samples/client/petstore/powershell/.openapi-generator/VERSION | 2 +- .../client/petstore/python-asyncio/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../client/petstore/python-tornado/.openapi-generator/VERSION | 2 +- samples/client/petstore/python/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby-faraday/lib/petstore.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/api/default_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb | 2 +- .../ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/store_api.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/configuration.rb | 2 +- .../lib/petstore/models/additional_properties_class.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/animal.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/api_response.rb | 2 +- .../lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/array_of_number_only.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/array_test.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/category.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/class_model.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/client.rb | 2 +- .../ruby-faraday/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/enum_test.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/file.rb | 2 +- .../ruby-faraday/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/format_test.rb | 2 +- .../ruby-faraday/lib/petstore/models/has_only_read_only.rb | 2 +- .../ruby-faraday/lib/petstore/models/health_check_result.rb | 2 +- .../ruby-faraday/lib/petstore/models/inline_response_default.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/list.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../ruby-faraday/lib/petstore/models/model200_response.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/model_return.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/name.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/nullable_class.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/number_only.rb | 2 +- .../lib/petstore/models/object_with_deprecated_fields.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/order.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_composite.rb | 2 +- .../petstore/ruby-faraday/lib/petstore/models/outer_enum.rb | 2 +- .../lib/petstore/models/outer_enum_default_value.rb | 2 +- .../ruby-faraday/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb | 2 +- .../ruby-faraday/lib/petstore/models/read_only_first.rb | 2 +- .../ruby-faraday/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb | 2 +- .../client/petstore/ruby-faraday/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby-faraday/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby-faraday/petstore.gemspec | 2 +- samples/client/petstore/ruby-faraday/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby-faraday/spec/spec_helper.rb | 2 +- samples/client/petstore/ruby/.openapi-generator/VERSION | 2 +- samples/client/petstore/ruby/lib/petstore.rb | 2 +- .../client/petstore/ruby/lib/petstore/api/another_fake_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/default_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/fake_api.rb | 2 +- .../ruby/lib/petstore/api/fake_classname_tags123_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/pet_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/store_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api/user_api.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_client.rb | 2 +- samples/client/petstore/ruby/lib/petstore/api_error.rb | 2 +- samples/client/petstore/ruby/lib/petstore/configuration.rb | 2 +- .../ruby/lib/petstore/models/additional_properties_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/animal.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/api_response.rb | 2 +- .../ruby/lib/petstore/models/array_of_array_of_number_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/array_of_number_only.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/array_test.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/capitalization.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/category.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/class_model.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/client.rb | 2 +- .../petstore/ruby/lib/petstore/models/deprecated_object.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/enum_test.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/file.rb | 2 +- .../petstore/ruby/lib/petstore/models/file_schema_test_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/foo.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/format_test.rb | 2 +- .../petstore/ruby/lib/petstore/models/has_only_read_only.rb | 2 +- .../petstore/ruby/lib/petstore/models/health_check_result.rb | 2 +- .../ruby/lib/petstore/models/inline_response_default.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/list.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/map_test.rb | 2 +- .../models/mixed_properties_and_additional_properties_class.rb | 2 +- .../petstore/ruby/lib/petstore/models/model200_response.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/model_return.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/name.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/nullable_class.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/number_only.rb | 2 +- .../ruby/lib/petstore/models/object_with_deprecated_fields.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/order.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/outer_composite.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb | 2 +- .../ruby/lib/petstore/models/outer_enum_default_value.rb | 2 +- .../petstore/ruby/lib/petstore/models/outer_enum_integer.rb | 2 +- .../lib/petstore/models/outer_enum_integer_default_value.rb | 2 +- .../ruby/lib/petstore/models/outer_object_with_enum_property.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/pet.rb | 2 +- .../client/petstore/ruby/lib/petstore/models/read_only_first.rb | 2 +- .../petstore/ruby/lib/petstore/models/special_model_name.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/tag.rb | 2 +- samples/client/petstore/ruby/lib/petstore/models/user.rb | 2 +- samples/client/petstore/ruby/lib/petstore/version.rb | 2 +- samples/client/petstore/ruby/petstore.gemspec | 2 +- samples/client/petstore/ruby/spec/api_client_spec.rb | 2 +- samples/client/petstore/ruby/spec/configuration_spec.rb | 2 +- samples/client/petstore/ruby/spec/spec_helper.rb | 2 +- .../petstore/rust/hyper/petstore/.openapi-generator/VERSION | 2 +- .../rust/reqwest/petstore-async/.openapi-generator/VERSION | 2 +- .../petstore/rust/reqwest/petstore/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-akka/.openapi-generator/VERSION | 2 +- .../scala-httpclient-deprecated/.openapi-generator/VERSION | 2 +- samples/client/petstore/scala-sttp/.openapi-generator/VERSION | 2 +- .../petstore/spring-cloud-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-cloud-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-cloud/.openapi-generator/VERSION | 2 +- .../spring-cloud/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/client/petstore/spring-stubs/.openapi-generator/VERSION | 2 +- .../spring-stubs/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/swift5/alamofireLibrary/.openapi-generator/VERSION | 2 +- .../swift5/asyncAwaitLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/combineLibrary/.openapi-generator/VERSION | 2 +- .../client/petstore/swift5/default/.openapi-generator/VERSION | 2 +- .../petstore/swift5/deprecated/.openapi-generator/VERSION | 2 +- .../petstore/swift5/frozenEnums/.openapi-generator/VERSION | 2 +- .../petstore/swift5/nonPublicApi/.openapi-generator/VERSION | 2 +- .../petstore/swift5/objcCompatible/.openapi-generator/VERSION | 2 +- samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION | 2 +- .../swift5/promisekitLibrary/.openapi-generator/VERSION | 2 +- .../swift5/readonlyProperties/.openapi-generator/VERSION | 2 +- .../petstore/swift5/resultLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION | 2 +- .../swift5/urlsessionLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/vaporLibrary/.openapi-generator/VERSION | 2 +- .../petstore/swift5/x-swift-hashable/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/single-request-parameter/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../builds/with-prefixed-module-name/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../builds/with-npm/.openapi-generator/VERSION | 2 +- .../typescript-aurelia/default/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript-axios/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/test-petstore/.openapi-generator/VERSION | 2 +- .../builds/with-complex-headers/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-node-imports/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../with-single-request-parameters/.openapi-generator/VERSION | 2 +- .../builds/default-v3.0/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/default/.openapi-generator/VERSION | 2 +- .../typescript-fetch/builds/enum/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/multiple-parameters/.openapi-generator/VERSION | 2 +- .../prefix-parameter-interfaces/.openapi-generator/VERSION | 2 +- .../builds/sagas-and-records/.openapi-generator/VERSION | 2 +- .../builds/typescript-three-plus/.openapi-generator/VERSION | 2 +- .../builds/with-interfaces/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/without-runtime-checks/.openapi-generator/VERSION | 2 +- .../petstore/typescript-inversify/.openapi-generator/VERSION | 2 +- .../typescript-jquery/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-jquery/npm/.openapi-generator/VERSION | 2 +- .../builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript-node/npm/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../typescript-rxjs/builds/default/.openapi-generator/VERSION | 2 +- .../builds/es6-target/.openapi-generator/VERSION | 2 +- .../builds/with-npm-version/.openapi-generator/VERSION | 2 +- .../builds/with-progress-subscriber/.openapi-generator/VERSION | 2 +- .../config/petstore/protobuf-schema/.openapi-generator/VERSION | 2 +- samples/openapi3/client/elm/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/go-experimental/.openapi-generator/VERSION | 2 +- .../java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/python/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/.openapi-generator/VERSION | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api/usage_api.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_client.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/api_error.rb | 2 +- .../ruby-client/lib/x_auth_id_alias/configuration.rb | 2 +- .../x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/api_client_spec.rb | 2 +- .../x-auth-id-alias/ruby-client/spec/configuration_spec.rb | 2 +- .../extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb | 2 +- .../x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec | 2 +- .../features/dynamic-servers/python/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/.openapi-generator/VERSION | 2 +- .../features/dynamic-servers/ruby/dynamic_servers.gemspec | 2 +- .../client/features/dynamic-servers/ruby/lib/dynamic_servers.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_client.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/api_error.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/configuration.rb | 2 +- .../dynamic-servers/ruby/lib/dynamic_servers/version.rb | 2 +- .../features/dynamic-servers/ruby/spec/api_client_spec.rb | 2 +- .../features/dynamic-servers/ruby/spec/configuration_spec.rb | 2 +- .../client/features/dynamic-servers/ruby/spec/spec_helper.rb | 2 +- .../ruby-client/.openapi-generator/VERSION | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore.rb | 2 +- .../ruby-client/lib/petstore/api/usage_api.rb | 2 +- .../ruby-client/lib/petstore/api_client.rb | 2 +- .../ruby-client/lib/petstore/api_error.rb | 2 +- .../ruby-client/lib/petstore/configuration.rb | 2 +- .../ruby-client/lib/petstore/models/array_alias.rb | 2 +- .../ruby-client/lib/petstore/models/map_alias.rb | 2 +- .../generate-alias-as-model/ruby-client/lib/petstore/version.rb | 2 +- .../generate-alias-as-model/ruby-client/petstore.gemspec | 2 +- .../generate-alias-as-model/ruby-client/spec/api_client_spec.rb | 2 +- .../ruby-client/spec/configuration_spec.rb | 2 +- .../generate-alias-as-model/ruby-client/spec/spec_helper.rb | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart-dio/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib/.openapi-generator/VERSION | 2 +- .../dart2/petstore_client_lib_fake/.openapi-generator/VERSION | 2 +- .../client/petstore/go/go-petstore/.openapi-generator/VERSION | 2 +- .../jersey2-java8-special-characters/.openapi-generator/VERSION | 2 +- .../petstore/java/jersey2-java8/.openapi-generator/VERSION | 2 +- .../client/petstore/python-legacy/.openapi-generator/VERSION | 2 +- .../openapi3/client/petstore/python/.openapi-generator/VERSION | 2 +- .../builds/composed-schemas/.openapi-generator/VERSION | 2 +- .../typescript/builds/default/.openapi-generator/VERSION | 2 +- .../petstore/typescript/builds/deno/.openapi-generator/VERSION | 2 +- .../typescript/builds/inversify/.openapi-generator/VERSION | 2 +- .../typescript/builds/jquery/.openapi-generator/VERSION | 2 +- .../typescript/builds/object_params/.openapi-generator/VERSION | 2 +- samples/schema/petstore/ktorm/.openapi-generator/VERSION | 2 +- samples/schema/petstore/mysql/.openapi-generator/VERSION | 2 +- samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.0/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-3.1/.openapi-generator/VERSION | 2 +- .../server/petstore/aspnetcore-5.0/.openapi-generator/VERSION | 2 +- samples/server/petstore/aspnetcore/.openapi-generator/VERSION | 2 +- samples/server/petstore/cpp-pistache/.openapi-generator/VERSION | 2 +- .../cpp-qt-qhttpengine-server/.openapi-generator/VERSION | 2 +- .../server/petstore/erlang-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-api-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-chi-server/.openapi-generator/VERSION | 2 +- .../server/petstore/go-echo-server/.openapi-generator/VERSION | 2 +- .../petstore/go-gin-api-server/.openapi-generator/VERSION | 2 +- .../petstore/go-server-required/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-servant/.openapi-generator/VERSION | 2 +- .../server/petstore/haskell-yesod/.openapi-generator/VERSION | 2 +- samples/server/petstore/java-msf4j/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-async/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../java-play-framework-no-interface/.openapi-generator/VERSION | 2 +- .../java-play-framework-no-nullable/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../petstore/java-play-framework/.openapi-generator/VERSION | 2 +- .../server/petstore/java-undertow/.openapi-generator/VERSION | 2 +- .../server/petstore/java-vertx-web/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION | 2 +- .../jaxrs-cxf-non-spring-app/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/default-value/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/default/.openapi-generator/VERSION | 2 +- .../jaxrs-resteasy/eap-java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs-spec-interface/.openapi-generator/VERSION | 2 +- samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey1/.openapi-generator/VERSION | 2 +- .../petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION | 2 +- .../server/petstore/jaxrs/jersey2/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-server/ktor/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin-server/ktor/README.md | 2 +- .../kotlin-springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/kotlin/org/openapitools/api/PetApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/StoreApi.kt | 2 +- .../src/main/kotlin/org/openapitools/api/UserApi.kt | 2 +- .../kotlin-springboot-modelMutable/.openapi-generator/VERSION | 2 +- .../kotlin-springboot-reactive/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-springboot/.openapi-generator/VERSION | 2 +- samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-laravel/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-lumen/.openapi-generator/VERSION | 2 +- .../petstore/php-mezzio-ph-modern/.openapi-generator/VERSION | 2 +- .../server/petstore/php-mezzio-ph/.openapi-generator/VERSION | 2 +- samples/server/petstore/php-slim4/.openapi-generator/VERSION | 2 +- .../php-symfony/SymfonyBundle-php/.openapi-generator/VERSION | 2 +- .../python-aiohttp-srclayout/.openapi-generator/VERSION | 2 +- .../server/petstore/python-aiohttp/.openapi-generator/VERSION | 2 +- .../petstore/python-blueplanet/.openapi-generator/VERSION | 2 +- .../server/petstore/python-fastapi/.openapi-generator/VERSION | 2 +- samples/server/petstore/python-flask/.openapi-generator/VERSION | 2 +- .../rust-server/output/multipart-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/no-example-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/openapi-v3/.openapi-generator/VERSION | 2 +- .../rust-server/output/ops-v3/.openapi-generator/VERSION | 2 +- .../.openapi-generator/VERSION | 2 +- .../output/ping-bearer-auth/.openapi-generator/VERSION | 2 +- .../output/rust-server-test/.openapi-generator/VERSION | 2 +- .../spring-mvc-default-value/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/TestHeadersApi.java | 2 +- .../src/main/java/org/openapitools/api/TestQueryParamsApi.java | 2 +- .../petstore/spring-mvc-j8-async/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-j8-localdatetime/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/spring-mvc-no-nullable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../spring-mvc-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- samples/server/petstore/spring-mvc/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../spring-mvc/src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-beanvalidation/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate-j8/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-delegate/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-implicitHeaders/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-reactive/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../springboot-spring-pageable/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-useoptional/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/api/UserApi.java | 2 +- .../petstore/springboot-virtualan/.openapi-generator/VERSION | 2 +- .../java/org/openapitools/virtualan/api/AnotherFakeApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/FakeApi.java | 2 +- .../org/openapitools/virtualan/api/FakeClassnameTestApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/StoreApi.java | 2 +- .../src/main/java/org/openapitools/virtualan/api/UserApi.java | 2 +- samples/server/petstore/springboot/.openapi-generator/VERSION | 2 +- .../src/main/java/org/openapitools/api/AnotherFakeApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../main/java/org/openapitools/api/FakeClassnameTestApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/PetApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/StoreApi.java | 2 +- .../springboot/src/main/java/org/openapitools/api/UserApi.java | 2 +- 681 files changed, 681 insertions(+), 681 deletions(-) diff --git a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION +++ b/samples/client/others/csharp-netcore-complex-files/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION +++ b/samples/client/others/java/okhttp-gson-streaming/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/R/.openapi-generator/VERSION b/samples/client/petstore/R/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/R/.openapi-generator/VERSION +++ b/samples/client/petstore/R/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/apex/.openapi-generator/VERSION b/samples/client/petstore/apex/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/apex/.openapi-generator/VERSION +++ b/samples/client/petstore/apex/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/cpp-qt/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-qt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp index 885c229bfe..b5c500a0fa 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h index c2db5dc08c..7a13f219f4 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiClient.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp index bd0cb8c0e9..67e66b708c 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h index d65ddb6b2f..046dfd9ea5 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp index 928bf8e041..8f98115027 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h index bced883bee..5d1d82b9a8 100644 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ b/samples/client/petstore/cpp-restsdk/client/ApiException.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp index eac0d66ff3..be68ba1c7f 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h index bfa0d19bbf..d8bd333dad 100644 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ b/samples/client/petstore/cpp-restsdk/client/HttpContent.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h index a5adf55cf8..7661536b93 100644 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp index b47bc2c5bd..85dbe17686 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h index c50267c56e..99344661cb 100644 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ b/samples/client/petstore/cpp-restsdk/client/JsonBody.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp index 75d1bb01cf..752b93f705 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h index 831ffa9f4e..c300ecb5af 100644 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ b/samples/client/petstore/cpp-restsdk/client/ModelBase.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp index d8f3ee4340..075f7867be 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h index d260399229..a7e8a87f5a 100644 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp index 968df9a487..2c2f65d4ed 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ b/samples/client/petstore/cpp-restsdk/client/Object.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h index 6bcec36c02..ba2a3bdb8c 100644 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ b/samples/client/petstore/cpp-restsdk/client/Object.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp index 2c2236f7d2..5bf94b7ce2 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h index a6bf7fcbcc..7881387800 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp index 7171938cad..e415ebeffc 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h index 5d35de7fc3..10bf584942 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp index bc13700dfd..a291d4f0c4 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h index 0b2a614433..942da254f2 100644 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp index 214e69dcbe..4157079156 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h index 86a703fae9..fcb1588768 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp index 3250fef9ca..2fcec2bcaa 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h index 7ecefb5492..777e5baf3b 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Category.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp index 4fc8ad8b5c..f8618ce035 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h index a10e8c34f4..893c367dc6 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Order.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp index 76867745ec..12c9dfa8b8 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h index b5f8b346b3..e6ade67842 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Pet.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp index eafb5845d5..14bce27318 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h index a6f8d69325..2a7a3d005c 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ b/samples/client/petstore/cpp-restsdk/client/model/Tag.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp index 074b337eda..38aebe66ad 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ b/samples/client/petstore/cpp-restsdk/client/model/User.cpp @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h index 588445311b..3e44d4750c 100644 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ b/samples/client/petstore/cpp-restsdk/client/model/User.h @@ -4,7 +4,7 @@ * * The version of the OpenAPI document: 1.0.0 * - * NOTE: This class is auto generated by OpenAPI-Generator 5.3.1. + * NOTE: This class is auto generated by OpenAPI-Generator 5.4.0-SNAPSHOT. * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-tiny/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION +++ b/samples/client/petstore/cpp-ue4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/crystal/.openapi-generator/VERSION b/samples/client/petstore/crystal/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/crystal/.openapi-generator/VERSION +++ b/samples/client/petstore/crystal/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/crystal/.travis.yml b/samples/client/petstore/crystal/.travis.yml index 6bc76c0613..59de24cd45 100644 --- a/samples/client/petstore/crystal/.travis.yml +++ b/samples/client/petstore/crystal/.travis.yml @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # language: crystal diff --git a/samples/client/petstore/crystal/spec/spec_helper.cr b/samples/client/petstore/crystal/spec/spec_helper.cr index 901c229549..c6eb4e7a60 100644 --- a/samples/client/petstore/crystal/spec/spec_helper.cr +++ b/samples/client/petstore/crystal/spec/spec_helper.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # # load modules diff --git a/samples/client/petstore/crystal/src/petstore.cr b/samples/client/petstore/crystal/src/petstore.cr index 95c15e0996..bfa9806eea 100644 --- a/samples/client/petstore/crystal/src/petstore.cr +++ b/samples/client/petstore/crystal/src/petstore.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # # Dependencies diff --git a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr index e2c81b3a3b..a808853db0 100644 --- a/samples/client/petstore/crystal/src/petstore/api/pet_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/pet_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/store_api.cr b/samples/client/petstore/crystal/src/petstore/api/store_api.cr index f080f1a29a..633b3ca71f 100644 --- a/samples/client/petstore/crystal/src/petstore/api/store_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/store_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api/user_api.cr b/samples/client/petstore/crystal/src/petstore/api/user_api.cr index f936051d44..9809fc615e 100644 --- a/samples/client/petstore/crystal/src/petstore/api/user_api.cr +++ b/samples/client/petstore/crystal/src/petstore/api/user_api.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "uri" diff --git a/samples/client/petstore/crystal/src/petstore/api_client.cr b/samples/client/petstore/crystal/src/petstore/api_client.cr index e8377faa33..5a15ff6f6f 100644 --- a/samples/client/petstore/crystal/src/petstore/api_client.cr +++ b/samples/client/petstore/crystal/src/petstore/api_client.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/api_error.cr b/samples/client/petstore/crystal/src/petstore/api_error.cr index 482fcb9616..c99be8e41f 100644 --- a/samples/client/petstore/crystal/src/petstore/api_error.cr +++ b/samples/client/petstore/crystal/src/petstore/api_error.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # module Petstore diff --git a/samples/client/petstore/crystal/src/petstore/configuration.cr b/samples/client/petstore/crystal/src/petstore/configuration.cr index d87702fb8a..cc46c380f1 100644 --- a/samples/client/petstore/crystal/src/petstore/configuration.cr +++ b/samples/client/petstore/crystal/src/petstore/configuration.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "log" diff --git a/samples/client/petstore/crystal/src/petstore/models/api_response.cr b/samples/client/petstore/crystal/src/petstore/models/api_response.cr index 0c0aa1fd1c..be55113490 100644 --- a/samples/client/petstore/crystal/src/petstore/models/api_response.cr +++ b/samples/client/petstore/crystal/src/petstore/models/api_response.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/category.cr b/samples/client/petstore/crystal/src/petstore/models/category.cr index 11dcb87bad..55c64154d9 100644 --- a/samples/client/petstore/crystal/src/petstore/models/category.cr +++ b/samples/client/petstore/crystal/src/petstore/models/category.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/order.cr b/samples/client/petstore/crystal/src/petstore/models/order.cr index 4d03556ff8..5d00ea6688 100644 --- a/samples/client/petstore/crystal/src/petstore/models/order.cr +++ b/samples/client/petstore/crystal/src/petstore/models/order.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/pet.cr b/samples/client/petstore/crystal/src/petstore/models/pet.cr index 7fb8cc4521..cdac65776d 100644 --- a/samples/client/petstore/crystal/src/petstore/models/pet.cr +++ b/samples/client/petstore/crystal/src/petstore/models/pet.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/tag.cr b/samples/client/petstore/crystal/src/petstore/models/tag.cr index 9b95af047b..bd29332918 100644 --- a/samples/client/petstore/crystal/src/petstore/models/tag.cr +++ b/samples/client/petstore/crystal/src/petstore/models/tag.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/crystal/src/petstore/models/user.cr b/samples/client/petstore/crystal/src/petstore/models/user.cr index 7b647aaee1..47430b4452 100644 --- a/samples/client/petstore/crystal/src/petstore/models/user.cr +++ b/samples/client/petstore/crystal/src/petstore/models/user.cr @@ -5,7 +5,7 @@ #The version of the OpenAPI document: 1.0.0 # #Generated by: https://openapi-generator.tech -#OpenAPI Generator version: 5.3.1 +#OpenAPI Generator version: 5.4.0-SNAPSHOT # require "json" diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-ConditionalSerialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient-net5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp-netcore/OpenAPIClientCoreAndNet47/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION +++ b/samples/client/petstore/csharp/OpenAPIClient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/elixir/.openapi-generator/VERSION b/samples/client/petstore/elixir/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/elixir/.openapi-generator/VERSION +++ b/samples/client/petstore/elixir/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION +++ b/samples/client/petstore/haskell-http-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java-micronaut-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/apache-httpclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/.openapi-generator/VERSION b/samples/client/petstore/java/feign/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/feign/.openapi-generator/VERSION +++ b/samples/client/petstore/java/feign/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/google-api-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/jersey1/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION +++ b/samples/client/petstore/java/microprofile-rest-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native-async/.openapi-generator/VERSION b/samples/client/petstore/java/native-async/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/native-async/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/native/.openapi-generator/VERSION b/samples/client/petstore/java/native/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/native/.openapi-generator/VERSION +++ b/samples/client/petstore/java/native/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-nextgen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION +++ b/samples/client/petstore/java/rest-assured/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/resteasy/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resteasy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION +++ b/samples/client/petstore/java/resttemplate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2-play26/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/java/retrofit2rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/.openapi-generator/VERSION b/samples/client/petstore/java/vertx/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/vertx/.openapi-generator/VERSION +++ b/samples/client/petstore/java/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient-nulable-arrays/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/webclient/.openapi-generator/VERSION b/samples/client/petstore/java/webclient/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/java/webclient/.openapi-generator/VERSION +++ b/samples/client/petstore/java/webclient/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/javascript-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/k6/.openapi-generator/VERSION b/samples/client/petstore/k6/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/k6/.openapi-generator/VERSION +++ b/samples/client/petstore/k6/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/k6/script.js b/samples/client/petstore/k6/script.js index da7d50e965..67f187fa9b 100644 --- a/samples/client/petstore/k6/script.js +++ b/samples/client/petstore/k6/script.js @@ -7,7 +7,7 @@ * NOTE: This class is auto generated by OpenAPI Generator. * https://github.com/OpenAPITools/openapi-generator * - * OpenAPI generator version: 5.3.1 + * OpenAPI generator version: 5.4.0-SNAPSHOT */ diff --git a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-enum-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-gson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jackson/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-json-request-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-okhttp4-coroutines/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-jvm-volley/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-moshi-codegen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-multiplatform/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nonpublic/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-okhttp3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-kotlinx_serialization/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2-rx3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-retrofit2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-string/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-string/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin-uppercase-enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/lua/.openapi-generator/VERSION b/samples/client/petstore/lua/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/lua/.openapi-generator/VERSION +++ b/samples/client/petstore/lua/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/nim/.openapi-generator/VERSION b/samples/client/petstore/nim/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/nim/.openapi-generator/VERSION +++ b/samples/client/petstore/nim/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/perl/.openapi-generator/VERSION b/samples/client/petstore/perl/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/perl/.openapi-generator/VERSION +++ b/samples/client/petstore/perl/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php-dt/.openapi-generator/VERSION b/samples/client/petstore/php-dt/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/php-dt/.openapi-generator/VERSION +++ b/samples/client/petstore/php-dt/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION +++ b/samples/client/petstore/php/OpenAPIClient-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php index ef0239cf3c..b069070fd1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/AnotherFakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php index c46d14ceac..def9fc1580 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/DefaultApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php index 18321834a0..6feaff8833 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php index 2de6960003..cf271105c8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/FakeClassnameTags123Api.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php index affa3d61c5..399cec4b77 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/PetApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php index 8af7471eba..7fb733e795 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/StoreApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php index 941de5bc55..d54e6cfaef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Api/UserApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php index 2011d70101..01f8b03d59 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php index 8bd9fbe0f2..cd182e99fc 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php index 08598d5d89..c44fe4784d 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php index 34faf425f9..813a7583db 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/AdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php index 281c00ce1d..3f8820c978 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Animal.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php index 0e98f27fd8..b64c2a8772 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ApiResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php index 1699097ee9..af16be5b4a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php index 484d6d85db..c932439bb4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayOfNumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php index b273d72aad..341366e541 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ArrayTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php index b27ff3277a..b1a0bd652c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Capitalization.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php index 7ec56fb28f..75bc5fe9da 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Cat.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php index 86c145ba23..ef088f7fd9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/CatAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php index 77cf9d7491..f61f944a48 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Category.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php index a10395aeb5..26293327c2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ClassModel.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php index 9003d71c55..fabf7edb56 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Client.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php index 709840cf55..3d2727154a 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DeprecatedObject.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php index 7019bc247b..9f2f6b76f1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Dog.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php index 340c9b62d4..8dc34950ce 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/DogAllOf.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php index 7087c06f4b..20bdbe900e 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumArrays.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php index 95e659d81c..61c123dfe4 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php index a9b77449fb..61663693ef 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/EnumTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php index dab541a365..2fbc4e7933 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/File.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php index 182bba9d0f..7f6d4895ae 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FileSchemaTestClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php index 0350c9b702..5f3dd71832 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Foo.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php index ad12cf397c..65a211e158 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/FormatTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php index 63d53152ed..3aaae75260 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HasOnlyReadOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php index 1584ce6e4c..71f11616f9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/HealthCheckResult.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php index 6c2cddeab1..1b70b35625 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/InlineResponseDefault.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php index aab4ab77d6..7359bf0da8 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MapTest.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php index 12d73135f2..546996e9c7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/MixedPropertiesAndAdditionalPropertiesClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php index 95c238707c..e6db4af8c7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Model200Response.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php index 9cc0c37d23..26d5c4988f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php index c6f2fa418f..13195d2725 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelList.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php index 136db271d3..4fb179c4de 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ModelReturn.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php index e99ec229be..d576c3d69f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Name.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php index 536d505ead..1cc4acb161 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NullableClass.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php index d178264a41..82f4e7c5c7 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/NumberOnly.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php index 7fecb82803..aaff2f3c3c 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ObjectWithDeprecatedFields.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php index 8ce7262cba..36e32464b2 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Order.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php index fe187afea2..73660c6e46 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterComposite.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php index 507b3082ef..1b5bdf7693 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnum.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php index b6dd12bb8b..8bcebde398 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php index f250dc8a6a..7575c418af 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumInteger.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php index 955c64ce9a..65234ea6e1 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterEnumIntegerDefaultValue.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php index dd50c70fc3..d370aadf39 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/OuterObjectWithEnumProperty.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php index 6b9279481c..e22f00ae16 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Pet.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php index c5a4506ed4..cedd0e73d9 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/ReadOnlyFirst.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php index f024c4ed58..d77bea39df 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/SpecialModelName.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php index 1e28a4712f..d4284492ed 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/Tag.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php index ca9f08769f..2626138429 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/Model/User.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index b91eafd907..017633db76 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: 1.0.0 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 5.3.1 + * OpenAPI Generator version: 5.4.0-SNAPSHOT */ /** diff --git a/samples/client/petstore/powershell/.openapi-generator/VERSION b/samples/client/petstore/powershell/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/powershell/.openapi-generator/VERSION +++ b/samples/client/petstore/powershell/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/python-asyncio/.openapi-generator/VERSION +++ b/samples/client/petstore/python-asyncio/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/client/petstore/python-legacy/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python-tornado/.openapi-generator/VERSION b/samples/client/petstore/python-tornado/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/python-tornado/.openapi-generator/VERSION +++ b/samples/client/petstore/python-tornado/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/.openapi-generator/VERSION b/samples/client/petstore/python/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/python/.openapi-generator/VERSION +++ b/samples/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION +++ b/samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby-faraday/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby-faraday/lib/petstore.rb b/samples/client/petstore/ruby-faraday/lib/petstore.rb index 2995b750e7..d9d5491624 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb index df802567c9..9535fd15de 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb index 6d11d8773a..84d666312e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb index 20d12b5c1f..d7acddef01 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb index d00a18a1bf..9eb20c278b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb index 08f18cd4f1..fd4d73299e 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb index 7c9e0fde7a..9ebd82ddc8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb index 9687de3f38..9f6cd55be7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb index 568dd909fd..f14d04a5b7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb index a200afcf0a..ebf166152c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb index b528aef09d..09143381bc 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb index 01f6b001ea..6137b4905f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb index 1025187c82..c1d80a23d3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb index 1049822b7f..0b9e281f33 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb index 57c603716d..0987e392a5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb index 6668a18e93..6e40954d60 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb index 95cfe89d16..eba93689e7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb index db3fd78685..a04322c900 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb index 61114303c8..7107968d38 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb index 33cb299c29..7a2a2ad5f7 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb index 447b1573bf..cf5d1e36c3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb index d5c9fef37b..546e54a41f 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb index 3314bca5ed..792ea88c60 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb index b72cd21b93..7304906159 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb index 40987f214e..7db02e1cab 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb index e5c68f7983..1fb42b5a03 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb index 96dfcb24d7..0ffa7fb0f8 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb index f722acfc1d..2afb2753c4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb index aedf6b2c7e..bd1304ccf3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb index f5ae1fed19..2d0680fa72 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb index 542d991d5a..1a2146a9c6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb index ac18fe7bee..3ab5660513 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb index 4410e00a47..6a658e35bf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb index 9f51cfada9..54d25a6f5b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb index 07be52509f..cd53646b93 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb index 5fc7450bdf..ccd578a952 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb index a81fe7e5fd..f2c5ec1619 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb index 24e2b85e72..ffa79e40fe 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 73e2781755..543cc1ce5b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb index 91ccd158a1..83b38460ee 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb index d71c1f1bd9..4ad971483d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb index 86b93dd8b2..c313f79516 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb index a41b1ddc08..b8a5a96fad 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb index ecd5e5b841..dba180351b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb index 25e3b018e2..da6017f8e4 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb index e2cdc7dce1..e305739da9 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb index 0b9b36ea64..059f089124 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb index b2b647d26d..d3ae94e1d5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb index 55244dcbcf..003c7217c3 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb index 59419e67fd..d4a4fed26d 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb index 6807c7de36..d6079135cf 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb index 4b467b3de0..6f4aec9f4a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb index 410fa168bf..e73b65c3c5 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb index 6f4a5fbd5d..4197a2ec61 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb index bad3c1d542..001d3b3a0b 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb index 166611902e..cba58e1df6 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb index 30e9406bf7..167953675a 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb index 6126a809aa..fe6cd38e7c 100644 --- a/samples/client/petstore/ruby-faraday/lib/petstore/version.rb +++ b/samples/client/petstore/ruby-faraday/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/petstore.gemspec b/samples/client/petstore/ruby-faraday/petstore.gemspec index b64d60e741..eb8fa27ef0 100644 --- a/samples/client/petstore/ruby-faraday/petstore.gemspec +++ b/samples/client/petstore/ruby-faraday/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb index 99b44ba573..d47987c12a 100644 --- a/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb index 9a36ef9337..f7eceea4ec 100644 --- a/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby-faraday/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb index 389cc910f0..d90940c63b 100644 --- a/samples/client/petstore/ruby-faraday/spec/spec_helper.rb +++ b/samples/client/petstore/ruby-faraday/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/.openapi-generator/VERSION b/samples/client/petstore/ruby/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/ruby/.openapi-generator/VERSION +++ b/samples/client/petstore/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index 2995b750e7..d9d5491624 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb index df802567c9..9535fd15de 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/another_fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb index 6d11d8773a..84d666312e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/default_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/default_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb index 20d12b5c1f..d7acddef01 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb index d00a18a1bf..9eb20c278b 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_classname_tags123_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb index 9d828b5f6d..0014c5b78a 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb index 50be6c0e15..becfae6e1b 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb index fd7106e359..5a550ce47e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 8ab8f8520c..7cf4a5d85e 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index a200afcf0a..ebf166152c 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index 4ee7fe94f3..6c934e35bf 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 01f6b001ea..6137b4905f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 1025187c82..c1d80a23d3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 1049822b7f..0b9e281f33 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index 57c603716d..0987e392a5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index 6668a18e93..6e40954d60 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index 95cfe89d16..eba93689e7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index db3fd78685..a04322c900 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index 61114303c8..7107968d38 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb index 33cb299c29..7a2a2ad5f7 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 447b1573bf..cf5d1e36c3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index d5c9fef37b..546e54a41f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 3314bca5ed..792ea88c60 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb index b72cd21b93..7304906159 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/deprecated_object.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 40987f214e..7db02e1cab 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb index e5c68f7983..1fb42b5a03 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog_all_of.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 96dfcb24d7..0ffa7fb0f8 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index f722acfc1d..2afb2753c4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index aedf6b2c7e..bd1304ccf3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file.rb b/samples/client/petstore/ruby/lib/petstore/models/file.rb index f5ae1fed19..2d0680fa72 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb index 542d991d5a..1a2146a9c6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/file_schema_test_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/foo.rb b/samples/client/petstore/ruby/lib/petstore/models/foo.rb index ac18fe7bee..3ab5660513 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/foo.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/foo.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 4410e00a47..6a658e35bf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 9f51cfada9..54d25a6f5b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb index 07be52509f..cd53646b93 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/health_check_result.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb index 5fc7450bdf..ccd578a952 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/inline_response_default.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index a81fe7e5fd..f2c5ec1619 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 24e2b85e72..ffa79e40fe 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index 73e2781755..543cc1ce5b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb index 91ccd158a1..83b38460ee 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model200_response.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index d71c1f1bd9..4ad971483d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index 86b93dd8b2..c313f79516 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb index a41b1ddc08..b8a5a96fad 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/nullable_class.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index ecd5e5b841..dba180351b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb index 25e3b018e2..da6017f8e4 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/object_with_deprecated_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index e2cdc7dce1..e305739da9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index 0b9b36ea64..059f089124 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index b2b647d26d..d3ae94e1d5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb index 55244dcbcf..003c7217c3 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb index 59419e67fd..d4a4fed26d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb index 6807c7de36..d6079135cf 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum_integer_default_value.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb index 4b467b3de0..6f4aec9f4a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_object_with_enum_property.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index 410fa168bf..e73b65c3c5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 6f4a5fbd5d..4197a2ec61 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index bad3c1d542..001d3b3a0b 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 166611902e..cba58e1df6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 30e9406bf7..167953675a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index 6126a809aa..fe6cd38e7c 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 846cb3e9f9..869a27cff6 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/api_client_spec.rb b/samples/client/petstore/ruby/spec/api_client_spec.rb index 04d9cc79cd..48ef4c890a 100644 --- a/samples/client/petstore/ruby/spec/api_client_spec.rb +++ b/samples/client/petstore/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/configuration_spec.rb b/samples/client/petstore/ruby/spec/configuration_spec.rb index 9a36ef9337..f7eceea4ec 100644 --- a/samples/client/petstore/ruby/spec/configuration_spec.rb +++ b/samples/client/petstore/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/spec/spec_helper.rb b/samples/client/petstore/ruby/spec/spec_helper.rb index 389cc910f0..d90940c63b 100644 --- a/samples/client/petstore/ruby/spec/spec_helper.rb +++ b/samples/client/petstore/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/hyper/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/rust/reqwest/petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-akka/.openapi-generator/VERSION b/samples/client/petstore/scala-akka/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/scala-akka/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-akka/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-httpclient-deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/scala-sttp/.openapi-generator/VERSION +++ b/samples/client/petstore/scala-sttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index b87ed4065e..c28311ac4c 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index e6e78df205..9ef191daba 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index efcfdfa6bd..94f5c43404 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index 785314b56f..f71534f66c 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 28845958d6..1ee6df7a6e 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 9105efb7a3..1c8c6c4971 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/spring-cloud/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-cloud/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index 0719fcf872..1e8c3492df 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 51d842c795..b9ffd3aa63 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 44d9bbf440..05eacea86d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 551fccda4f..4bc16c20f4 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index 31712e7b2c..27b18c586c 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 8b76ca5753..28042a4ca8 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/alamofireLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/combineLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/.openapi-generator/VERSION b/samples/client/petstore/swift5/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/default/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/deprecated/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/frozenEnums/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/nonPublicApi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/objcCompatible/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/oneOf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/promisekitLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/readonlyProperties/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/resultLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/rxswiftLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/urlsessionLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/vaporLibrary/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION +++ b/samples/client/petstore/swift5/x-swift-hashable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-oneOf/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v11-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v13-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-any/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-aurelia/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/test-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-complex-headers/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-fake-endpoints-models-for-testing-with-http-signature/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION index 4077803655..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-node-imports/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1-SNAPSHOT \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version-and-separate-models-and-api/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-axios/builds/with-single-request-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default-v3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/enum/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/multiple-parameters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/prefix-parameter-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/sagas-and-records/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/typescript-three-plus/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/without-runtime-checks/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-jquery/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-nestjs-v6-provided-in-root/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-redux-query/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/es6-target/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-npm-version/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION +++ b/samples/client/petstore/typescript-rxjs/builds/with-progress-subscriber/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION +++ b/samples/config/petstore/protobuf-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/elm/.openapi-generator/VERSION b/samples/openapi3/client/elm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/elm/.openapi-generator/VERSION +++ b/samples/openapi3/client/elm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb index b0324ac0bf..2b3dbe10fe 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb index fa2549ca25..3ca038ad11 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb index acd170f6b6..abc3d3c267 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb index 1d9d6b85c5..7b029fc31b 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb index 2c2d6ed5e1..03a6b4505c 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb index 92236c8711..0af9e59105 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/lib/x_auth_id_alias/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb index d4b35523b2..24fc7dbeb5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb index 39ae825216..9ed65352f5 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb index 0a68b8922b..cd0ab1c544 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec index 29085fa88f..7405c95a61 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec +++ b/samples/openapi3/client/extensions/x-auth-id-alias/ruby-client/x_auth_id_alias.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/dynamic-servers/ruby/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec index c5fb037a7f..386e9241fe 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec +++ b/samples/openapi3/client/features/dynamic-servers/ruby/dynamic_servers.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb index a70acea011..6e40dcf063 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb index d4efa7f351..daba92a4fa 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb index fc7597e64f..60e56673b9 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb index 9d73ce3ffa..17ff6f501b 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb index f5b389637f..533f65efb5 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb index 1e07b74b1f..fdae30f5c1 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/lib/dynamic_servers/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb index 8bc1b5c886..11c36c4a29 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb index 84a6ac0940..7e20d8a8e0 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb index f166014690..c408531cca 100644 --- a/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb +++ b/samples/openapi3/client/features/dynamic-servers/ruby/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb index ac8f867d98..dfeb398643 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb index f5a2172c57..6b74413ec0 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api/usage_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb index c09f358804..650088fca0 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb index 110ca5de7b..7464a5ae6c 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb index 69251a11d2..9a122b5a22 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb index 2550c985ef..ba89078942 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/array_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb index 45f5b3532a..26dd99dc1a 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/models/map_alias.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb index c803b873a0..b2685e70c6 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/lib/petstore/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec index 09ab2855fb..44f179dbf3 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/petstore.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb index 45a8bfe213..e8c82e7bcc 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/api_client_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb index dcc206c518..97934083ee 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/configuration_spec.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb index 64a0a2bc8b..5face65cf2 100644 --- a/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb +++ b/samples/openapi3/client/features/generate-alias-as-model/ruby-client/spec/spec_helper.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech -OpenAPI Generator version: 5.3.1 +OpenAPI Generator version: 5.4.0-SNAPSHOT =end diff --git a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio-next/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/dart2/petstore_client_lib_fake/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/go/go-petstore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8-special-characters/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/java/jersey2-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100755 --- a/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python-legacy/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/python/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/python/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/composed-schemas/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/deno/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/inversify/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/jquery/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/typescript/builds/object_params/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/ktorm/.openapi-generator/VERSION b/samples/schema/petstore/ktorm/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/schema/petstore/ktorm/.openapi-generator/VERSION +++ b/samples/schema/petstore/ktorm/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/mysql/.openapi-generator/VERSION b/samples/schema/petstore/mysql/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/schema/petstore/mysql/.openapi-generator/VERSION +++ b/samples/schema/petstore/mysql/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION +++ b/samples/schema/petstore/wsdl-schema/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-3.1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore-5.0/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/aspnetcore/.openapi-generator/VERSION +++ b/samples/server/petstore/aspnetcore/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-pistache/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION +++ b/samples/server/petstore/cpp-qt-qhttpengine-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/erlang-server/.openapi-generator/VERSION b/samples/server/petstore/erlang-server/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/erlang-server/.openapi-generator/VERSION +++ b/samples/server/petstore/erlang-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/go-chi-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-chi-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/go-echo-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-echo-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-server-required/.openapi-generator/VERSION b/samples/server/petstore/go-server-required/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/go-server-required/.openapi-generator/VERSION +++ b/samples/server/petstore/go-server-required/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/haskell-servant/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-servant/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION +++ b/samples/server/petstore/haskell-yesod/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-msf4j/.openapi-generator/VERSION +++ b/samples/server/petstore/java-msf4j/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-api-package-override/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-controller-only/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-fake-endpoints/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-bean-validation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-exception-handling/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-swagger-ui/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework-no-wrap-calls/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-play-framework/.openapi-generator/VERSION +++ b/samples/server/petstore/java-play-framework/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-undertow/.openapi-generator/VERSION b/samples/server/petstore/java-undertow/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-undertow/.openapi-generator/VERSION +++ b/samples/server/petstore/java-undertow/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION +++ b/samples/server/petstore/java-vertx-web/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-jersey/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/java8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2-useTags/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-server/ktor/README.md b/samples/server/petstore/kotlin-server/ktor/README.md index e47cdeb550..ad9008bc0d 100644 --- a/samples/server/petstore/kotlin-server/ktor/README.md +++ b/samples/server/petstore/kotlin-server/ktor/README.md @@ -2,7 +2,7 @@ This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -Generated by OpenAPI Generator 5.3.1. +Generated by OpenAPI Generator 5.4.0-SNAPSHOT. ## Requires diff --git a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt index bedd82ad84..6ddbe5583e 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt index 8ce2645e4d..8bb9e405c3 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt index bb608e5c66..d1be9a9efe 100644 --- a/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/server/petstore/kotlin-springboot-delegate/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-modelMutable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin/vertx/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-laravel/.openapi-generator/VERSION b/samples/server/petstore/php-laravel/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/php-laravel/.openapi-generator/VERSION +++ b/samples/server/petstore/php-laravel/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-lumen/.openapi-generator/VERSION b/samples/server/petstore/php-lumen/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/php-lumen/.openapi-generator/VERSION +++ b/samples/server/petstore/php-lumen/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph-modern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION +++ b/samples/server/petstore/php-mezzio-ph/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-slim4/.openapi-generator/VERSION b/samples/server/petstore/php-slim4/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/VERSION +++ b/samples/server/petstore/php-slim4/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp-srclayout/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION +++ b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION +++ b/samples/server/petstore/python-blueplanet/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/python-fastapi/.openapi-generator/VERSION +++ b/samples/server/petstore/python-fastapi/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-flask/.openapi-generator/VERSION b/samples/server/petstore/python-flask/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/python-flask/.openapi-generator/VERSION +++ b/samples/server/petstore/python-flask/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/multipart-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/no-example-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/openapi-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ops-v3/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/petstore-with-fake-endpoints-models-for-testing/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/ping-bearer-auth/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION +++ b/samples/server/petstore/rust-server/output/rust-server-test/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-default-value/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java index 1141853467..dfdd5db909 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestHeadersApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java index 81423f590b..264c8c28f6 100644 --- a/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java +++ b/samples/server/petstore/spring-mvc-default-value/src/main/java/org/openapitools/api/TestQueryParamsApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9013faa9cb..3e2889541e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java index 1d0035e021..032d332fcc 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 557a43e1d4..47e953b4e5 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java index 161749430f..e977c20c3b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java index d9c5e3c16e..da11e798ae 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java index a2065f673a..8a2de1ce1d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java index ba64ef3188..c682b121c8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java index 693ce02c51..fe9e7f727b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java index 598ae5ad88..6c4b9866f9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index dfa1803e16..c8793f61e4 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 693ce02c51..fe9e7f727b 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 743aa88a6d..ca77015acb 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index b494e974fe..8d805638e5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index d15f313c4c..a428ea5ba5 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 743aa88a6d..ca77015acb 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/spring-mvc/.openapi-generator/VERSION +++ b/samples/server/petstore/spring-mvc/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java index dfa1803e16..c8793f61e4 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java index 693ce02c51..fe9e7f727b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java index 743aa88a6d..ca77015acb 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 151aa6dc81..9c4ef1f25e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 0c19151a97..e60e016dde 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7f524d7af4..f552024c17 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index 21a559470b..c733126515 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 25b01491b5..ab7fee8340 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index 4cbe795d92..6cfdcf7533 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index dfa1803e16..c8793f61e4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index 693ce02c51..fe9e7f727b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index 743aa88a6d..ca77015acb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 978eee460b..2f58a11f22 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 34e7ffdf2f..82c6778214 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ba5b622efd..88b4da3451 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index 4948412cbf..e57b00ff21 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index 58cf7cd17c..6944e4129d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index b77c5fb5ce..87353cde05 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 978eee460b..2f58a11f22 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 34e7ffdf2f..82c6778214 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ba5b622efd..88b4da3451 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 4948412cbf..e57b00ff21 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 58cf7cd17c..6944e4129d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index b77c5fb5ce..87353cde05 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 3aa0b58d6c..d9f4971622 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index d8109c85a0..19023bdba4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index a6c0dfd6f0..2b8723c03a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 0408708526..06f331738c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 4534ce024d..05e8b7e0dd 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 80c294ca88..694cd412a5 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 81cbd1690c..22b53a2cd1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 7229707921..3165448cc1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2a9ad13847..3db3fcc191 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 85222405a9..d06e0ed2db 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index 3443339b88..94ff763fd3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 7eb94eb0b3..62e19d84e4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 151aa6dc81..9c4ef1f25e 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 3cc9777cab..72b0473bb9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7f524d7af4..f552024c17 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index 41b8fce914..3407bc13ba 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 25b01491b5..ab7fee8340 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 4cbe795d92..6cfdcf7533 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index 978eee460b..2f58a11f22 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 5e5c3fc8c9..c090ac7835 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index ba5b622efd..88b4da3451 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index ce9171bef3..0a6cbef023 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index 58cf7cd17c..6944e4129d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index b77c5fb5ce..87353cde05 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 151aa6dc81..9c4ef1f25e 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 3cc9777cab..72b0473bb9 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7f524d7af4..f552024c17 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index 41b8fce914..3407bc13ba 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 25b01491b5..ab7fee8340 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 4cbe795d92..6cfdcf7533 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-spring-pageable/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index b494e974fe..8d805638e5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index d15f313c4c..a428ea5ba5 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 743aa88a6d..ca77015acb 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index bcfd41bee1..0b1b0c6e1f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index 027746a2e5..e2103efefa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index 743aa88a6d..ca77015acb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 575fd8a2ae..f5194da526 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index a85c742451..fa2be27a1e 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 7b1b825d38..65093bda6d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 28c60937d7..9fe808d5ec 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index d20e937d03..4e0dbf7898 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index c6f02bef5d..d7d04f53f3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/.openapi-generator/VERSION b/samples/server/petstore/springboot/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/server/petstore/springboot/.openapi-generator/VERSION +++ b/samples/server/petstore/springboot/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 57e6c1d106..e11603b847 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index dfa1803e16..c8793f61e4 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 8b45339424..3147f4bba9 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 693ce02c51..fe9e7f727b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index d3a44c4e9c..4ab75d5cfa 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 743aa88a6d..ca77015acb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.3.1). + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (5.4.0-SNAPSHOT). * https://openapi-generator.tech * Do not edit the class manually. */ From aa61220db2a59d7b1178a6619bcba56165da9262 Mon Sep 17 00:00:00 2001 From: Yuriy Belenko Date: Wed, 29 Dec 2021 05:57:19 +0300 Subject: [PATCH 48/54] [php-slim4] Add dependency injection container 2 (#11159) * Change packages order alphabetically * Add PHP-DI package to Composer template * Remove ContainerInterface from APIs User shouldn't access container directly, it's an anti-pattern. Ref: https://php-di.org/doc/best-practices.html#rules-for-using-a-container-and-dependency-injection * Change app templates to use PHP-DI Application looks more like a default Slim skeleton now. Ref: https://github.com/slimphp/Slim-Skeleton * Rename SlimRouter to RegisterRoutes Since it's callable class new name fits better. * Add short documentation * Refresh samples --- .../languages/PhpSlim4ServerCodegen.java | 17 +- .../main/resources/php-slim4-server/.htaccess | 4 + .../php-slim4-server/README.mustache | 40 +-- .../php-slim4-server/SlimRouter.mustache | 331 ------------------ .../abstract_authenticator.mustache | 13 +- .../resources/php-slim4-server/api.mustache | 45 +-- .../php-slim4-server/composer.mustache | 29 +- .../config_dev_default.mustache | 35 ++ .../php-slim4-server/config_example.mustache | 83 ----- .../config_prod_default.mustache | 35 ++ .../main/resources/php-slim4-server/gitignore | 4 +- .../resources/php-slim4-server/index.mustache | 89 +++-- .../register_dependencies.mustache | 58 +++ .../register_middlewares.mustache | 51 +++ .../php-slim4-server/register_routes.mustache | 137 ++++++++ samples/server/petstore/php-slim4/.gitignore | 4 +- .../php-slim4/.openapi-generator/FILES | 8 +- samples/server/petstore/php-slim4/README.md | 40 +-- .../server/petstore/php-slim4/composer.json | 11 +- .../php-slim4/config/dev/default.inc.php | 35 ++ .../php-slim4/config/dev/example.inc.php | 96 ----- .../php-slim4/config/prod/default.inc.php | 35 ++ .../php-slim4/config/prod/example.inc.php | 96 ----- .../php-slim4/lib/Api/AbstractPetApi.php | 88 +++-- .../php-slim4/lib/Api/AbstractStoreApi.php | 54 ++- .../php-slim4/lib/Api/AbstractUserApi.php | 85 +++-- .../lib/App/RegisterDependencies.php | 71 ++++ .../php-slim4/lib/App/RegisterMiddlewares.php | 64 ++++ .../RegisterRoutes.php} | 204 +---------- .../lib/Auth/AbstractAuthenticator.php | 13 +- .../petstore/php-slim4/public/.htaccess | 4 + .../petstore/php-slim4/public/index.php | 89 +++-- 32 files changed, 862 insertions(+), 1106 deletions(-) delete mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/config_dev_default.mustache delete mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/config_example.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/config_prod_default.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/register_dependencies.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/register_middlewares.mustache create mode 100644 modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache create mode 100644 samples/server/petstore/php-slim4/config/dev/default.inc.php delete mode 100644 samples/server/petstore/php-slim4/config/dev/example.inc.php create mode 100644 samples/server/petstore/php-slim4/config/prod/default.inc.php delete mode 100644 samples/server/petstore/php-slim4/config/prod/example.inc.php create mode 100644 samples/server/petstore/php-slim4/lib/App/RegisterDependencies.php create mode 100644 samples/server/petstore/php-slim4/lib/App/RegisterMiddlewares.php rename samples/server/petstore/php-slim4/lib/{SlimRouter.php => App/RegisterRoutes.php} (75%) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java index 7e318dee20..dc6fefcee7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PhpSlim4ServerCodegen.java @@ -50,6 +50,8 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { protected String artifactId = "openapi-server"; protected String authDirName = "Auth"; protected String authPackage = ""; + protected String appDirName = "App"; + protected String appPackage = ""; protected String psr7Implementation = "slim-psr7"; protected String interfacesDirName = "Interfaces"; protected String interfacesPackage = ""; @@ -92,6 +94,7 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { modelPackage = invokerPackage + "\\" + modelDirName; authPackage = invokerPackage + "\\" + authDirName; interfacesPackage = invokerPackage + "\\" + interfacesDirName; + appPackage = invokerPackage + "\\" + appDirName; outputFolder = "generated-code" + File.separator + "slim4"; modelTestTemplateFiles.put("model_test.mustache", ".php"); @@ -167,6 +170,8 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { authPackage = invokerPackage + "\\" + authDirName; // Update interfacesPackage interfacesPackage = invokerPackage + "\\" + interfacesDirName; + // update appPackage + appPackage = invokerPackage + "\\" + appDirName; } // make auth src path available in mustache template @@ -178,6 +183,10 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { additionalProperties.put("interfacesSrcPath", "./" + toSrcPath(interfacesPackage, srcBasePath)); additionalProperties.put("interfacesTestPath", "./" + toSrcPath(interfacesPackage, testBasePath)); + // same for app classes + additionalProperties.put("appPackage", appPackage); + additionalProperties.put("appSrcPath", "./" + toSrcPath(appPackage, srcBasePath)); + if (additionalProperties.containsKey(PSR7_IMPLEMENTATION)) { this.setPsr7Implementation((String) additionalProperties.get(PSR7_IMPLEMENTATION)); } @@ -213,7 +222,9 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { supportingFiles.add(new SupportingFile("composer.mustache", "", "composer.json")); supportingFiles.add(new SupportingFile("index.mustache", "public", "index.php")); supportingFiles.add(new SupportingFile(".htaccess", "public", ".htaccess")); - supportingFiles.add(new SupportingFile("SlimRouter.mustache", toSrcPath(invokerPackage, srcBasePath), "SlimRouter.php")); + supportingFiles.add(new SupportingFile("register_dependencies.mustache", toSrcPath(appPackage, srcBasePath), "RegisterDependencies.php")); + supportingFiles.add(new SupportingFile("register_middlewares.mustache", toSrcPath(appPackage, srcBasePath), "RegisterMiddlewares.php")); + supportingFiles.add(new SupportingFile("register_routes.mustache", toSrcPath(appPackage, srcBasePath), "RegisterRoutes.php")); // don't generate phpunit config when tests generation disabled if (Boolean.TRUE.equals(generateApiTests) || Boolean.TRUE.equals(generateModelTests)) { @@ -224,8 +235,8 @@ public class PhpSlim4ServerCodegen extends AbstractPhpCodegen { supportingFiles.add(new SupportingFile("phpcs.xml.mustache", "", "phpcs.xml.dist")); supportingFiles.add(new SupportingFile("htaccess_deny_all", "config", ".htaccess")); - supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "dev", "example.inc.php")); - supportingFiles.add(new SupportingFile("config_example.mustache", "config" + File.separator + "prod", "example.inc.php")); + supportingFiles.add(new SupportingFile("config_dev_default.mustache", "config" + File.separator + "dev", "default.inc.php")); + supportingFiles.add(new SupportingFile("config_prod_default.mustache", "config" + File.separator + "prod", "default.inc.php")); if (Boolean.TRUE.equals(generateModels)) { supportingFiles.add(new SupportingFile("base_model.mustache", toSrcPath(invokerPackage, srcBasePath), "BaseModel.php")); diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/.htaccess b/modules/openapi-generator/src/main/resources/php-slim4-server/.htaccess index f6a2ceb395..57c2185f0e 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/.htaccess +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/.htaccess @@ -1,3 +1,7 @@ + + SetEnv APP_ENV 'production' + + RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache index d85b12e3bd..dcd7193012 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/README.mustache @@ -15,6 +15,7 @@ This server has been generated with [Guzzle PSR-7](https://github.com/guzzle/psr {{#isZendDiactoros}} This server has been generated with [Laminas (Zend) PSR-7 implementation](https://github.com/laminas/laminas-diactoros). {{/isZendDiactoros}} +[PHP-DI](https://php-di.org/doc/frameworks/slim.html) package used as dependency container. ## Requirements @@ -34,7 +35,10 @@ $ composer install ## Add configs -Application requires at least one config file(`config/dev/config.inc.php` or `config/prod/config.inc.php`). You can use [config/dev/example.inc.php](config/dev/example.inc.php) as starting point. +[PHP-DI package](https://php-di.org/doc/getting-started.html) helps to decouple configuration from implementation. App loads configuration files in straight order(`$env` can be `prod` or `dev`): +1. `config/$env/default.inc.php` (contains safe values, can be committed to vcs) +2. `config/$env/config.inc.php` (user config, excluded from vcs, can contain sensitive values, passwords etc.) +3. `lib/App/RegisterDependencies.php` ## Start devserver @@ -103,25 +107,14 @@ $ composer phplint ## Show errors -Switch on option in your application config file like: -```diff - return [ - 'slimSettings' => [ -- 'displayErrorDetails' => false, -+ 'displayErrorDetails' => true, - 'logErrors' => true, - 'logErrorDetails' => true, - ], +Switch your app environment to development in `public/.htaccess` file: +```ini +## .htaccess + + SetEnv APP_ENV 'development' + ``` -## Mock Server -For a quick start uncomment [mocker middleware options](config/dev/example.inc.php#L67-L94) in your application config file. - -Used packages: -* [Openapi Data Mocker](https://github.com/ybelenko/openapi-data-mocker) - first implementation of OAS3 fake data generator. -* [Openapi Data Mocker Server Middleware](https://github.com/ybelenko/openapi-data-mocker-server-middleware) - PSR-15 HTTP server middleware. -* [Openapi Data Mocker Interfaces](https://github.com/ybelenko/openapi-data-mocker-interfaces) - package with mocking interfaces. - {{#generateApiDocs}} ## API Endpoints @@ -135,17 +128,22 @@ All URIs are relative to *{{{basePath}}}* namespace {{apiPackage}}; use {{apiPackage}}\AbstractPetApi; +use Psr\Http\Message\ServerRequestInterface; +use Psr\Http\Message\ResponseInterface; class PetApi extends AbstractPetApi { - - public function addPet($request, $response, $args) - { + public function addPet( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { // your implementation of addPet method here } } ``` +When you need to inject dependencies into API controller check [PHP-DI - Controllers as services](https://github.com/PHP-DI/Slim-Bridge#controllers-as-services) guide. + Place all your implementation classes in `./src` folder accordingly. For instance, when abstract class located at `./lib/Api/AbstractPetApi.php` you need to create implementation class at `./src/Api/PetApi.php`. diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache deleted file mode 100644 index ded9ca8cfa..0000000000 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/SlimRouter.mustache +++ /dev/null @@ -1,331 +0,0 @@ -licenseInfo}} - -/** - * NOTE: This class is auto generated by the openapi generator program. - * https://github.com/openapitools/openapi-generator - * Do not edit the class manually. - */{{#apiInfo}} -namespace {{invokerPackage}}; - -use Slim\Factory\AppFactory; -use Slim\Interfaces\RouteInterface; -use Slim\Exception\HttpNotImplementedException; -use Psr\Container\ContainerInterface; -use InvalidArgumentException; -use Dyorg\TokenAuthentication; -use Dyorg\TokenAuthentication\TokenSearch; -use Psr\Http\Message\ServerRequestInterface; -use OpenAPIServer\Mock\OpenApiDataMocker; -use OpenAPIServer\Mock\OpenApiDataMockerRouteMiddleware; -{{#isSlimPsr7}} -use Slim\Psr7\Factory\ResponseFactory; -{{/isSlimPsr7}} -{{#isNyholmPsr7}} -use Nyholm\Psr7\Factory\Psr17Factory -{{/isNyholmPsr7}} -{{#isGuzzlePsr7}} -use GuzzleHttp\Psr7\HttpFactory; -{{/isGuzzlePsr7}} -{{#isZendDiactoros}} -use Zend\Diactoros\ResponseFactory; -{{/isZendDiactoros}} -use Exception; - -/** - * SlimRouter Class Doc Comment - * - * @package {{invokerPackage}} - * @author OpenAPI Generator team - * @link https://github.com/openapitools/openapi-generator - */ -class SlimRouter -{ - - /** @var App instance */ - private $slimApp; - - /** @var array[] list of all api operations */ - private $operations = [ - {{#apis}} - {{#operations}} - {{#operation}} - [ - 'httpMethod' => '{{httpMethod}}', - 'basePathWithoutHost' => '{{{basePathWithoutHost}}}', - 'path' => '{{{path}}}', - 'apiPackage' => '{{apiPackage}}', - 'classname' => '{{classname}}', - 'userClassname' => '{{userClassname}}', - 'operationId' => '{{operationId}}', - 'responses' => [ - {{#responses}} - '{{#isDefault}}default{{/isDefault}}{{^isDefault}}{{code}}{{/isDefault}}' => [ - 'jsonSchema' => '{{{jsonSchema}}}', - ], - {{/responses}} - ], - 'authMethods' => [ - {{#hasAuthMethods}} - {{#authMethods}} - // {{type}} security schema named '{{name}}' - {{#isBasicBasic}} - [ - 'type' => '{{type}}', - 'isBasic' => true, - 'isBearer' => false, - 'isApiKey' => false, - 'isOAuth' => false, - ], - {{/isBasicBasic}} - {{#isBasicBearer}} - [ - 'type' => '{{type}}', - 'isBasic' => true, - 'isBearer' => true, - 'isApiKey' => false, - 'isOAuth' => false, - ], - {{/isBasicBearer}} - {{#isApiKey}} - [ - 'type' => '{{type}}', - 'isBasic' => false, - 'isBearer' => false, - 'isApiKey' => true, - 'isOAuth' => false, - 'keyParamName' => '{{keyParamName}}', - 'isKeyInHeader' => {{#isKeyInHeader}}true{{/isKeyInHeader}}{{^isKeyInHeader}}false{{/isKeyInHeader}}, - 'isKeyInQuery' => {{#isKeyInQuery}}true{{/isKeyInQuery}}{{^isKeyInQuery}}false{{/isKeyInQuery}}, - 'isKeyInCookie' => {{#isKeyInCookie}}true{{/isKeyInCookie}}{{^isKeyInCookie}}false{{/isKeyInCookie}}, - ], - {{/isApiKey}} - {{#isOAuth}} - [ - 'type' => '{{type}}', - 'isBasic' => false, - 'isBearer' => false, - 'isApiKey' => false, - 'isOAuth' => true, - 'scopes' => [ - {{#scopes}} - '{{scope}}',{{#description}} // {{.}}{{/description}} - {{/scopes}} - ], - ], - {{/isOAuth}} - {{/authMethods}} - {{/hasAuthMethods}} - ], - ], - {{/operation}} - {{/operations}} - {{/apis}} - ]; - - /** - * Class constructor - * - * @param ContainerInterface|array $settings Either a ContainerInterface or an associative array of app settings - * - * @throws HttpNotImplementedException When implementation class doesn't exists - * @throws Exception when not supported authorization schema type provided - */ - public function __construct($settings = []) - { - if ($settings instanceof ContainerInterface) { - // Set container to create App with on AppFactory - AppFactory::setContainer($settings); - } - $this->slimApp = AppFactory::create(); - - // middlewares requires Psr\Container\ContainerInterface - $container = $this->slimApp->getContainer(); - - {{#hasAuthMethods}} - $authPackage = '{{authPackage}}'; - $basicAuthenticator = function (ServerRequestInterface &$request, TokenSearch $tokenSearch) use ($authPackage) { - $message = "How about extending {{abstractNamePrefix}}Authenticator{{abstractNameSuffix}} class by {$authPackage}\BasicAuthenticator?"; - throw new HttpNotImplementedException($request, $message); - }; - $apiKeyAuthenticator = function (ServerRequestInterface &$request, TokenSearch $tokenSearch) use ($authPackage) { - $message = "How about extending {{abstractNamePrefix}}Authenticator{{abstractNameSuffix}} class by {$authPackage}\ApiKeyAuthenticator?"; - throw new HttpNotImplementedException($request, $message); - }; - $oAuthAuthenticator = function (ServerRequestInterface &$request, TokenSearch $tokenSearch) use ($authPackage) { - $message = "How about extending {{abstractNamePrefix}}Authenticator{{abstractNameSuffix}} class by {$authPackage}\OAuthAuthenticator?"; - throw new HttpNotImplementedException($request, $message); - }; - {{/hasAuthMethods}} - - $userOptions = $this->getSetting($settings, 'tokenAuthenticationOptions', null); - - // mocker options - $mockerOptions = $this->getSetting($settings, 'mockerOptions', null); - $dataMocker = $mockerOptions['dataMocker'] ?? new OpenApiDataMocker(); - {{#isSlimPsr7}} - $responseFactory = new ResponseFactory(); - {{/isSlimPsr7}} - {{#isNyholmPsr7}} - $responseFactory = new Psr17Factory(); - {{/isNyholmPsr7}} - {{#isGuzzlePsr7}} - $responseFactory = new HttpFactory(); - {{/isGuzzlePsr7}} - {{#isZendDiactoros}} - $responseFactory = new ResponseFactory(); - {{/isZendDiactoros}} - $getMockStatusCodeCallback = $mockerOptions['getMockStatusCodeCallback'] ?? null; - $mockAfterCallback = $mockerOptions['afterCallback'] ?? null; - - foreach ($this->operations as $operation) { - $callback = function ($request, $response, $arguments) use ($operation) { - $message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?"; - throw new HttpNotImplementedException($request, $message); - }; - $middlewares = []; - - if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) { - $callback = "\\{$operation['apiPackage']}\\{$operation['userClassname']}:{$operation['operationId']}"; - } - - {{#hasAuthMethods}} - foreach ($operation['authMethods'] as $authMethod) { - switch ($authMethod['type']) { - case 'http': - $authenticatorClassname = "\\{$authPackage}\\BasicAuthenticator"; - if (class_exists($authenticatorClassname)) { - $basicAuthenticator = new $authenticatorClassname($container); - } - - $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ - 'authenticator' => $basicAuthenticator, - 'regex' => $authMethod['isBearer'] ? '/Bearer\s+(.*)$/i' : '/Basic\s+(.*)$/i', - 'header' => 'Authorization', - 'parameter' => null, - 'cookie' => null, - 'argument' => null, - ], $userOptions)); - break; - case 'apiKey': - $authenticatorClassname = "\\{$authPackage}\\ApiKeyAuthenticator"; - if (class_exists($authenticatorClassname)) { - $apiKeyAuthenticator = new $authenticatorClassname($container); - } - - $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ - 'authenticator' => $apiKeyAuthenticator, - 'regex' => '/^(.*)$/i', - 'header' => $authMethod['isKeyInHeader'] ? $authMethod['keyParamName'] : null, - 'parameter' => $authMethod['isKeyInQuery'] ? $authMethod['keyParamName'] : null, - 'cookie' => $authMethod['isKeyInCookie'] ? $authMethod['keyParamName'] : null, - 'argument' => null, - ], $userOptions)); - break; - case 'oauth2': - $authenticatorClassname = "\\{$authPackage}\\OAuthAuthenticator"; - if (class_exists($authenticatorClassname)) { - $oAuthAuthenticator = new $authenticatorClassname($container, $authMethod['scopes']); - } - - $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ - 'authenticator' => $oAuthAuthenticator, - 'regex' => '/Bearer\s+(.*)$/i', - 'header' => 'Authorization', - 'parameter' => null, - 'cookie' => null, - 'argument' => null, - ], $userOptions)); - break; - default: - throw new Exception('Unknown authorization schema type'); - } - } - {{/hasAuthMethods}} - - if (is_callable($getMockStatusCodeCallback)) { - $mockSchemaResponses = array_map(function ($item) { - return json_decode($item['jsonSchema'], true); - }, $operation['responses']); - $middlewares[] = new OpenApiDataMockerRouteMiddleware($dataMocker, $mockSchemaResponses, $responseFactory, $getMockStatusCodeCallback, $mockAfterCallback); - } - - $this->addRoute( - [$operation['httpMethod']], - "{$operation['basePathWithoutHost']}{$operation['path']}", - $callback, - $middlewares - )->setName($operation['operationId']); - } - } - - /** - * Merges user defined options with dynamic params - * - * @param array $staticOptions Required static options - * @param array $userOptions User options - * - * @return array Merged array - */ - private function getTokenAuthenticationOptions(array $staticOptions, array $userOptions = null) - { - if (is_array($userOptions) === false) { - return $staticOptions; - } - - return array_merge($userOptions, $staticOptions); - } - - /** - * Returns app setting by name. - * - * @param ContainerInterface|array $settings Either a ContainerInterface or an associative array of app settings - * @param string $settingName Setting name - * @param mixed $default Default setting value. - * - * @return mixed - */ - private function getSetting($settings, $settingName, $default = null) - { - if ($settings instanceof ContainerInterface && $settings->has($settingName)) { - return $settings->get($settingName); - } elseif (is_array($settings) && array_key_exists($settingName, $settings)) { - return $settings[$settingName]; - } - - return $default; - } - - /** - * Add route with multiple methods - * - * @param string[] $methods Numeric array of HTTP method names - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * @param array|null $middlewares List of middlewares - * - * @return RouteInterface - * - * @throws InvalidArgumentException If the route pattern isn't a string - */ - public function addRoute(array $methods, string $pattern, $callable, $middlewares = []) - { - $route = $this->slimApp->map($methods, $pattern, $callable); - foreach ($middlewares as $middleware) { - $route->add($middleware); - } - return $route; - } - - /** - * Returns Slim Framework instance - * - * @return App - */ - public function getSlimApp() - { - return $this->slimApp; - } -} -{{/apiInfo}} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/abstract_authenticator.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/abstract_authenticator.mustache index 82fd8f648e..3aef910d9f 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/abstract_authenticator.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/abstract_authenticator.mustache @@ -9,7 +9,6 @@ */{{#apiInfo}} namespace {{authPackage}}; -use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Dyorg\TokenAuthentication; use Dyorg\TokenAuthentication\TokenSearch; @@ -24,12 +23,6 @@ use Dyorg\TokenAuthentication\Exceptions\UnauthorizedExceptionInterface; */ abstract class {{abstractNamePrefix}}Authenticator{{abstractNameSuffix}} { - - /** - * @var ContainerInterface|null Slim app container instance - */ - protected $container; - /** * @var string[]|null List of required scopes */ @@ -49,12 +42,10 @@ abstract class {{abstractNamePrefix}}Authenticator{{abstractNameSuffix}} /** * Authenticator constructor * - * @param ContainerInterface|null $container Slim app container instance - * @param string[]|null $requiredScope List of required scopes + * @param string[]|null $requiredScope List of required scopes */ - public function __construct(ContainerInterface $container = null, $requiredScope = null) + public function __construct($requiredScope = null) { - $this->container = $container; $this->requiredScope = $requiredScope; } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/api.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/api.mustache index f76f11f29a..83de70ff5c 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/api.mustache @@ -6,10 +6,11 @@ * NOTE: This class is auto generated by the openapi generator program. * https://github.com/openapitools/openapi-generator * Do not edit the class manually. + * Extend this class with your controller. You can inject dependencies via class constructor, + * @see https://github.com/PHP-DI/Slim-Bridge basic example. */ namespace {{apiPackage}}; -use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; use Slim\Exception\HttpNotImplementedException; @@ -23,25 +24,8 @@ use Slim\Exception\HttpNotImplementedException; */ abstract class {{classname}} { - - /** - * @var ContainerInterface|null Slim app container instance - */ - protected $container; - - /** - * Route Controller constructor receives container - * - * @param ContainerInterface|null $container Slim app container instance - */ - public function __construct(ContainerInterface $container = null) - { - $this->container = $container; - } - {{#operations}} {{#operation}} - /** * {{httpMethod}} {{operationId}} {{#summary}} @@ -56,7 +40,11 @@ abstract class {{classname}} * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + {{#hasPathParams}} + {{#pathParams}} + * @param {{{dataType}}} ${{paramName}}{{#description}} {{.}}{{/description}}{{^description}} {{paramName}}{{/description}} + {{/pathParams}} + {{/hasPathParams}} * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method @@ -64,19 +52,21 @@ abstract class {{classname}} * @deprecated {{/isDeprecated}} */ - public function {{operationId}}(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function {{operationId}}( + ServerRequestInterface $request, + ResponseInterface $response{{#hasPathParams}},{{/hasPathParams}} + {{#hasPathParams}} + {{#pathParams}} + {{{dataType}}} ${{paramName}}{{^-last}},{{/-last}} + {{/pathParams}} + {{/hasPathParams}} + ): ResponseInterface { {{#hasHeaderParams}} $headers = $request->getHeaders(); {{#headerParams}} ${{paramName}} = $request->hasHeader('{{baseName}}') ? $headers['{{baseName}}'] : null; {{/headerParams}} {{/hasHeaderParams}} - {{#hasPathParams}} - {{#pathParams}} - ${{paramName}} = $args['{{baseName}}']; - {{/pathParams}} - {{/hasPathParams}} {{#hasQueryParams}} $queryParams = $request->getQueryParams(); {{#queryParams}} @@ -105,6 +95,9 @@ abstract class {{classname}} $message = "How about implementing {{nickname}} as a {{httpMethod}} method in {{apiPackage}}\{{userClassname}} class?"; throw new HttpNotImplementedException($request, $message); } + {{^-last}} + + {{/-last}} {{/operation}} {{/operations}} } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache index e514b055f5..6d8d0bcbac 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/composer.mustache @@ -9,30 +9,30 @@ ], "require": { "php": "^7.4 || ^8.0", - "slim/slim": "^4.5.0", "dyorg/slim-token-authentication": "dev-slim4", - "ybelenko/openapi-data-mocker": "^1.0", - "ybelenko/openapi-data-mocker-server-middleware": "^1.0", - {{#isSlimPsr7}} - "slim/psr7": "^1.1.0" - {{/isSlimPsr7}} - {{#isNyholmPsr7}} - "nyholm/psr7": "^1.3.0", - "nyholm/psr7-server": "^0.4.1" - {{/isNyholmPsr7}} {{#isGuzzlePsr7}} "guzzlehttp/psr7": "^1.6.1", - "http-interop/http-factory-guzzle": "^1.0.0" + "http-interop/http-factory-guzzle": "^1.0.0", {{/isGuzzlePsr7}} {{#isZendDiactoros}} - "laminas/laminas-diactoros": "^2.3.0" + "laminas/laminas-diactoros": "^2.3.0", {{/isZendDiactoros}} + {{#isNyholmPsr7}} + "nyholm/psr7": "^1.3.0", + "nyholm/psr7-server": "^0.4.1", + {{/isNyholmPsr7}} + "php-di/slim-bridge": "^3.2", + {{#isSlimPsr7}} + "slim/psr7": "^1.1.0", + {{/isSlimPsr7}} + "ybelenko/openapi-data-mocker": "^1.0", + "ybelenko/openapi-data-mocker-server-middleware": "^1.0" }, "require-dev": { + "overtrue/phplint": "^2.0.2", {{#generateTests}} "phpunit/phpunit": "^8.0 || ^9.0", {{/generateTests}} - "overtrue/phplint": "^2.0.2", "squizlabs/php_codesniffer": "^3.5" }, "autoload": { @@ -58,5 +58,8 @@ {{/generateTests}} "phpcs": "phpcs", "phplint": "phplint ./ --exclude=vendor" + }, + "config": { + "sort-packages": true } } diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/config_dev_default.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/config_dev_default.mustache new file mode 100644 index 0000000000..4258805216 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/config_dev_default.mustache @@ -0,0 +1,35 @@ + 'development', + + // slim framework settings + 'slim.displayErrorDetails' => true, + 'slim.logErrors' => false, + 'slim.logErrorDetails' => false, + + // PDO + 'pdo.dsn' => 'mysql:host=localhost;charset=utf8mb4', + 'pdo.username' => 'root', + 'pdo.password' => 'root', + 'pdo.options' => [ + \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, + ], +]; diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/config_example.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/config_example.mustache deleted file mode 100644 index 52755f2538..0000000000 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/config_example.mustache +++ /dev/null @@ -1,83 +0,0 @@ -licenseInfo}} - -/** - * App configuration file example. - * - * Copy file to config/dev/config.inc.php and config/prod/config.inc.php - * App loads dev config only when prod doesn't exist - * in other words if both configs presented - prod config applies - */ - -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Message\ResponseInterface; -use OpenAPIServer\Mock\OpenApiDataMocker; - -$mocker = new OpenApiDataMocker(); -$mocker->setModelsNamespace('{{modelPackage}}\\'); - -return [ - 'slimSettings' => [ - 'displayErrorDetails' => false, - 'logErrors' => true, - 'logErrorDetails' => true, - ], - - 'tokenAuthenticationOptions' => [ - /** - * Tokens are essentially passwords. You should treat them as such and you should always - * use HTTPS. If the middleware detects insecure usage over HTTP it will return unauthorized - * with a message Required HTTPS for token authentication. This rule is relaxed for requests - * on localhost. To allow insecure usage you must enable it manually by setting secure to - * false. - * Default: true - */ - // 'secure' => true, - - /** - * Alternatively you can list your development host to have relaxed security. - * Default: ['localhost', '127.0.0.1'] - */ - // 'relaxed' => ['localhost', '127.0.0.1'], - - /** - * By default on occurred a fail on authentication, is sent a response on json format with a - * message (`Invalid Token` or `Not found Token`) and with the token (if found), with status - * `401 Unauthorized`. You can customize it by setting a callable function on error option. - * Default: null - */ - // 'error' => null, - ], - - 'mockerOptions' => [ - // 'dataMocker' => $mocker, - - // 'getMockStatusCodeCallback' => function (ServerRequestInterface $request, array $responses) { - // // check if client clearly asks for mocked response - // $pingHeader = 'X-{{invokerPackage}}-Mock'; - // $pingHeaderCode = 'X-{{invokerPackage}}-Mock-Code'; - // if ( - // $request->hasHeader($pingHeader) - // && $request->getHeader($pingHeader)[0] === 'ping' - // ) { - // $responses = (array) $responses; - // $requestedResponseCode = ($request->hasHeader($pingHeaderCode)) ? $request->getHeader($pingHeaderCode)[0] : 'default'; - // if (array_key_exists($requestedResponseCode, $responses)) { - // return $requestedResponseCode; - // } - - // // return first response key - // reset($responses); - // return key($responses); - // } - - // return false; - // }, - - // 'afterCallback' => function (ServerRequestInterface $request, ResponseInterface $response) { - // // mark mocked response to distinguish real and fake responses - // return $response->withHeader('X-{{invokerPackage}}-Mock', 'pong'); - // }, - ], -]; diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/config_prod_default.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/config_prod_default.mustache new file mode 100644 index 0000000000..d6853fbcf5 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/config_prod_default.mustache @@ -0,0 +1,35 @@ + 'production', + + // slim framework settings + 'slim.displayErrorDetails' => false, + 'slim.logErrors' => true, + 'slim.logErrorDetails' => true, + + // PDO + 'pdo.dsn' => 'mysql:host=localhost;charset=utf8mb4', + 'pdo.username' => 'root', + 'pdo.password' => 'root', + 'pdo.options' => [ + \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, + ], +]; diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/gitignore b/modules/openapi-generator/src/main/resources/php-slim4-server/gitignore index e12b356ade..27433d9094 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/gitignore +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/gitignore @@ -20,5 +20,5 @@ composer.phar # Application config may contain sensitive data /config/**/*.* !/config/.htaccess -!/config/dev/example.inc.php -!/config/prod/example.inc.php +!/config/dev/default.inc.php +!/config/prod/default.inc.php diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache index 305f7cf8b5..ead7d817f8 100644 --- a/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/index.mustache @@ -9,49 +9,64 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use {{invokerPackage}}\SlimRouter; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Message\ResponseInterface; -use OpenAPIServer\Mock\OpenApiDataMocker; +use DI\Bridge\Slim\Bridge; +use DI\ContainerBuilder; +use {{appPackage}}\RegisterDependencies; +use {{appPackage}}\RegisterRoutes; +use {{appPackage}}\RegisterMiddlewares; +use Slim\Factory\ServerRequestCreatorFactory; +use Slim\ResponseEmitter; {{/apiInfo}} -// load config file -$config = []; -if (is_array($prodConfig = @include(__DIR__ . '/../config/prod/config.inc.php'))) { - $config = $prodConfig; -} elseif (is_array($devConfig = @include(__DIR__ . '/../config/dev/config.inc.php'))) { - $config = $devConfig; -} else { - throw new InvalidArgumentException('Config file missed or broken.'); +// Instantiate PHP-DI ContainerBuilder +$builder = new ContainerBuilder(); + +// consider prod by default +$env; +switch (strtolower($_SERVER['APP_ENV'] ?? 'prod')) { + case 'development': + case 'dev': + $env = 'dev'; + break; + case 'production': + case 'prod': + default: + $env = 'prod'; } -$router = new SlimRouter($config); -$app = $router->getSlimApp(); +// Main configuration +$builder->addDefinitions(__DIR__ . "/../config/{$env}/default.inc.php"); -// Parse json, form data and xml -$app->addBodyParsingMiddleware(); +// Config file for the environment if exists +$userConfig = __DIR__ . "/../config/{$env}/config.inc.php"; +if (file_exists($userConfig)) { + $builder->addDefinitions($userConfig); +} -/** - * The routing middleware should be added before the ErrorMiddleware - * Otherwise exceptions thrown from it will not be handled - */ -$app->addRoutingMiddleware(); +// Set up dependencies +$dependencies = new RegisterDependencies(); +$dependencies($builder); -/** - * Add Error Handling Middleware - * - * @param bool $displayErrorDetails -> Should be set to false in production - * @param bool $logErrors -> Parameter is passed to the default ErrorHandler - * @param bool $logErrorDetails -> Display error details in error log - * which can be replaced by a callable of your choice. +// Build PHP-DI Container instance +$container = $builder->build(); - * Note: This middleware should be added last. It will not handle any exceptions/errors - * for middleware added after it. - */ -$app->addErrorMiddleware( - $config['slimSettings']['displayErrorDetails'] ?? false, - $config['slimSettings']['logErrors'] ?? true, - $config['slimSettings']['logErrorDetails'] ?? true -); +// Instantiate the app +$app = Bridge::create($container); -$app->run(); +// Register middleware +$middleware = new RegisterMiddlewares(); +$middleware($app); + +// Register routes +// yes, it's anti-pattern you shouldn't get deps from container directly +$routes = $container->get(RegisterRoutes::class); +$routes($app); + +// Create Request object from globals +$serverRequestCreator = ServerRequestCreatorFactory::create(); +$request = $serverRequestCreator->createServerRequestFromGlobals(); + +// Run App & Emit Response +$response = $app->handle($request); +$responseEmitter = new ResponseEmitter(); +$responseEmitter->emit($response); diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/register_dependencies.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/register_dependencies.mustache new file mode 100644 index 0000000000..0f48fb9de1 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/register_dependencies.mustache @@ -0,0 +1,58 @@ +licenseInfo}} + +declare(strict_types=1); + +/** + * NOTE: This class is auto generated by the openapi generator program. + * https://github.com/openapitools/openapi-generator + * Do not edit the class manually. + */ +namespace {{appPackage}}; + +/** + * RegisterDependencies + * + * Recommendations from template creator: + * + * I don't use imports(eg. use Slim\Middleware\ErrorMiddleware) here because each package unlikely + * be used in code twice. It helps to keep that file short and make Git history cleaner. + * + * This class declared as final because two classes with dependency injections can cause confusion. Edit + * template of this class or use your own implementation instead(overwrite index.php to import your + * custom class). + */ +final class RegisterDependencies +{ + /** + * Adds dependency definitions. + * + * @param \DI\ContainerBuilder $containerBuilder Container builder. + * + * @see https://php-di.org/doc/php-definitions.html + */ + public function __invoke(\DI\ContainerBuilder $containerBuilder): void + { + $containerBuilder->addDefinitions([ + // Response factory required as typed argument in next ErrorMiddleware injection + \Psr\Http\Message\ResponseFactoryInterface::class => \DI\factory([\Slim\Factory\AppFactory::class, 'determineResponseFactory']), + + // Slim error middleware + // @see https://www.slimframework.com/docs/v4/middleware/error-handling.html + \Slim\Middleware\ErrorMiddleware::class => \DI\autowire() + ->constructorParameter('displayErrorDetails', \DI\get('slim.displayErrorDetails', false)) + ->constructorParameter('logErrors', \DI\get('slim.logErrors', true)) + ->constructorParameter('logErrorDetails', \DI\get('slim.logErrorDetails', true)), + + // PDO class for database managing + \PDO::class => \DI\create() + ->constructor( + \DI\get('pdo.dsn'), + \DI\get('pdo.username'), + \DI\get('pdo.password'), + \DI\get('pdo.options', null) + ), + ]); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/register_middlewares.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/register_middlewares.mustache new file mode 100644 index 0000000000..b0f4267643 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/register_middlewares.mustache @@ -0,0 +1,51 @@ +licenseInfo}} + +declare(strict_types=1); + +/** + * NOTE: This class is auto generated by the openapi generator program. + * https://github.com/openapitools/openapi-generator + * Do not edit the class manually. + */ +namespace {{appPackage}}; + +/** + * RegisterMiddlewares + * + * Recommendations from template creator: + * + * There is no way to add route related middlewares here, add global ones. Route related middlewares + * can be applied in \{{appPackage}}\RegisterRoutes class. + * + * I add middlewares by full class names(\Slim\Middleware\ErrorMiddleware::class) because that way + * Slim initiates them with options from Container. They already configured, don't need to pass any + * options manually. + * + * I don't use imports(eg. use Slim\Middleware\ErrorMiddleware) here because each package unlikely + * be used in code twice. It helps to keep that file short and make Git history cleaner. + * + * This class declared as final because two classes with middlewares can cause confusion. Edit + * template of this class or use your own implementation instead(overwrite index.php to import your + * custom class). + */ +final class RegisterMiddlewares +{ + /** + * Adds middlewares to Slim app instance. + * + * @param \Slim\App $app App instance. + */ + public function __invoke(\Slim\App $app): void + { + // Parse json, form data and xml + $app->addBodyParsingMiddleware(); + + // Add Routing Middleware + $app->addRoutingMiddleware(); + + // Add Error Middleware + $app->add(\Slim\Middleware\ErrorMiddleware::class); + } +} diff --git a/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache new file mode 100644 index 0000000000..b027ebc46e --- /dev/null +++ b/modules/openapi-generator/src/main/resources/php-slim4-server/register_routes.mustache @@ -0,0 +1,137 @@ +licenseInfo}} + +declare(strict_types=1); + +/** + * NOTE: This class is auto generated by the openapi generator program. + * https://github.com/openapitools/openapi-generator + * Do not edit the class manually. + */{{#apiInfo}} +namespace {{appPackage}}; + +use Slim\Exception\HttpNotImplementedException; + +/** + * RegisterRoutes Class Doc Comment + * + * @package {{invokerPackage}} + * @author OpenAPI Generator team + * @link https://github.com/openapitools/openapi-generator + */ +class RegisterRoutes +{ + /** @var array[] list of all api operations */ + private $operations = [ + {{#apis}} + {{#operations}} + {{#operation}} + [ + 'httpMethod' => '{{httpMethod}}', + 'basePathWithoutHost' => '{{{basePathWithoutHost}}}', + 'path' => '{{{path}}}', + 'apiPackage' => '{{apiPackage}}', + 'classname' => '{{classname}}', + 'userClassname' => '{{userClassname}}', + 'operationId' => '{{operationId}}', + 'responses' => [ + {{#responses}} + '{{#isDefault}}default{{/isDefault}}{{^isDefault}}{{code}}{{/isDefault}}' => [ + 'jsonSchema' => '{{{jsonSchema}}}', + ], + {{/responses}} + ], + 'authMethods' => [ + {{#hasAuthMethods}} + {{#authMethods}} + // {{type}} security schema named '{{name}}' + {{#isBasicBasic}} + [ + 'type' => '{{type}}', + 'isBasic' => true, + 'isBearer' => false, + 'isApiKey' => false, + 'isOAuth' => false, + ], + {{/isBasicBasic}} + {{#isBasicBearer}} + [ + 'type' => '{{type}}', + 'isBasic' => true, + 'isBearer' => true, + 'isApiKey' => false, + 'isOAuth' => false, + ], + {{/isBasicBearer}} + {{#isApiKey}} + [ + 'type' => '{{type}}', + 'isBasic' => false, + 'isBearer' => false, + 'isApiKey' => true, + 'isOAuth' => false, + 'keyParamName' => '{{keyParamName}}', + 'isKeyInHeader' => {{#isKeyInHeader}}true{{/isKeyInHeader}}{{^isKeyInHeader}}false{{/isKeyInHeader}}, + 'isKeyInQuery' => {{#isKeyInQuery}}true{{/isKeyInQuery}}{{^isKeyInQuery}}false{{/isKeyInQuery}}, + 'isKeyInCookie' => {{#isKeyInCookie}}true{{/isKeyInCookie}}{{^isKeyInCookie}}false{{/isKeyInCookie}}, + ], + {{/isApiKey}} + {{#isOAuth}} + [ + 'type' => '{{type}}', + 'isBasic' => false, + 'isBearer' => false, + 'isApiKey' => false, + 'isOAuth' => true, + 'scopes' => [ + {{#scopes}} + '{{scope}}',{{#description}} // {{.}}{{/description}} + {{/scopes}} + ], + ], + {{/isOAuth}} + {{/authMethods}} + {{/hasAuthMethods}} + ], + ], + {{/operation}} + {{/operations}} + {{/apis}} + ]; + + /** + * Add routes to Slim app. + * + * @param \Slim\App $app Pre-configured Slim application instance + * + * @throws HttpNotImplementedException When implementation class doesn't exists + */ + public function __invoke(\Slim\App $app): void + { + foreach ($this->operations as $operation) { + $callback = function ($request) use ($operation) { + $message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?"; + throw new HttpNotImplementedException($request, $message); + }; + $middlewares = []; + + if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) { + // Notice how we register the controller using the class name? + // PHP-DI will instantiate the class for us only when it's actually necessary + $callback = ["\\{$operation['apiPackage']}\\{$operation['userClassname']}", $operation['operationId']]; + } + + $route = $app->map( + [$operation['httpMethod']], + "{$operation['basePathWithoutHost']}{$operation['path']}", + $callback + )->setName($operation['operationId']); + + foreach ($middlewares as $middleware) { + $route->add($middleware); + } + } + } +} +{{/apiInfo}} diff --git a/samples/server/petstore/php-slim4/.gitignore b/samples/server/petstore/php-slim4/.gitignore index e12b356ade..27433d9094 100644 --- a/samples/server/petstore/php-slim4/.gitignore +++ b/samples/server/petstore/php-slim4/.gitignore @@ -20,5 +20,5 @@ composer.phar # Application config may contain sensitive data /config/**/*.* !/config/.htaccess -!/config/dev/example.inc.php -!/config/prod/example.inc.php +!/config/dev/default.inc.php +!/config/prod/default.inc.php diff --git a/samples/server/petstore/php-slim4/.openapi-generator/FILES b/samples/server/petstore/php-slim4/.openapi-generator/FILES index 40c7067f10..08a1e9c294 100644 --- a/samples/server/petstore/php-slim4/.openapi-generator/FILES +++ b/samples/server/petstore/php-slim4/.openapi-generator/FILES @@ -2,11 +2,14 @@ README.md composer.json config/.htaccess -config/dev/example.inc.php -config/prod/example.inc.php +config/dev/default.inc.php +config/prod/default.inc.php lib/Api/AbstractPetApi.php lib/Api/AbstractStoreApi.php lib/Api/AbstractUserApi.php +lib/App/RegisterDependencies.php +lib/App/RegisterMiddlewares.php +lib/App/RegisterRoutes.php lib/Auth/AbstractAuthenticator.php lib/BaseModel.php lib/Model/ApiResponse.php @@ -15,7 +18,6 @@ lib/Model/Order.php lib/Model/Pet.php lib/Model/Tag.php lib/Model/User.php -lib/SlimRouter.php phpcs.xml.dist phpunit.xml.dist public/.htaccess diff --git a/samples/server/petstore/php-slim4/README.md b/samples/server/petstore/php-slim4/README.md index ac51de45d1..a99f4a13cc 100644 --- a/samples/server/petstore/php-slim4/README.md +++ b/samples/server/petstore/php-slim4/README.md @@ -4,6 +4,7 @@ * [Slim 4 Documentation](https://www.slimframework.com/docs/v4/) This server has been generated with [Slim PSR-7](https://github.com/slimphp/Slim-Psr7) implementation. +[PHP-DI](https://php-di.org/doc/frameworks/slim.html) package used as dependency container. ## Requirements @@ -23,7 +24,10 @@ $ composer install ## Add configs -Application requires at least one config file(`config/dev/config.inc.php` or `config/prod/config.inc.php`). You can use [config/dev/example.inc.php](config/dev/example.inc.php) as starting point. +[PHP-DI package](https://php-di.org/doc/getting-started.html) helps to decouple configuration from implementation. App loads configuration files in straight order(`$env` can be `prod` or `dev`): +1. `config/$env/default.inc.php` (contains safe values, can be committed to vcs) +2. `config/$env/config.inc.php` (user config, excluded from vcs, can contain sensitive values, passwords etc.) +3. `lib/App/RegisterDependencies.php` ## Start devserver @@ -86,25 +90,14 @@ $ composer phplint ## Show errors -Switch on option in your application config file like: -```diff - return [ - 'slimSettings' => [ -- 'displayErrorDetails' => false, -+ 'displayErrorDetails' => true, - 'logErrors' => true, - 'logErrorDetails' => true, - ], +Switch your app environment to development in `public/.htaccess` file: +```ini +## .htaccess + + SetEnv APP_ENV 'development' + ``` -## Mock Server -For a quick start uncomment [mocker middleware options](config/dev/example.inc.php#L67-L94) in your application config file. - -Used packages: -* [Openapi Data Mocker](https://github.com/ybelenko/openapi-data-mocker) - first implementation of OAS3 fake data generator. -* [Openapi Data Mocker Server Middleware](https://github.com/ybelenko/openapi-data-mocker-server-middleware) - PSR-15 HTTP server middleware. -* [Openapi Data Mocker Interfaces](https://github.com/ybelenko/openapi-data-mocker-interfaces) - package with mocking interfaces. - ## API Endpoints All URIs are relative to *http://petstore.swagger.io/v2* @@ -117,17 +110,22 @@ All URIs are relative to *http://petstore.swagger.io/v2* namespace OpenAPIServer\Api; use OpenAPIServer\Api\AbstractPetApi; +use Psr\Http\Message\ServerRequestInterface; +use Psr\Http\Message\ResponseInterface; class PetApi extends AbstractPetApi { - - public function addPet($request, $response, $args) - { + public function addPet( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { // your implementation of addPet method here } } ``` +When you need to inject dependencies into API controller check [PHP-DI - Controllers as services](https://github.com/PHP-DI/Slim-Bridge#controllers-as-services) guide. + Place all your implementation classes in `./src` folder accordingly. For instance, when abstract class located at `./lib/Api/AbstractPetApi.php` you need to create implementation class at `./src/Api/PetApi.php`. diff --git a/samples/server/petstore/php-slim4/composer.json b/samples/server/petstore/php-slim4/composer.json index 529f8f9371..4f31f4b28f 100644 --- a/samples/server/petstore/php-slim4/composer.json +++ b/samples/server/petstore/php-slim4/composer.json @@ -9,15 +9,15 @@ ], "require": { "php": "^7.4 || ^8.0", - "slim/slim": "^4.5.0", "dyorg/slim-token-authentication": "dev-slim4", + "php-di/slim-bridge": "^3.2", + "slim/psr7": "^1.1.0", "ybelenko/openapi-data-mocker": "^1.0", - "ybelenko/openapi-data-mocker-server-middleware": "^1.0", - "slim/psr7": "^1.1.0" + "ybelenko/openapi-data-mocker-server-middleware": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^8.0 || ^9.0", "overtrue/phplint": "^2.0.2", + "phpunit/phpunit": "^8.0 || ^9.0", "squizlabs/php_codesniffer": "^3.5" }, "autoload": { @@ -37,5 +37,8 @@ "test-models": "phpunit --testsuite Models", "phpcs": "phpcs", "phplint": "phplint ./ --exclude=vendor" + }, + "config": { + "sort-packages": true } } diff --git a/samples/server/petstore/php-slim4/config/dev/default.inc.php b/samples/server/petstore/php-slim4/config/dev/default.inc.php new file mode 100644 index 0000000000..be4bd6530b --- /dev/null +++ b/samples/server/petstore/php-slim4/config/dev/default.inc.php @@ -0,0 +1,35 @@ + 'development', + + // slim framework settings + 'slim.displayErrorDetails' => true, + 'slim.logErrors' => false, + 'slim.logErrorDetails' => false, + + // PDO + 'pdo.dsn' => 'mysql:host=localhost;charset=utf8mb4', + 'pdo.username' => 'root', + 'pdo.password' => 'root', + 'pdo.options' => [ + \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, + ], +]; diff --git a/samples/server/petstore/php-slim4/config/dev/example.inc.php b/samples/server/petstore/php-slim4/config/dev/example.inc.php deleted file mode 100644 index 2a2e65d4a5..0000000000 --- a/samples/server/petstore/php-slim4/config/dev/example.inc.php +++ /dev/null @@ -1,96 +0,0 @@ -setModelsNamespace('OpenAPIServer\Model\\'); - -return [ - 'slimSettings' => [ - 'displayErrorDetails' => false, - 'logErrors' => true, - 'logErrorDetails' => true, - ], - - 'tokenAuthenticationOptions' => [ - /** - * Tokens are essentially passwords. You should treat them as such and you should always - * use HTTPS. If the middleware detects insecure usage over HTTP it will return unauthorized - * with a message Required HTTPS for token authentication. This rule is relaxed for requests - * on localhost. To allow insecure usage you must enable it manually by setting secure to - * false. - * Default: true - */ - // 'secure' => true, - - /** - * Alternatively you can list your development host to have relaxed security. - * Default: ['localhost', '127.0.0.1'] - */ - // 'relaxed' => ['localhost', '127.0.0.1'], - - /** - * By default on occurred a fail on authentication, is sent a response on json format with a - * message (`Invalid Token` or `Not found Token`) and with the token (if found), with status - * `401 Unauthorized`. You can customize it by setting a callable function on error option. - * Default: null - */ - // 'error' => null, - ], - - 'mockerOptions' => [ - // 'dataMocker' => $mocker, - - // 'getMockStatusCodeCallback' => function (ServerRequestInterface $request, array $responses) { - // // check if client clearly asks for mocked response - // $pingHeader = 'X-OpenAPIServer-Mock'; - // $pingHeaderCode = 'X-OpenAPIServer-Mock-Code'; - // if ( - // $request->hasHeader($pingHeader) - // && $request->getHeader($pingHeader)[0] === 'ping' - // ) { - // $responses = (array) $responses; - // $requestedResponseCode = ($request->hasHeader($pingHeaderCode)) ? $request->getHeader($pingHeaderCode)[0] : 'default'; - // if (array_key_exists($requestedResponseCode, $responses)) { - // return $requestedResponseCode; - // } - - // // return first response key - // reset($responses); - // return key($responses); - // } - - // return false; - // }, - - // 'afterCallback' => function (ServerRequestInterface $request, ResponseInterface $response) { - // // mark mocked response to distinguish real and fake responses - // return $response->withHeader('X-OpenAPIServer-Mock', 'pong'); - // }, - ], -]; diff --git a/samples/server/petstore/php-slim4/config/prod/default.inc.php b/samples/server/petstore/php-slim4/config/prod/default.inc.php new file mode 100644 index 0000000000..333c7768b4 --- /dev/null +++ b/samples/server/petstore/php-slim4/config/prod/default.inc.php @@ -0,0 +1,35 @@ + 'production', + + // slim framework settings + 'slim.displayErrorDetails' => false, + 'slim.logErrors' => true, + 'slim.logErrorDetails' => true, + + // PDO + 'pdo.dsn' => 'mysql:host=localhost;charset=utf8mb4', + 'pdo.username' => 'root', + 'pdo.password' => 'root', + 'pdo.options' => [ + \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, + ], +]; diff --git a/samples/server/petstore/php-slim4/config/prod/example.inc.php b/samples/server/petstore/php-slim4/config/prod/example.inc.php deleted file mode 100644 index 2a2e65d4a5..0000000000 --- a/samples/server/petstore/php-slim4/config/prod/example.inc.php +++ /dev/null @@ -1,96 +0,0 @@ -setModelsNamespace('OpenAPIServer\Model\\'); - -return [ - 'slimSettings' => [ - 'displayErrorDetails' => false, - 'logErrors' => true, - 'logErrorDetails' => true, - ], - - 'tokenAuthenticationOptions' => [ - /** - * Tokens are essentially passwords. You should treat them as such and you should always - * use HTTPS. If the middleware detects insecure usage over HTTP it will return unauthorized - * with a message Required HTTPS for token authentication. This rule is relaxed for requests - * on localhost. To allow insecure usage you must enable it manually by setting secure to - * false. - * Default: true - */ - // 'secure' => true, - - /** - * Alternatively you can list your development host to have relaxed security. - * Default: ['localhost', '127.0.0.1'] - */ - // 'relaxed' => ['localhost', '127.0.0.1'], - - /** - * By default on occurred a fail on authentication, is sent a response on json format with a - * message (`Invalid Token` or `Not found Token`) and with the token (if found), with status - * `401 Unauthorized`. You can customize it by setting a callable function on error option. - * Default: null - */ - // 'error' => null, - ], - - 'mockerOptions' => [ - // 'dataMocker' => $mocker, - - // 'getMockStatusCodeCallback' => function (ServerRequestInterface $request, array $responses) { - // // check if client clearly asks for mocked response - // $pingHeader = 'X-OpenAPIServer-Mock'; - // $pingHeaderCode = 'X-OpenAPIServer-Mock-Code'; - // if ( - // $request->hasHeader($pingHeader) - // && $request->getHeader($pingHeader)[0] === 'ping' - // ) { - // $responses = (array) $responses; - // $requestedResponseCode = ($request->hasHeader($pingHeaderCode)) ? $request->getHeader($pingHeaderCode)[0] : 'default'; - // if (array_key_exists($requestedResponseCode, $responses)) { - // return $requestedResponseCode; - // } - - // // return first response key - // reset($responses); - // return key($responses); - // } - - // return false; - // }, - - // 'afterCallback' => function (ServerRequestInterface $request, ResponseInterface $response) { - // // mark mocked response to distinguish real and fake responses - // return $response->withHeader('X-OpenAPIServer-Mock', 'pong'); - // }, - ], -]; diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php index ff8c722452..7975aabc6f 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractPetApi.php @@ -19,10 +19,11 @@ * NOTE: This class is auto generated by the openapi generator program. * https://github.com/openapitools/openapi-generator * Do not edit the class manually. + * Extend this class with your controller. You can inject dependencies via class constructor, + * @see https://github.com/PHP-DI/Slim-Bridge basic example. */ namespace OpenAPIServer\Api; -use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; use Slim\Exception\HttpNotImplementedException; @@ -36,23 +37,6 @@ use Slim\Exception\HttpNotImplementedException; */ abstract class AbstractPetApi { - - /** - * @var ContainerInterface|null Slim app container instance - */ - protected $container; - - /** - * Route Controller constructor receives container - * - * @param ContainerInterface|null $container Slim app container instance - */ - public function __construct(ContainerInterface $container = null) - { - $this->container = $container; - } - - /** * POST addPet * Summary: Add a new pet to the store @@ -60,13 +44,14 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function addPet(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function addPet( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $body = $request->getParsedBody(); $message = "How about implementing addPet as a POST method in OpenAPIServer\Api\PetApi class?"; throw new HttpNotImplementedException($request, $message); @@ -78,16 +63,18 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param int $petId Pet id to delete * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function deletePet(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function deletePet( + ServerRequestInterface $request, + ResponseInterface $response, + int $petId + ): ResponseInterface { $headers = $request->getHeaders(); $apiKey = $request->hasHeader('api_key') ? $headers['api_key'] : null; - $petId = $args['petId']; $message = "How about implementing deletePet as a DELETE method in OpenAPIServer\Api\PetApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -100,13 +87,14 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function findPetsByStatus(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function findPetsByStatus( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $queryParams = $request->getQueryParams(); $status = (key_exists('status', $queryParams)) ? $queryParams['status'] : null; $message = "How about implementing findPetsByStatus as a GET method in OpenAPIServer\Api\PetApi class?"; @@ -121,14 +109,15 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method * @deprecated */ - public function findPetsByTags(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function findPetsByTags( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $queryParams = $request->getQueryParams(); $tags = (key_exists('tags', $queryParams)) ? $queryParams['tags'] : null; $message = "How about implementing findPetsByTags as a GET method in OpenAPIServer\Api\PetApi class?"; @@ -143,14 +132,16 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param int $petId ID of pet to return * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function getPetById(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $petId = $args['petId']; + public function getPetById( + ServerRequestInterface $request, + ResponseInterface $response, + int $petId + ): ResponseInterface { $message = "How about implementing getPetById as a GET method in OpenAPIServer\Api\PetApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -162,13 +153,14 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function updatePet(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function updatePet( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $body = $request->getParsedBody(); $message = "How about implementing updatePet as a PUT method in OpenAPIServer\Api\PetApi class?"; throw new HttpNotImplementedException($request, $message); @@ -180,14 +172,16 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param int $petId ID of pet that needs to be updated * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function updatePetWithForm(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $petId = $args['petId']; + public function updatePetWithForm( + ServerRequestInterface $request, + ResponseInterface $response, + int $petId + ): ResponseInterface { $body = $request->getParsedBody(); $name = (isset($body['name'])) ? $body['name'] : null; $status = (isset($body['status'])) ? $body['status'] : null; @@ -202,14 +196,16 @@ abstract class AbstractPetApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param int $petId ID of pet to update * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function uploadFile(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $petId = $args['petId']; + public function uploadFile( + ServerRequestInterface $request, + ResponseInterface $response, + int $petId + ): ResponseInterface { $body = $request->getParsedBody(); $additionalMetadata = (isset($body['additionalMetadata'])) ? $body['additionalMetadata'] : null; $file = (key_exists('file', $request->getUploadedFiles())) ? $request->getUploadedFiles()['file'] : null; diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php index 2542047a66..0c153911aa 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractStoreApi.php @@ -19,10 +19,11 @@ * NOTE: This class is auto generated by the openapi generator program. * https://github.com/openapitools/openapi-generator * Do not edit the class manually. + * Extend this class with your controller. You can inject dependencies via class constructor, + * @see https://github.com/PHP-DI/Slim-Bridge basic example. */ namespace OpenAPIServer\Api; -use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; use Slim\Exception\HttpNotImplementedException; @@ -36,23 +37,6 @@ use Slim\Exception\HttpNotImplementedException; */ abstract class AbstractStoreApi { - - /** - * @var ContainerInterface|null Slim app container instance - */ - protected $container; - - /** - * Route Controller constructor receives container - * - * @param ContainerInterface|null $container Slim app container instance - */ - public function __construct(ContainerInterface $container = null) - { - $this->container = $container; - } - - /** * DELETE deleteOrder * Summary: Delete purchase order by ID @@ -60,14 +44,16 @@ abstract class AbstractStoreApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param string $orderId ID of the order that needs to be deleted * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function deleteOrder(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $orderId = $args['orderId']; + public function deleteOrder( + ServerRequestInterface $request, + ResponseInterface $response, + string $orderId + ): ResponseInterface { $message = "How about implementing deleteOrder as a DELETE method in OpenAPIServer\Api\StoreApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -80,13 +66,14 @@ abstract class AbstractStoreApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function getInventory(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function getInventory( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $message = "How about implementing getInventory as a GET method in OpenAPIServer\Api\StoreApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -99,14 +86,16 @@ abstract class AbstractStoreApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param int $orderId ID of pet that needs to be fetched * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function getOrderById(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $orderId = $args['orderId']; + public function getOrderById( + ServerRequestInterface $request, + ResponseInterface $response, + int $orderId + ): ResponseInterface { $message = "How about implementing getOrderById as a GET method in OpenAPIServer\Api\StoreApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -118,13 +107,14 @@ abstract class AbstractStoreApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function placeOrder(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function placeOrder( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $body = $request->getParsedBody(); $message = "How about implementing placeOrder as a POST method in OpenAPIServer\Api\StoreApi class?"; throw new HttpNotImplementedException($request, $message); diff --git a/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php b/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php index eee2c7d2cc..fb9b1e5c7b 100644 --- a/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php +++ b/samples/server/petstore/php-slim4/lib/Api/AbstractUserApi.php @@ -19,10 +19,11 @@ * NOTE: This class is auto generated by the openapi generator program. * https://github.com/openapitools/openapi-generator * Do not edit the class manually. + * Extend this class with your controller. You can inject dependencies via class constructor, + * @see https://github.com/PHP-DI/Slim-Bridge basic example. */ namespace OpenAPIServer\Api; -use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Psr\Http\Message\ResponseInterface; use Slim\Exception\HttpNotImplementedException; @@ -36,23 +37,6 @@ use Slim\Exception\HttpNotImplementedException; */ abstract class AbstractUserApi { - - /** - * @var ContainerInterface|null Slim app container instance - */ - protected $container; - - /** - * Route Controller constructor receives container - * - * @param ContainerInterface|null $container Slim app container instance - */ - public function __construct(ContainerInterface $container = null) - { - $this->container = $container; - } - - /** * POST createUser * Summary: Create user @@ -60,13 +44,14 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function createUser(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function createUser( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $body = $request->getParsedBody(); $message = "How about implementing createUser as a POST method in OpenAPIServer\Api\UserApi class?"; throw new HttpNotImplementedException($request, $message); @@ -78,13 +63,14 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function createUsersWithArrayInput(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function createUsersWithArrayInput( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $body = $request->getParsedBody(); $message = "How about implementing createUsersWithArrayInput as a POST method in OpenAPIServer\Api\UserApi class?"; throw new HttpNotImplementedException($request, $message); @@ -96,13 +82,14 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function createUsersWithListInput(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function createUsersWithListInput( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $body = $request->getParsedBody(); $message = "How about implementing createUsersWithListInput as a POST method in OpenAPIServer\Api\UserApi class?"; throw new HttpNotImplementedException($request, $message); @@ -115,14 +102,16 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param string $username The name that needs to be deleted * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function deleteUser(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $username = $args['username']; + public function deleteUser( + ServerRequestInterface $request, + ResponseInterface $response, + string $username + ): ResponseInterface { $message = "How about implementing deleteUser as a DELETE method in OpenAPIServer\Api\UserApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -134,14 +123,16 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param string $username The name that needs to be fetched. Use user1 for testing. * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function getUserByName(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $username = $args['username']; + public function getUserByName( + ServerRequestInterface $request, + ResponseInterface $response, + string $username + ): ResponseInterface { $message = "How about implementing getUserByName as a GET method in OpenAPIServer\Api\UserApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -153,13 +144,14 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function loginUser(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function loginUser( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $queryParams = $request->getQueryParams(); $username = (key_exists('username', $queryParams)) ? $queryParams['username'] : null; $password = (key_exists('password', $queryParams)) ? $queryParams['password'] : null; @@ -173,13 +165,14 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function logoutUser(ServerRequestInterface $request, ResponseInterface $response, array $args) - { + public function logoutUser( + ServerRequestInterface $request, + ResponseInterface $response + ): ResponseInterface { $message = "How about implementing logoutUser as a GET method in OpenAPIServer\Api\UserApi class?"; throw new HttpNotImplementedException($request, $message); } @@ -191,14 +184,16 @@ abstract class AbstractUserApi * * @param ServerRequestInterface $request Request * @param ResponseInterface $response Response - * @param array|null $args Path arguments + * @param string $username name that need to be deleted * * @return ResponseInterface * @throws HttpNotImplementedException to force implementation class to override this method */ - public function updateUser(ServerRequestInterface $request, ResponseInterface $response, array $args) - { - $username = $args['username']; + public function updateUser( + ServerRequestInterface $request, + ResponseInterface $response, + string $username + ): ResponseInterface { $body = $request->getParsedBody(); $message = "How about implementing updateUser as a PUT method in OpenAPIServer\Api\UserApi class?"; throw new HttpNotImplementedException($request, $message); diff --git a/samples/server/petstore/php-slim4/lib/App/RegisterDependencies.php b/samples/server/petstore/php-slim4/lib/App/RegisterDependencies.php new file mode 100644 index 0000000000..8c21bc3dca --- /dev/null +++ b/samples/server/petstore/php-slim4/lib/App/RegisterDependencies.php @@ -0,0 +1,71 @@ +addDefinitions([ + // Response factory required as typed argument in next ErrorMiddleware injection + \Psr\Http\Message\ResponseFactoryInterface::class => \DI\factory([\Slim\Factory\AppFactory::class, 'determineResponseFactory']), + + // Slim error middleware + // @see https://www.slimframework.com/docs/v4/middleware/error-handling.html + \Slim\Middleware\ErrorMiddleware::class => \DI\autowire() + ->constructorParameter('displayErrorDetails', \DI\get('slim.displayErrorDetails', false)) + ->constructorParameter('logErrors', \DI\get('slim.logErrors', true)) + ->constructorParameter('logErrorDetails', \DI\get('slim.logErrorDetails', true)), + + // PDO class for database managing + \PDO::class => \DI\create() + ->constructor( + \DI\get('pdo.dsn'), + \DI\get('pdo.username'), + \DI\get('pdo.password'), + \DI\get('pdo.options', null) + ), + ]); + } +} diff --git a/samples/server/petstore/php-slim4/lib/App/RegisterMiddlewares.php b/samples/server/petstore/php-slim4/lib/App/RegisterMiddlewares.php new file mode 100644 index 0000000000..120d91dede --- /dev/null +++ b/samples/server/petstore/php-slim4/lib/App/RegisterMiddlewares.php @@ -0,0 +1,64 @@ +addBodyParsingMiddleware(); + + // Add Routing Middleware + $app->addRoutingMiddleware(); + + // Add Error Middleware + $app->add(\Slim\Middleware\ErrorMiddleware::class); + } +} diff --git a/samples/server/petstore/php-slim4/lib/SlimRouter.php b/samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php similarity index 75% rename from samples/server/petstore/php-slim4/lib/SlimRouter.php rename to samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php index 1f81b223d2..52c5533f2a 100644 --- a/samples/server/petstore/php-slim4/lib/SlimRouter.php +++ b/samples/server/petstore/php-slim4/lib/App/RegisterRoutes.php @@ -15,39 +15,26 @@ * Generated by: https://github.com/openapitools/openapi-generator.git */ +declare(strict_types=1); + /** * NOTE: This class is auto generated by the openapi generator program. * https://github.com/openapitools/openapi-generator * Do not edit the class manually. */ -namespace OpenAPIServer; +namespace OpenAPIServer\App; -use Slim\Factory\AppFactory; -use Slim\Interfaces\RouteInterface; use Slim\Exception\HttpNotImplementedException; -use Psr\Container\ContainerInterface; -use InvalidArgumentException; -use Dyorg\TokenAuthentication; -use Dyorg\TokenAuthentication\TokenSearch; -use Psr\Http\Message\ServerRequestInterface; -use OpenAPIServer\Mock\OpenApiDataMocker; -use OpenAPIServer\Mock\OpenApiDataMockerRouteMiddleware; -use Slim\Psr7\Factory\ResponseFactory; -use Exception; /** - * SlimRouter Class Doc Comment + * RegisterRoutes Class Doc Comment * * @package OpenAPIServer * @author OpenAPI Generator team * @link https://github.com/openapitools/openapi-generator */ -class SlimRouter +class RegisterRoutes { - - /** @var App instance */ - private $slimApp; - /** @var array[] list of all api operations */ private $operations = [ [ @@ -843,191 +830,36 @@ class SlimRouter ]; /** - * Class constructor + * Add routes to Slim app. * - * @param ContainerInterface|array $settings Either a ContainerInterface or an associative array of app settings + * @param \Slim\App $app Pre-configured Slim application instance * * @throws HttpNotImplementedException When implementation class doesn't exists - * @throws Exception when not supported authorization schema type provided */ - public function __construct($settings = []) + public function __invoke(\Slim\App $app): void { - if ($settings instanceof ContainerInterface) { - // Set container to create App with on AppFactory - AppFactory::setContainer($settings); - } - $this->slimApp = AppFactory::create(); - - // middlewares requires Psr\Container\ContainerInterface - $container = $this->slimApp->getContainer(); - - $authPackage = 'OpenAPIServer\Auth'; - $basicAuthenticator = function (ServerRequestInterface &$request, TokenSearch $tokenSearch) use ($authPackage) { - $message = "How about extending AbstractAuthenticator class by {$authPackage}\BasicAuthenticator?"; - throw new HttpNotImplementedException($request, $message); - }; - $apiKeyAuthenticator = function (ServerRequestInterface &$request, TokenSearch $tokenSearch) use ($authPackage) { - $message = "How about extending AbstractAuthenticator class by {$authPackage}\ApiKeyAuthenticator?"; - throw new HttpNotImplementedException($request, $message); - }; - $oAuthAuthenticator = function (ServerRequestInterface &$request, TokenSearch $tokenSearch) use ($authPackage) { - $message = "How about extending AbstractAuthenticator class by {$authPackage}\OAuthAuthenticator?"; - throw new HttpNotImplementedException($request, $message); - }; - - $userOptions = $this->getSetting($settings, 'tokenAuthenticationOptions', null); - - // mocker options - $mockerOptions = $this->getSetting($settings, 'mockerOptions', null); - $dataMocker = $mockerOptions['dataMocker'] ?? new OpenApiDataMocker(); - $responseFactory = new ResponseFactory(); - $getMockStatusCodeCallback = $mockerOptions['getMockStatusCodeCallback'] ?? null; - $mockAfterCallback = $mockerOptions['afterCallback'] ?? null; - foreach ($this->operations as $operation) { - $callback = function ($request, $response, $arguments) use ($operation) { + $callback = function ($request) use ($operation) { $message = "How about extending {$operation['classname']} by {$operation['apiPackage']}\\{$operation['userClassname']} class implementing {$operation['operationId']} as a {$operation['httpMethod']} method?"; throw new HttpNotImplementedException($request, $message); }; $middlewares = []; if (class_exists("\\{$operation['apiPackage']}\\{$operation['userClassname']}")) { - $callback = "\\{$operation['apiPackage']}\\{$operation['userClassname']}:{$operation['operationId']}"; + // Notice how we register the controller using the class name? + // PHP-DI will instantiate the class for us only when it's actually necessary + $callback = ["\\{$operation['apiPackage']}\\{$operation['userClassname']}", $operation['operationId']]; } - foreach ($operation['authMethods'] as $authMethod) { - switch ($authMethod['type']) { - case 'http': - $authenticatorClassname = "\\{$authPackage}\\BasicAuthenticator"; - if (class_exists($authenticatorClassname)) { - $basicAuthenticator = new $authenticatorClassname($container); - } - - $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ - 'authenticator' => $basicAuthenticator, - 'regex' => $authMethod['isBearer'] ? '/Bearer\s+(.*)$/i' : '/Basic\s+(.*)$/i', - 'header' => 'Authorization', - 'parameter' => null, - 'cookie' => null, - 'argument' => null, - ], $userOptions)); - break; - case 'apiKey': - $authenticatorClassname = "\\{$authPackage}\\ApiKeyAuthenticator"; - if (class_exists($authenticatorClassname)) { - $apiKeyAuthenticator = new $authenticatorClassname($container); - } - - $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ - 'authenticator' => $apiKeyAuthenticator, - 'regex' => '/^(.*)$/i', - 'header' => $authMethod['isKeyInHeader'] ? $authMethod['keyParamName'] : null, - 'parameter' => $authMethod['isKeyInQuery'] ? $authMethod['keyParamName'] : null, - 'cookie' => $authMethod['isKeyInCookie'] ? $authMethod['keyParamName'] : null, - 'argument' => null, - ], $userOptions)); - break; - case 'oauth2': - $authenticatorClassname = "\\{$authPackage}\\OAuthAuthenticator"; - if (class_exists($authenticatorClassname)) { - $oAuthAuthenticator = new $authenticatorClassname($container, $authMethod['scopes']); - } - - $middlewares[] = new TokenAuthentication($this->getTokenAuthenticationOptions([ - 'authenticator' => $oAuthAuthenticator, - 'regex' => '/Bearer\s+(.*)$/i', - 'header' => 'Authorization', - 'parameter' => null, - 'cookie' => null, - 'argument' => null, - ], $userOptions)); - break; - default: - throw new Exception('Unknown authorization schema type'); - } - } - - if (is_callable($getMockStatusCodeCallback)) { - $mockSchemaResponses = array_map(function ($item) { - return json_decode($item['jsonSchema'], true); - }, $operation['responses']); - $middlewares[] = new OpenApiDataMockerRouteMiddleware($dataMocker, $mockSchemaResponses, $responseFactory, $getMockStatusCodeCallback, $mockAfterCallback); - } - - $this->addRoute( + $route = $app->map( [$operation['httpMethod']], "{$operation['basePathWithoutHost']}{$operation['path']}", - $callback, - $middlewares + $callback )->setName($operation['operationId']); + + foreach ($middlewares as $middleware) { + $route->add($middleware); + } } } - - /** - * Merges user defined options with dynamic params - * - * @param array $staticOptions Required static options - * @param array $userOptions User options - * - * @return array Merged array - */ - private function getTokenAuthenticationOptions(array $staticOptions, array $userOptions = null) - { - if (is_array($userOptions) === false) { - return $staticOptions; - } - - return array_merge($userOptions, $staticOptions); - } - - /** - * Returns app setting by name. - * - * @param ContainerInterface|array $settings Either a ContainerInterface or an associative array of app settings - * @param string $settingName Setting name - * @param mixed $default Default setting value. - * - * @return mixed - */ - private function getSetting($settings, $settingName, $default = null) - { - if ($settings instanceof ContainerInterface && $settings->has($settingName)) { - return $settings->get($settingName); - } elseif (is_array($settings) && array_key_exists($settingName, $settings)) { - return $settings[$settingName]; - } - - return $default; - } - - /** - * Add route with multiple methods - * - * @param string[] $methods Numeric array of HTTP method names - * @param string $pattern The route URI pattern - * @param callable|string $callable The route callback routine - * @param array|null $middlewares List of middlewares - * - * @return RouteInterface - * - * @throws InvalidArgumentException If the route pattern isn't a string - */ - public function addRoute(array $methods, string $pattern, $callable, $middlewares = []) - { - $route = $this->slimApp->map($methods, $pattern, $callable); - foreach ($middlewares as $middleware) { - $route->add($middleware); - } - return $route; - } - - /** - * Returns Slim Framework instance - * - * @return App - */ - public function getSlimApp() - { - return $this->slimApp; - } } diff --git a/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php b/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php index de2e601136..699fd1fdbc 100644 --- a/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php +++ b/samples/server/petstore/php-slim4/lib/Auth/AbstractAuthenticator.php @@ -22,7 +22,6 @@ */ namespace OpenAPIServer\Auth; -use Psr\Container\ContainerInterface; use Psr\Http\Message\ServerRequestInterface; use Dyorg\TokenAuthentication; use Dyorg\TokenAuthentication\TokenSearch; @@ -37,12 +36,6 @@ use Dyorg\TokenAuthentication\Exceptions\UnauthorizedExceptionInterface; */ abstract class AbstractAuthenticator { - - /** - * @var ContainerInterface|null Slim app container instance - */ - protected $container; - /** * @var string[]|null List of required scopes */ @@ -62,12 +55,10 @@ abstract class AbstractAuthenticator /** * Authenticator constructor * - * @param ContainerInterface|null $container Slim app container instance - * @param string[]|null $requiredScope List of required scopes + * @param string[]|null $requiredScope List of required scopes */ - public function __construct(ContainerInterface $container = null, $requiredScope = null) + public function __construct($requiredScope = null) { - $this->container = $container; $this->requiredScope = $requiredScope; } diff --git a/samples/server/petstore/php-slim4/public/.htaccess b/samples/server/petstore/php-slim4/public/.htaccess index f6a2ceb395..57c2185f0e 100644 --- a/samples/server/petstore/php-slim4/public/.htaccess +++ b/samples/server/petstore/php-slim4/public/.htaccess @@ -1,3 +1,7 @@ + + SetEnv APP_ENV 'production' + + RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f diff --git a/samples/server/petstore/php-slim4/public/index.php b/samples/server/petstore/php-slim4/public/index.php index 9993535af7..e336d00f81 100644 --- a/samples/server/petstore/php-slim4/public/index.php +++ b/samples/server/petstore/php-slim4/public/index.php @@ -22,48 +22,63 @@ require_once __DIR__ . '/../vendor/autoload.php'; -use OpenAPIServer\SlimRouter; -use Psr\Http\Message\ServerRequestInterface; -use Psr\Http\Message\ResponseInterface; -use OpenAPIServer\Mock\OpenApiDataMocker; +use DI\Bridge\Slim\Bridge; +use DI\ContainerBuilder; +use OpenAPIServer\App\RegisterDependencies; +use OpenAPIServer\App\RegisterRoutes; +use OpenAPIServer\App\RegisterMiddlewares; +use Slim\Factory\ServerRequestCreatorFactory; +use Slim\ResponseEmitter; -// load config file -$config = []; -if (is_array($prodConfig = @include(__DIR__ . '/../config/prod/config.inc.php'))) { - $config = $prodConfig; -} elseif (is_array($devConfig = @include(__DIR__ . '/../config/dev/config.inc.php'))) { - $config = $devConfig; -} else { - throw new InvalidArgumentException('Config file missed or broken.'); +// Instantiate PHP-DI ContainerBuilder +$builder = new ContainerBuilder(); + +// consider prod by default +$env; +switch (strtolower($_SERVER['APP_ENV'] ?? 'prod')) { + case 'development': + case 'dev': + $env = 'dev'; + break; + case 'production': + case 'prod': + default: + $env = 'prod'; } -$router = new SlimRouter($config); -$app = $router->getSlimApp(); +// Main configuration +$builder->addDefinitions(__DIR__ . "/../config/{$env}/default.inc.php"); -// Parse json, form data and xml -$app->addBodyParsingMiddleware(); +// Config file for the environment if exists +$userConfig = __DIR__ . "/../config/{$env}/config.inc.php"; +if (file_exists($userConfig)) { + $builder->addDefinitions($userConfig); +} -/** - * The routing middleware should be added before the ErrorMiddleware - * Otherwise exceptions thrown from it will not be handled - */ -$app->addRoutingMiddleware(); +// Set up dependencies +$dependencies = new RegisterDependencies(); +$dependencies($builder); -/** - * Add Error Handling Middleware - * - * @param bool $displayErrorDetails -> Should be set to false in production - * @param bool $logErrors -> Parameter is passed to the default ErrorHandler - * @param bool $logErrorDetails -> Display error details in error log - * which can be replaced by a callable of your choice. +// Build PHP-DI Container instance +$container = $builder->build(); - * Note: This middleware should be added last. It will not handle any exceptions/errors - * for middleware added after it. - */ -$app->addErrorMiddleware( - $config['slimSettings']['displayErrorDetails'] ?? false, - $config['slimSettings']['logErrors'] ?? true, - $config['slimSettings']['logErrorDetails'] ?? true -); +// Instantiate the app +$app = Bridge::create($container); -$app->run(); +// Register middleware +$middleware = new RegisterMiddlewares(); +$middleware($app); + +// Register routes +// yes, it's anti-pattern you shouldn't get deps from container directly +$routes = $container->get(RegisterRoutes::class); +$routes($app); + +// Create Request object from globals +$serverRequestCreator = ServerRequestCreatorFactory::create(); +$request = $serverRequestCreator->createServerRequestFromGlobals(); + +// Run App & Emit Response +$response = $app->handle($request); +$responseEmitter = new ResponseEmitter(); +$responseEmitter->emit($response); From 08773a211c4898cfb075de750021c62f447dc6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Luka=C5=A1=C3=ADk?= Date: Wed, 29 Dec 2021 04:50:08 +0100 Subject: [PATCH 49/54] Rust Client: Support collectionFormat="multi" (#11169) Previously, rust-client generator disregarded collectionFormat property of multi-value parameters. Now we support following values in collectionFormat: "", "csv", "multi". You can review changes this creates for fairly sizable project at https://github.com/CrowdStrike/rusty-falcon/pull/33/files --- .../main/resources/rust/reqwest/api.mustache | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache index 867ba22a25..0957489881 100644 --- a/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache +++ b/modules/openapi-generator/src/main/resources/rust/reqwest/api.mustache @@ -101,11 +101,27 @@ pub {{#supportAsync}}async {{/supportAsync}}fn {{{operationId}}}(configuration: {{#queryParams}} {{#required}} - local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string())]); + {{#isArray}} + local_var_req_builder = match "{{collectionFormat}}" { + "multi" => local_var_req_builder.query(&{{{paramName}}}.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p)).collect::>()), + _ => local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + {{/isArray}} + {{^isArray}} + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &{{{paramName}}}.to_string())]); + {{/isArray}} {{/required}} {{^required}} if let Some(ref local_var_str) = {{{paramName}}} { - local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &local_var_str{{#isArray}}.into_iter().map(|p| p.to_string()).collect::>().join(","){{/isArray}}.to_string())]); + {{#isArray}} + local_var_req_builder = match "{{collectionFormat}}" { + "multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("{{{baseName}}}".to_owned(), p.to_string())).collect::>()), + _ => local_var_req_builder.query(&[("{{{baseName}}}", &local_var_str.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; + {{/isArray}} + {{^isArray}} + local_var_req_builder = local_var_req_builder.query(&[("{{{baseName}}}", &local_var_str.to_string())]); + {{/isArray}} } {{/required}} {{/queryParams}} From d48539105105bd307188ab1d768c2430ea384418 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 29 Dec 2021 11:54:45 +0800 Subject: [PATCH 50/54] update rust samples --- .../rust/reqwest/petstore-async/src/apis/pet_api.rs | 10 ++++++++-- .../petstore/rust/reqwest/petstore/src/apis/pet_api.rs | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs index 741c3fa741..099ea08daa 100644 --- a/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore-async/src/apis/pet_api.rs @@ -299,7 +299,10 @@ pub async fn find_pets_by_status(configuration: &configuration::Configuration, p let local_var_uri_str = format!("{}/pet/findByStatus", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - local_var_req_builder = local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]); + local_var_req_builder = match "csv" { + "multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p)).collect::>()), + _ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } @@ -337,7 +340,10 @@ pub async fn find_pets_by_tags(configuration: &configuration::Configuration, par let local_var_uri_str = format!("{}/pet/findByTags", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - local_var_req_builder = local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]); + local_var_req_builder = match "csv" { + "multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p)).collect::>()), + _ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } diff --git a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs index 7718490b73..214dbd71b0 100644 --- a/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs +++ b/samples/client/petstore/rust/reqwest/petstore/src/apis/pet_api.rs @@ -155,7 +155,10 @@ pub fn find_pets_by_status(configuration: &configuration::Configuration, status: let local_var_uri_str = format!("{}/pet/findByStatus", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - local_var_req_builder = local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]); + local_var_req_builder = match "csv" { + "multi" => local_var_req_builder.query(&status.into_iter().map(|p| ("status".to_owned(), p)).collect::>()), + _ => local_var_req_builder.query(&[("status", &status.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } @@ -187,7 +190,10 @@ pub fn find_pets_by_tags(configuration: &configuration::Configuration, tags: Vec let local_var_uri_str = format!("{}/pet/findByTags", local_var_configuration.base_path); let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); - local_var_req_builder = local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]); + local_var_req_builder = match "csv" { + "multi" => local_var_req_builder.query(&tags.into_iter().map(|p| ("tags".to_owned(), p)).collect::>()), + _ => local_var_req_builder.query(&[("tags", &tags.into_iter().map(|p| p.to_string()).collect::>().join(",").to_string())]), + }; if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } From 48a8f255c9e7fb867749b03f31e0139e7d099c9a Mon Sep 17 00:00:00 2001 From: jiangyuan <469391363@qq.com> Date: Wed, 29 Dec 2021 20:25:43 +0800 Subject: [PATCH 51/54] fix CI Docs build fail (#11196) Co-authored-by: jiangyuan04 --- samples/meta-codegen/lib/pom.xml | 2 +- samples/meta-codegen/usage/.openapi-generator/VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/meta-codegen/lib/pom.xml b/samples/meta-codegen/lib/pom.xml index 9587ea668d..b078605c90 100644 --- a/samples/meta-codegen/lib/pom.xml +++ b/samples/meta-codegen/lib/pom.xml @@ -121,7 +121,7 @@ UTF-8 - 5.3.1 + 5.4.0-SNAPSHOT 1.0.0 4.13.2 diff --git a/samples/meta-codegen/usage/.openapi-generator/VERSION b/samples/meta-codegen/usage/.openapi-generator/VERSION index 7d3cdbf0dd..0984c4c1ad 100644 --- a/samples/meta-codegen/usage/.openapi-generator/VERSION +++ b/samples/meta-codegen/usage/.openapi-generator/VERSION @@ -1 +1 @@ -5.3.1 \ No newline at end of file +5.4.0-SNAPSHOT \ No newline at end of file From 8a3b434d54de4639295a34c332707678d4f44038 Mon Sep 17 00:00:00 2001 From: Hiromi Hishida Date: Thu, 30 Dec 2021 19:57:01 +0900 Subject: [PATCH 52/54] [php] Handle \SplFileObject before primitive(to avoid php8 settype() error) (#11184) * Handle \SplFileObject before primitive(to avoid php8 settype() error) * Add test case * Add array check to fix type error Code throws error: array_key_exists() expects parameter 2 to be array, null given When $httpHeaders argument is null. Co-authored-by: Yuriy Belenko --- .../resources/php/ObjectSerializer.mustache | 24 ++++++----- .../lib/ObjectSerializer.php | 24 ++++++----- .../tests/ObjectSerializerTest.php | 40 +++++++++++++++++++ 3 files changed, 70 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache index 2d5c2c9113..6d1193099c 100644 --- a/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache +++ b/modules/openapi-generator/src/main/resources/php/ObjectSerializer.mustache @@ -323,18 +323,15 @@ class ObjectSerializer } } - /** @psalm-suppress ParadoxicalCondition */ - if (in_array($class, [{{&primitives}}], true)) { - settype($data, $class); - return $data; - } - if ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); @@ -347,7 +344,16 @@ class ObjectSerializer fclose($file); return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, [{{&primitives}}], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); diff --git a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php index 017633db76..9d9562bb66 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php +++ b/samples/client/petstore/php/OpenAPIClient-php/lib/ObjectSerializer.php @@ -332,18 +332,15 @@ class ObjectSerializer } } - /** @psalm-suppress ParadoxicalCondition */ - if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { - settype($data, $class); - return $data; - } - if ($class === '\SplFileObject') { /** @var \Psr\Http\Message\StreamInterface $data */ // determine file name - if (array_key_exists('Content-Disposition', $httpHeaders) && - preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); } else { $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); @@ -356,7 +353,16 @@ class ObjectSerializer fclose($file); return new \SplFileObject($filename, 'r'); - } elseif (method_exists($class, 'getAllowableEnumValues')) { + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { if (!in_array($data, $class::getAllowableEnumValues(), true)) { $imploded = implode("', '", $class::getAllowableEnumValues()); throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); diff --git a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php index 818568873a..d7cc4a173f 100644 --- a/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php +++ b/samples/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php @@ -2,7 +2,9 @@ namespace OpenAPI\Client; +use GuzzleHttp\Psr7\Utils; use PHPUnit\Framework\TestCase; +use Psr\Http\Message\StreamInterface; // test object serializer class ObjectSerializerTest extends TestCase @@ -24,4 +26,42 @@ class ObjectSerializerTest extends TestCase $this->assertSame("sun.gif", $s->sanitizeFilename("c:\var\tmp\sun.gif")); $this->assertSame("sun.gif", $s->sanitizeFilename(".\sun.gif")); } + + /** + * Test SplFileObject class deserialization. + * + * @see https://github.com/OpenAPITools/openapi-generator/pull/11184 + * @covers ObjectSerializer::serialize + * @dataProvider provideFileStreams + */ + public function testDeserializeFile(StreamInterface $stream, ?array $httpHeaders = null, ?string $expectedFilename = null): void + { + $s = new ObjectSerializer(); + + /** @var \SplFileObject */ + $file = $s->deserialize($stream, '\SplFileObject', $httpHeaders); + $this->assertInstanceOf(\SplFileObject::class, $file); + + if (is_string($expectedFilename)) { + $this->assertEquals($expectedFilename, $file->getFilename()); + } else { + $this->assertNotEquals($expectedFilename, $file->getFilename()); + } + } + + public function provideFileStreams() + { + return [ + 'File stream without headers' => [ + Utils::streamFor(\fopen(__FILE__, 'r')), + null, + null, + ], + 'File stream with Content-Disposition header' => [ + Utils::streamFor(\fopen(__FILE__, 'r')), + ['Content-Disposition' => 'inline; filename=\'foobar.php\''], + 'foobar.php', + ], + ]; + } } From 9c3cba9b86311952f4132d19796a656f2b4daf3e Mon Sep 17 00:00:00 2001 From: Jarrod Parkes Date: Sun, 2 Jan 2022 00:51:15 -0600 Subject: [PATCH 53/54] [swift5] Add property `x-null-encodable` extension for full control over encoding value/nil or nothing (#11141) * feat(ISSUE-11033): add null encodable type and mustache changes * feat(ISSUE-11033): regen all swift5 samples * feat(ISSUE-11033): add swift5 examples of null encodable * feat(ISSUE-11033): fix hashable and compliation issues * fix(ISSUE-11033): fix tests by using new enum encodeValue * fix(ISSUE-11033): fix tests by using new enum encodeValue * fix(ISSUE-11033): revert status back in pet api test * fix(ISSUE-11033): fix issue with objc compat generator * feat(ISSUE-11033): restore default values to null encodables * chore(ISSUE-11033): rename default value for null encodable * chore(ISSUE-11033): add test cases with different nullable defaults --- .../languages/Swift5ClientCodegen.java | 10 +++++++ .../src/main/resources/swift5/Models.mustache | 30 +++++++++++++++++++ .../resources/swift5/modelObject.mustache | 25 +++++++++++++--- .../main/resources/swift5/model_doc.mustache | 2 +- ...ith-fake-endpoints-models-for-testing.yaml | 4 +++ .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../swift5/alamofireLibrary/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../swift5/asyncAwaitLibrary/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../swift5/combineLibrary/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../petstore/swift5/frozenEnums/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../petstore/swift5/nonPublicApi/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 15 +++++++--- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../swift5/objcCompatible/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../swift5/promisekitLibrary/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../swift5/readonlyProperties/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../swift5/resultLibrary/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../swift5/rxswiftLibrary/docs/Name.md | 2 +- .../Sources/PetstoreClient/Models.swift | 30 +++++++++++++++++++ .../Sources/PetstoreClient/Models/Name.swift | 11 ++++--- .../Sources/PetstoreClient/Models/Pet.swift | 11 ++++--- .../SwaggerClientTests/PetAPITests.swift | 2 +- .../swift5/urlsessionLibrary/docs/Name.md | 2 +- .../Classes/OpenAPIs/Models.swift | 30 +++++++++++++++++++ .../Classes/OpenAPIs/Models/Name.swift | 9 ++++-- .../Classes/OpenAPIs/Models/Pet.swift | 9 ++++-- .../swift5/x-swift-hashable/docs/Name.md | 2 +- 61 files changed, 684 insertions(+), 97 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java index 21e7a03c88..b853bf351c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/Swift5ClientCodegen.java @@ -1110,6 +1110,16 @@ public class Swift5ClientCodegen extends DefaultCodegen implements CodegenConfig prop.vendorExtensions.put("x-codegen-escaped-property-name", true); modelHasPropertyWithEscapedName = true; } + + if (prop.vendorExtensions.containsKey("x-null-encodable")) { + if (prop.vendorExtensions.get("x-null-encodable").toString().equals("true")) { + if (prop.defaultValue == null || prop.defaultValue.equals("null")) { + prop.vendorExtensions.put("x-null-encodable-default-value", ".encodeNull"); + } else { + prop.vendorExtensions.put("x-null-encodable-default-value", ".encodeValue(" + prop.defaultValue + ")"); + } + } + } } if (modelHasPropertyWithEscapedName) { cm.vendorExtensions.put("x-codegen-has-escaped-property-names", true); diff --git a/modules/openapi-generator/src/main/resources/swift5/Models.mustache b/modules/openapi-generator/src/main/resources/swift5/Models.mustache index 28d9935dd5..e0cbb9087a 100644 --- a/modules/openapi-generator/src/main/resources/swift5/Models.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/Models.mustache @@ -37,6 +37,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache index fb00843bde..713bc30549 100644 --- a/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/modelObject.mustache @@ -11,17 +11,26 @@ {{#isEnum}} {{#description}}/** {{{.}}} */ {{/description}}{{#deprecated}}@available(*, deprecated, message: "This property is deprecated.") - {{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{{name}}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}} + {{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{{name}}}: {{#vendorExtensions.x-null-encodable}}NullEncodable<{{{datatypeWithEnum}}}>{{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}{{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{/vendorExtensions.x-null-encodable}}{{#defaultValue}} = {{#vendorExtensions.x-null-encodable}}{{{vendorExtensions.x-null-encodable-default-value}}}{{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}{{{.}}}{{/vendorExtensions.x-null-encodable}}{{/defaultValue}} {{/isEnum}} {{^isEnum}} {{#description}}/** {{{.}}} */ {{/description}}{{#deprecated}}@available(*, deprecated, message: "This property is deprecated.") - {{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{{name}}}: {{{datatype}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}} + {{/deprecated}}{{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} {{#readonlyProperties}}private(set) {{/readonlyProperties}}var {{{name}}}: {{#vendorExtensions.x-null-encodable}}NullEncodable<{{{datatype}}}>{{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}{{{datatype}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{/vendorExtensions.x-null-encodable}}{{#defaultValue}} = {{#vendorExtensions.x-null-encodable}}{{{vendorExtensions.x-null-encodable-default-value}}}{{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}{{{.}}}{{/vendorExtensions.x-null-encodable}}{{/defaultValue}} {{#objcCompatible}} {{#vendorExtensions.x-swift-optional-scalar}} {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} var {{{name}}}Num: NSNumber? { get { + {{^vendorExtensions.x-null-encodable}} return {{{name}}} as NSNumber? + {{/vendorExtensions.x-null-encodable}} + {{#vendorExtensions.x-null-encodable}} + if case .encodeValue(let value) = {{name}} { + return value as NSNumber? + } else { + return nil + } + {{/vendorExtensions.x-null-encodable}} } } {{/vendorExtensions.x-swift-optional-scalar}} @@ -30,7 +39,7 @@ {{/allVars}} {{#hasVars}} - {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init({{#allVars}}{{{name}}}: {{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{^defaultValue}}{{^required}} = nil{{/required}}{{/defaultValue}}{{^-last}}, {{/-last}}{{/allVars}}) { + {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} init({{#allVars}}{{{name}}}: {{#vendorExtensions.x-null-encodable}}NullEncodable<{{{datatypeWithEnum}}}>{{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}{{{datatypeWithEnum}}}{{#required}}{{#isNullable}}?{{/isNullable}}{{/required}}{{^required}}?{{/required}}{{/vendorExtensions.x-null-encodable}}{{#defaultValue}} = {{#vendorExtensions.x-null-encodable}}{{{vendorExtensions.x-null-encodable-default-value}}}{{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}{{{.}}}{{/vendorExtensions.x-null-encodable}}{{/defaultValue}}{{^defaultValue}}{{^required}} = {{#vendorExtensions.x-null-encodable}}.encodeNull{{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}nil{{/vendorExtensions.x-null-encodable}}{{/required}}{{/defaultValue}}{{^-last}}, {{/-last}}{{/allVars}}) { {{#allVars}} self.{{{name}}} = {{{name}}} {{/allVars}} @@ -63,7 +72,15 @@ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) {{#allVars}} + {{#vendorExtensions.x-null-encodable}} + switch {{{name}}} { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode({{{name}}}, forKey: .{{{name}}}) + } + {{/vendorExtensions.x-null-encodable}} + {{^vendorExtensions.x-null-encodable}} try container.encode{{^required}}IfPresent{{/required}}({{{name}}}, forKey: .{{{name}}}) + {{/vendorExtensions.x-null-encodable}} {{/allVars}} {{#generateModelAdditionalProperties}} {{#additionalPropertiesType}} @@ -98,7 +115,7 @@ {{#nonPublicApi}}internal{{/nonPublicApi}}{{^nonPublicApi}}public{{/nonPublicApi}} func hash(into hasher: inout Hasher) { {{#allVars}} - hasher.combine({{{name}}}{{^required}}?{{/required}}.hashValue) + hasher.combine({{{name}}}{{^vendorExtensions.x-null-encodable}}{{^required}}?{{/required}}{{/vendorExtensions.x-null-encodable}}.hashValue) {{/allVars}} {{#generateModelAdditionalProperties}}{{#additionalPropertiesType}}hasher.combine(additionalProperties.hashValue){{/additionalPropertiesType}}{{/generateModelAdditionalProperties}} }{{/vendorExtensions.x-swift-hashable}}{{/useClasses}}{{/objcCompatible}} diff --git a/modules/openapi-generator/src/main/resources/swift5/model_doc.mustache b/modules/openapi-generator/src/main/resources/swift5/model_doc.mustache index 6b68575707..952fc7deb0 100644 --- a/modules/openapi-generator/src/main/resources/swift5/model_doc.mustache +++ b/modules/openapi-generator/src/main/resources/swift5/model_doc.mustache @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isContainer}}[**{{dataType}}**]({{complexType}}.md){{/isContainer}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{#vars}}**{{{name}}}** | {{#isPrimitiveType}}**{{{dataType}}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isContainer}}[**{{dataType}}**]({{complexType}}.md){{/isContainer}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{#vendorExtensions.x-null-encodable}}.encodeValue({{{.}}}){{/vendorExtensions.x-null-encodable}}{{^vendorExtensions.x-null-encodable}}{{{.}}}{{/vendorExtensions.x-null-encodable}}]{{/defaultValue}} {{/vars}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml index 6fa25c3021..588fde8671 100644 --- a/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1169,6 +1169,8 @@ definitions: status: type: string description: pet status in the store + x-null-encodable: true + default: null enum: - available - pending @@ -1212,6 +1214,8 @@ definitions: readOnly: true type: integer format: int32 + x-null-encodable: true + default: 11033 property: type: string 123Number: diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index fc69bffcc1..cace428fb5 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -37,6 +37,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33c..8698915e5e 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ddd1186b89..bceec7ccb5 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 9dfbc9aa46..dceab177da 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -28,7 +28,7 @@ class PetAPITests: XCTestCase { let expectation = self.expectation(description: "testCreatePet") let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) + let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .encodeValue(.available)) PetAPI.addPet(body: newPet) { (_, error) in guard error == nil else { diff --git a/samples/client/petstore/swift5/alamofireLibrary/docs/Name.md b/samples/client/petstore/swift5/alamofireLibrary/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/alamofireLibrary/docs/Name.md +++ b/samples/client/petstore/swift5/alamofireLibrary/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33c..8698915e5e 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ddd1186b89..bceec7ccb5 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/Name.md b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/docs/Name.md +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33c..8698915e5e 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ddd1186b89..bceec7ccb5 100644 --- a/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/combineLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index 29c50819e2..b29d79aa36 100644 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -32,7 +32,7 @@ class PetAPITests: XCTestCase { let expectation = self.expectation(description: "testCreatePet") let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) + let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .encodeValue(.available)) PetAPI.addPet(body: newPet).sink(receiveCompletion: { (completion) in switch completion { diff --git a/samples/client/petstore/swift5/combineLibrary/docs/Name.md b/samples/client/petstore/swift5/combineLibrary/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/combineLibrary/docs/Name.md +++ b/samples/client/petstore/swift5/combineLibrary/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/deprecated/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33c..8698915e5e 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 45b4cff8e1..a0e8a03c82 100644 --- a/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/frozenEnums/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -24,9 +24,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -53,7 +53,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/frozenEnums/docs/Name.md b/samples/client/petstore/swift5/frozenEnums/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/frozenEnums/docs/Name.md +++ b/samples/client/petstore/swift5/frozenEnums/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift index 7fcbd1ee51..b91c1d2327 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + internal enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 2a842bf54a..59807f7620 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable internal struct Name: Codable, Hashable { internal var name: Int - internal var snakeCase: Int? + internal var snakeCase: NullEncodable = .encodeValue(11033) internal var property: String? internal var _123number: Int? - internal init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + internal init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ internal struct Name: Codable, Hashable { internal func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index 8c77a382e8..ca9db44f24 100644 --- a/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/nonPublicApi/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ internal struct Pet: Codable, Hashable { internal var photoUrls: [String] internal var tags: [Tag]? /** pet status in the store */ - internal var status: Status? + internal var status: NullEncodable - internal init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + internal init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ internal struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/nonPublicApi/docs/Name.md b/samples/client/petstore/swift5/nonPublicApi/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/nonPublicApi/docs/Name.md +++ b/samples/client/petstore/swift5/nonPublicApi/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 3b41f3cafd..e1fed77c4a 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,10 +14,14 @@ import AnyCodable @objc public class Name: NSObject, Codable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var snakeCaseNum: NSNumber? { get { - return snakeCase as NSNumber? + if case .encodeValue(let value) = snakeCase { + return value as NSNumber? + } else { + return nil + } } } public var property: String? @@ -28,7 +32,7 @@ import AnyCodable } } - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -47,7 +51,10 @@ import AnyCodable public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index a59ef82eb8..d4d38218ec 100644 --- a/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -28,9 +28,9 @@ import AnyCodable public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(_id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(_id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self._id = _id self.category = category self.name = name @@ -57,7 +57,10 @@ import AnyCodable try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/objcCompatible/docs/Name.md b/samples/client/petstore/swift5/objcCompatible/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/objcCompatible/docs/Name.md +++ b/samples/client/petstore/swift5/objcCompatible/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/oneOf/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33c..8698915e5e 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ddd1186b89..bceec7ccb5 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index ff6de167c8..b0c0d84861 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -29,7 +29,7 @@ class PetAPITests: XCTestCase { let expectation = self.expectation(description: "testCreatePet") let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) + let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .encodeValue(.available)) PetAPI.addPet(body: newPet).done { expectation.fulfill() diff --git a/samples/client/petstore/swift5/promisekitLibrary/docs/Name.md b/samples/client/petstore/swift5/promisekitLibrary/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/promisekitLibrary/docs/Name.md +++ b/samples/client/petstore/swift5/promisekitLibrary/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 0280404c04..cf7c009491 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public private(set) var name: Int - public private(set) var snakeCase: Int? + public private(set) var snakeCase: NullEncodable = .encodeValue(11033) public private(set) var property: String? public private(set) var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index f4f7928e77..5ba4da07a5 100644 --- a/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/readonlyProperties/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public private(set) var photoUrls: [String] public private(set) var tags: [Tag]? /** pet status in the store */ - public private(set) var status: Status? + public private(set) var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/readonlyProperties/docs/Name.md b/samples/client/petstore/swift5/readonlyProperties/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/readonlyProperties/docs/Name.md +++ b/samples/client/petstore/swift5/readonlyProperties/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33c..8698915e5e 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ddd1186b89..bceec7ccb5 100644 --- a/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/resultLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/resultLibrary/docs/Name.md b/samples/client/petstore/swift5/resultLibrary/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/resultLibrary/docs/Name.md +++ b/samples/client/petstore/swift5/resultLibrary/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index a28f46a33c..8698915e5e 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ddd1186b89..bceec7ccb5 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index d5da81a120..e3d966aebd 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -30,7 +30,7 @@ class PetAPITests: XCTestCase { let expectation = self.expectation(description: "testCreatePet") let category = Category(id: 1234, name: "eyeColor") let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] - let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) + let newPet = Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .encodeValue(.available)) PetAPI.addPet(body: newPet).subscribe(onNext: { expectation.fulfill() diff --git a/samples/client/petstore/swift5/rxswiftLibrary/docs/Name.md b/samples/client/petstore/swift5/rxswiftLibrary/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/rxswiftLibrary/docs/Name.md +++ b/samples/client/petstore/swift5/rxswiftLibrary/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift index fee33da7dd..c7c6374fcd 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Name.swift @@ -19,11 +19,11 @@ extension PetstoreClientAPI { public final class Name: Codable, Hashable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -42,7 +42,10 @@ public final class Name: Codable, Hashable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } @@ -57,7 +60,7 @@ public final class Name: Codable, Hashable { public func hash(into hasher: inout Hasher) { hasher.combine(name.hashValue) - hasher.combine(snakeCase?.hashValue) + hasher.combine(snakeCase.hashValue) hasher.combine(property?.hashValue) hasher.combine(_123number?.hashValue) diff --git a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift index 63628629df..c764a418de 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/Sources/PetstoreClient/Models/Pet.swift @@ -28,9 +28,9 @@ public final class Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -57,7 +57,10 @@ public final class Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } public static func == (lhs: Pet, rhs: Pet) -> Bool { @@ -76,7 +79,7 @@ public final class Pet: Codable, Hashable { hasher.combine(name.hashValue) hasher.combine(photoUrls.hashValue) hasher.combine(tags?.hashValue) - hasher.combine(status?.hashValue) + hasher.combine(status.hashValue) } } diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift index f1a26cdd41..f02cf21e69 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -28,7 +28,7 @@ class PetAPITests: XCTestCase { let expectation = self.expectation(description: "testCreatePet") let category = PetstoreClientAPI.Category(id: 1234, name: "eyeColor") let tags = [PetstoreClientAPI.Tag(id: 1234, name: "New York"), PetstoreClientAPI.Tag(id: 124321, name: "Jose")] - let newPet = PetstoreClientAPI.Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) + let newPet = PetstoreClientAPI.Pet(id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .encodeValue(.available)) PetstoreClientAPI.PetAPI.addPet(body: newPet) { (_, error) in guard error == nil else { diff --git a/samples/client/petstore/swift5/urlsessionLibrary/docs/Name.md b/samples/client/petstore/swift5/urlsessionLibrary/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/urlsessionLibrary/docs/Name.md +++ b/samples/client/petstore/swift5/urlsessionLibrary/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift index 7cb4e06d16..0079b465ca 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models.swift @@ -36,6 +36,36 @@ extension CaseIterableDefaultsLast { } } +/// A flexible type that can be encoded (`.encodeNull` or `.encodeValue`) +/// or not encoded (`.encodeNothing`). Intended for request payloads. +public enum NullEncodable: Hashable { + case encodeNothing + case encodeNull + case encodeValue(Wrapped) +} + +extension NullEncodable: Codable where Wrapped: Codable { + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + if let value = try? container.decode(Wrapped.self) { + self = .encodeValue(value) + } else if container.decodeNil() { + self = .encodeNull + } else { + self = .encodeNothing + } + } + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .encodeNothing: return + case .encodeNull: try container.encodeNil() + case .encodeValue(let wrapped): try container.encode(wrapped) + } + } +} + public enum ErrorResponse: Error { case error(Int, Data?, URLResponse?, Error) } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift index 15308075d9..e38ffc2eeb 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Name.swift @@ -14,11 +14,11 @@ import AnyCodable public struct Name: Codable { public var name: Int - public var snakeCase: Int? + public var snakeCase: NullEncodable = .encodeValue(11033) public var property: String? public var _123number: Int? - public init(name: Int, snakeCase: Int? = nil, property: String? = nil, _123number: Int? = nil) { + public init(name: Int, snakeCase: NullEncodable = .encodeValue(11033), property: String? = nil, _123number: Int? = nil) { self.name = name self.snakeCase = snakeCase self.property = property @@ -37,7 +37,10 @@ public struct Name: Codable { public func encode(to encoder: Encoder) throws { var container = encoder.container(keyedBy: CodingKeys.self) try container.encode(name, forKey: .name) - try container.encodeIfPresent(snakeCase, forKey: .snakeCase) + switch snakeCase { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(snakeCase, forKey: .snakeCase) + } try container.encodeIfPresent(property, forKey: .property) try container.encodeIfPresent(_123number, forKey: ._123number) } diff --git a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift index ddd1186b89..bceec7ccb5 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift +++ b/samples/client/petstore/swift5/x-swift-hashable/PetstoreClient/Classes/OpenAPIs/Models/Pet.swift @@ -23,9 +23,9 @@ public struct Pet: Codable, Hashable { public var photoUrls: [String] public var tags: [Tag]? /** pet status in the store */ - public var status: Status? + public var status: NullEncodable - public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: Status? = nil) { + public init(id: Int64? = nil, category: Category? = nil, name: String, photoUrls: [String], tags: [Tag]? = nil, status: NullEncodable = .encodeNull) { self.id = id self.category = category self.name = name @@ -52,7 +52,10 @@ public struct Pet: Codable, Hashable { try container.encode(name, forKey: .name) try container.encode(photoUrls, forKey: .photoUrls) try container.encodeIfPresent(tags, forKey: .tags) - try container.encodeIfPresent(status, forKey: .status) + switch status { + case .encodeNothing: break + case .encodeNull, .encodeValue: try container.encode(status, forKey: .status) + } } } diff --git a/samples/client/petstore/swift5/x-swift-hashable/docs/Name.md b/samples/client/petstore/swift5/x-swift-hashable/docs/Name.md index f7b180292c..507efd90b3 100644 --- a/samples/client/petstore/swift5/x-swift-hashable/docs/Name.md +++ b/samples/client/petstore/swift5/x-swift-hashable/docs/Name.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **Int** | | -**snakeCase** | **Int** | | [optional] [readonly] +**snakeCase** | **Int** | | [optional] [readonly] [default to .encodeValue(11033)] **property** | **String** | | [optional] **_123number** | **Int** | | [optional] [readonly] From 8d532d5a38b976611534cc66291ca0cda8d0d60c Mon Sep 17 00:00:00 2001 From: sullis Date: Sat, 1 Jan 2022 22:53:30 -0800 Subject: [PATCH 54/54] [scala-gatling] use the official Gradle plugin (#11208) --- .../src/main/resources/scala-gatling/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle b/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle index a9a3eb68da..5b794168bd 100644 --- a/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle +++ b/modules/openapi-generator/src/main/resources/scala-gatling/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'com.github.lkishalmi.gatling' version '0.7.1' + id 'io.gatling.gradle' version '3.7.3' } repositories { @@ -10,7 +10,7 @@ dependencies { } -apply plugin: "com.github.lkishalmi.gatling" +apply plugin: "io.gatling.gradle" gatling { toolVersion = '2.3.0' @@ -26,4 +26,4 @@ gatling { '-XX:+CMSParallelRemarkEnabled', '-Djava.net.preferIPv4Stack=true', '-Djava.net.preferIPv6Addresses=false'] -} \ No newline at end of file +}