From aa09a7d5ac7dd67dfee04932f5e42fd3253ff8f8 Mon Sep 17 00:00:00 2001 From: Jan Weinschenker <jan.weinschenker@holisticon.de> Date: Mon, 30 Sep 2019 20:45:08 +0200 Subject: [PATCH 1/4] feat: allow creation of kotlin data classes that implement java.io.Serializable, by adding the config option serializableModel=(true|false) --- bin/kotlin-client-petstore.sh | 2 +- bin/kotlin-client-string.sh | 2 +- bin/kotlin-server-petstore.sh | 2 +- bin/kotlin-springboot-petstore-server.sh | 2 +- bin/openapi3/kotlin-client-petstore.sh | 2 +- .../kotlin-springboot-petstore-server.sh | 2 +- .../src/main/resources/static/rapidoc-min.js | 2 +- .../languages/AbstractKotlinCodegen.java | 15 ++ .../kotlin-client/data_class.mustache | 7 +- .../kotlin-server/data_class.mustache | 8 +- .../kotlin/.openapi-generator/VERSION | 2 +- .../openapitools/client/models/ApiResponse.kt | 9 +- .../openapitools/client/models/Category.kt | 9 +- .../org/openapitools/client/models/Order.kt | 9 +- .../org/openapitools/client/models/Pet.kt | 9 +- .../org/openapitools/client/models/Tag.kt | 9 +- .../org/openapitools/client/models/User.kt | 9 +- .../kotlin/.openapi-generator/VERSION | 2 +- .../openapi3/client/petstore/kotlin/README.md | 5 +- .../client/petstore/kotlin/build.gradle | 22 ++- .../client/petstore/kotlin/settings.gradle | 1 + .../client/infrastructure/ApiAbstractions.kt | 7 +- .../models/AdditionalPropertiesClass.kt | 9 +- .../org/openapitools/client/models/Animal.kt | 9 +- .../openapitools/client/models/ApiResponse.kt | 9 +- .../client/models/ArrayOfArrayOfNumberOnly.kt | 9 +- .../client/models/ArrayOfNumberOnly.kt | 9 +- .../openapitools/client/models/ArrayTest.kt | 9 +- .../client/models/Capitalization.kt | 9 +- .../org/openapitools/client/models/Cat.kt | 9 +- .../openapitools/client/models/CatAllOf.kt | 9 +- .../openapitools/client/models/Category.kt | 9 +- .../openapitools/client/models/ClassModel.kt | 9 +- .../org/openapitools/client/models/Client.kt | 9 +- .../org/openapitools/client/models/Dog.kt | 9 +- .../openapitools/client/models/DogAllOf.kt | 9 +- .../openapitools/client/models/EnumArrays.kt | 18 +- .../openapitools/client/models/EnumClass.kt | 2 + .../openapitools/client/models/EnumTest.kt | 26 ++- .../client/models/FileSchemaTestClass.kt | 9 +- .../org/openapitools/client/models/Foo.kt | 9 +- .../openapitools/client/models/FormatTest.kt | 9 +- .../client/models/HasOnlyReadOnly.kt | 9 +- .../client/models/HealthCheckResult.kt | 9 +- .../client/models/InlineObject.kt | 9 +- .../client/models/InlineObject1.kt | 9 +- .../client/models/InlineObject2.kt | 18 +- .../client/models/InlineObject3.kt | 9 +- .../client/models/InlineObject4.kt | 9 +- .../client/models/InlineObject5.kt | 9 +- .../client/models/InlineResponseDefault.kt | 9 +- .../org/openapitools/client/models/List.kt | 13 +- .../org/openapitools/client/models/MapTest.kt | 14 +- ...dPropertiesAndAdditionalPropertiesClass.kt | 9 +- .../client/models/Model200Response.kt | 9 +- .../org/openapitools/client/models/Name.kt | 13 +- .../client/models/NullableClass.kt | 9 +- .../openapitools/client/models/NumberOnly.kt | 9 +- .../org/openapitools/client/models/Order.kt | 14 +- .../client/models/OuterComposite.kt | 9 +- .../openapitools/client/models/OuterEnum.kt | 2 + .../client/models/OuterEnumDefaultValue.kt | 2 + .../client/models/OuterEnumInteger.kt | 2 + .../models/OuterEnumIntegerDefaultValue.kt | 2 + .../org/openapitools/client/models/Pet.kt | 14 +- .../client/models/ReadOnlyFirst.kt | 9 +- .../org/openapitools/client/models/Return.kt | 13 +- .../client/models/SpecialModelname.kt | 9 +- .../org/openapitools/client/models/Tag.kt | 9 +- .../org/openapitools/client/models/User.kt | 9 +- .../.openapi-generator/VERSION | 2 +- .../build.gradle.kts | 2 + .../kotlin-springboot-reactive/pom.xml | 12 ++ .../kotlin/org/openapitools/api/PetApi.kt | 177 +++++++++--------- .../org/openapitools/api/PetApiService.kt | 12 +- .../org/openapitools/api/PetApiServiceImpl.kt | 12 +- .../kotlin/org/openapitools/api/StoreApi.kt | 80 ++++---- .../org/openapitools/api/StoreApiService.kt | 6 +- .../openapitools/api/StoreApiServiceImpl.kt | 6 +- .../kotlin/org/openapitools/api/UserApi.kt | 152 +++++++-------- .../org/openapitools/api/UserApiService.kt | 8 +- .../openapitools/api/UserApiServiceImpl.kt | 8 +- .../kotlin/org/openapitools/model/Category.kt | 4 +- .../org/openapitools/model/InlineObject.kt | 4 +- .../org/openapitools/model/InlineObject1.kt | 2 +- .../openapitools/model/ModelApiResponse.kt | 6 +- .../kotlin/org/openapitools/model/Order.kt | 10 +- .../main/kotlin/org/openapitools/model/Pet.kt | 10 +- .../main/kotlin/org/openapitools/model/Tag.kt | 4 +- .../kotlin/org/openapitools/model/User.kt | 16 +- .../.openapi-generator/VERSION | 2 +- .../server/petstore/kotlin-springboot/pom.xml | 6 + .../kotlin/org/openapitools/api/PetApi.kt | 157 ++++++++-------- .../org/openapitools/api/PetApiService.kt | 2 +- .../org/openapitools/api/PetApiServiceImpl.kt | 2 +- .../kotlin/org/openapitools/api/StoreApi.kt | 74 ++++---- .../kotlin/org/openapitools/api/UserApi.kt | 140 +++++++------- .../ktor/.openapi-generator/VERSION | 2 +- .../petstore/kotlin-server/ktor/README.md | 2 +- .../openapitools/server/models/ApiResponse.kt | 10 +- .../openapitools/server/models/Category.kt | 10 +- .../org/openapitools/server/models/Order.kt | 10 +- .../org/openapitools/server/models/Pet.kt | 10 +- .../org/openapitools/server/models/Tag.kt | 10 +- .../org/openapitools/server/models/User.kt | 10 +- 105 files changed, 1024 insertions(+), 552 deletions(-) diff --git a/bin/kotlin-client-petstore.sh b/bin/kotlin-client-petstore.sh index cad4be6995e..820c3fc4bd9 100755 --- a/bin/kotlin-client-petstore.sh +++ b/bin/kotlin-client-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8 -o samples/client/petstore/kotlin $@" +ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true,parcelizeModels=true -o samples/client/petstore/kotlin $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-string.sh b/bin/kotlin-client-string.sh index 410ddbab399..e0af2514075 100755 --- a/bin/kotlin-client-string.sh +++ b/bin/kotlin-client-string.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-string --additional-properties dateLibrary=string -o samples/client/petstore/kotlin-string $@" +ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-string --additional-properties dateLibrary=string,serializableModel=true,parcelizeModels=true -o samples/client/petstore/kotlin-string $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-server-petstore.sh b/bin/kotlin-server-petstore.sh index dbdf48b2bbd..57ce7b6296f 100755 --- a/bin/kotlin-server-petstore.sh +++ b/bin/kotlin-server-petstore.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor --additional-properties hideGenerationTimestamp=true $@" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor --additional-properties hideGenerationTimestamp=true,serializableModel=true,parcelizeModels=true $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-springboot-petstore-server.sh b/bin/kotlin-springboot-petstore-server.sh index 45179767ece..89bc4cce4ef 100755 --- a/bin/kotlin-springboot-petstore-server.sh +++ b/bin/kotlin-springboot-petstore-server.sh @@ -26,7 +26,7 @@ then fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true" +ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true,parcelizeModels=true" echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot" rm -rf samples/server/petstore/kotlin-springboot diff --git a/bin/openapi3/kotlin-client-petstore.sh b/bin/openapi3/kotlin-client-petstore.sh index f426dba223b..2172e549127 100755 --- a/bin/openapi3/kotlin-client-petstore.sh +++ b/bin/openapi3/kotlin-client-petstore.sh @@ -26,7 +26,7 @@ then fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8 -o samples/openapi3/client/petstore/kotlin $@" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true,parcelizeModels=true -o samples/openapi3/client/petstore/kotlin $@" echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin" rm -rf samples/openapi3/client/petstore/kotlin diff --git a/bin/openapi3/kotlin-springboot-petstore-server.sh b/bin/openapi3/kotlin-springboot-petstore-server.sh index b1320abdb0a..f97c81774d1 100755 --- a/bin/openapi3/kotlin-springboot-petstore-server.sh +++ b/bin/openapi3/kotlin-springboot-petstore-server.sh @@ -26,7 +26,7 @@ then fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true" +ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true,parcelizeModels=true" echo "Cleaning previously generated files if any from samples/server/openapi3/petstore/kotlin-springboot" rm -rf samples/server/openapi3/petstore/kotlin-springboot diff --git a/modules/openapi-generator-online/src/main/resources/static/rapidoc-min.js b/modules/openapi-generator-online/src/main/resources/static/rapidoc-min.js index c0178bca82e..0dec8cf0d3a 100644 --- a/modules/openapi-generator-online/src/main/resources/static/rapidoc-min.js +++ b/modules/openapi-generator-online/src/main/resources/static/rapidoc-min.js @@ -69,7 +69,7 @@ class y{constructor(t,e,n){this._parts=[],this.template=t,this.processor=e,this. * subject to an additional IP rights grant found at * http://polymer.github.io/PATENTS.txt */ -const b=t=>null===t||!("object"==typeof t||"function"==typeof t);class w{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new _(this)}_getValue(){const t=this.strings,e=t.length-1;let n="";for(let r=0;r<e;r++){n+=t[r];const e=this.parts[r];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)n+="string"==typeof e?e:String(e);else n+="string"==typeof t?t:String(t)}}return n+=t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class _{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===u||b(t)&&t===this.value||(this.value=t,i(t)||(this.committer.dirty=!0))}commit(){for(;i(this.value);){const t=this.value;this.value=u,t(this)}this.value!==u&&this.committer.commit()}}class x{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(v()),this.endNode=t.appendChild(v())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=v()),t._insert(this.endNode=v())}insertAfterPart(t){t._insert(this.startNode=v()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;i(this._pendingValue);){const t=this._pendingValue;this._pendingValue=u,t(this)}const t=this._pendingValue;t!==u&&(b(t)?t!==this.value&&this._commitText(t):t instanceof m?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):t===a?(this.value=a,this.clear()):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof y&&this.value.template===e)this.value.update(t.values);else{const n=new y(e,t.processor,this.options),r=n._clone();n.update(t.values),this._commitNode(r),this.value=n}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,r=0;for(const i of t)void 0===(n=e[r])&&(n=new x(this.options),e.push(n),0===r?n.appendIntoPart(this):n.insertAfterPart(e[r-1])),n.setValue(i),n.commit(),r++;r<e.length&&(e.length=r,this.clear(n&&n.endNode))}clear(t=this.startNode){s(this.startNode.parentNode,t.nextSibling,this.endNode)}}class S{constructor(t,e,n){if(this.value=void 0,this._pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this._pendingValue=t}commit(){for(;i(this._pendingValue);){const t=this._pendingValue;this._pendingValue=u,t(this)}if(this._pendingValue===u)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=u}}class A extends w{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new O(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class O extends _{}let C=!1;try{const t={get capture(){return C=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class E{constructor(t,e,n){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this._boundHandleEvent=(t=>this.handleEvent(t))}setValue(t){this._pendingValue=t}commit(){for(;i(this._pendingValue);){const t=this._pendingValue;this._pendingValue=u,t(this)}if(this._pendingValue===u)return;const t=this._pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),r&&(this._options=U(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=u}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const U=t=>t&&(C?{capture:t.capture,passive:t.passive,once:t.once}:t.capture); +const b=t=>null===t||!("object"==typeof t||"function"==typeof t);class w{constructor(t,e,n){this.dirty=!0,this.element=t,this.name=e,this.strings=n,this.parts=[];for(let t=0;t<n.length-1;t++)this.parts[t]=this._createPart()}_createPart(){return new _(this)}_getValue(){const t=this.strings,e=t.length-1;let n="";for(let r=0;r<e;r++){n+=t[r];const e=this.parts[r];if(void 0!==e){const t=e.value;if(null!=t&&(Array.isArray(t)||"string"!=typeof t&&t[Symbol.iterator]))for(const e of t)n+="string"==typeof e?e:String(e);else n+="string"==typeof t?t:String(t)}}return n+=t[e]}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}class _{constructor(t){this.value=void 0,this.committer=t}setValue(t){t===u||b(t)&&t===this.value||(this.value=t,i(t)||(this.committer.dirty=!0))}commit(){for(;i(this.value);){const t=this.value;this.value=u,t(this)}this.value!==u&&this.committer.commit()}}class x{constructor(t){this.value=void 0,this._pendingValue=void 0,this.options=t}appendInto(t){this.startNode=t.appendChild(v()),this.endNode=t.appendChild(v())}insertAfterNode(t){this.startNode=t,this.endNode=t.nextSibling}appendIntoPart(t){t._insert(this.startNode=v()),t._insert(this.endNode=v())}insertAfterPart(t){t._insert(this.startNode=v()),this.endNode=t.endNode,t.endNode=this.startNode}setValue(t){this._pendingValue=t}commit(){for(;i(this._pendingValue);){const t=this._pendingValue;this._pendingValue=u,t(this)}const t=this._pendingValue;t!==u&&(b(t)?t!==this.value&&this._commitText(t):t instanceof m?this._commitTemplateResult(t):t instanceof Node?this._commitNode(t):Array.isArray(t)||t[Symbol.iterator]?this._commitIterable(t):t===a?(this.value=a,this.clear()):this._commitText(t))}_insert(t){this.endNode.parentNode.insertBefore(t,this.endNode)}_commitNode(t){this.value!==t&&(this.clear(),this._insert(t),this.value=t)}_commitText(t){const e=this.startNode.nextSibling;t=null==t?"":t,e===this.endNode.previousSibling&&3===e.nodeType?e.data=t:this._commitNode(document.createTextNode("string"==typeof t?t:String(t))),this.value=t}_commitTemplateResult(t){const e=this.options.templateFactory(t);if(this.value instanceof y&&this.value.template===e)this.value.update(t.values);else{const n=new y(e,t.processor,this.options),r=n._clone();n.update(t.values),this._commitNode(r),this.value=n}}_commitIterable(t){Array.isArray(this.value)||(this.value=[],this.clear());const e=this.value;let n,r=0;for(const i of t)void 0===(n=e[r])&&(n=new x(this.options),e.push(n),0===r?n.appendIntoPart(this):n.insertAfterPart(e[r-1])),n.setValue(i),n.commit(),r++;r<e.length&&(e.length=r,this.clear(n&&n.endNode))}clear(t=this.startNode){s(this.startNode.parentNode,t.nextSibling,this.endNode)}}class S{constructor(t,e,n){if(this.value=void 0,this._pendingValue=void 0,2!==n.length||""!==n[0]||""!==n[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=e,this.strings=n}setValue(t){this._pendingValue=t}commit(){for(;i(this._pendingValue);){const t=this._pendingValue;this._pendingValue=u,t(this)}if(this._pendingValue===u)return;const t=!!this._pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name)),this.value=t,this._pendingValue=u}}class bA extends w{constructor(t,e,n){super(t,e,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){return new O(this)}_getValue(){return this.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}class O extends _{}let C=!1;try{const t={get capture(){return C=!0,!1}};window.addEventListener("test",t,t),window.removeEventListener("test",t,t)}catch(t){}class E{constructor(t,e,n){this.value=void 0,this._pendingValue=void 0,this.element=t,this.eventName=e,this.eventContext=n,this._boundHandleEvent=(t=>this.handleEvent(t))}setValue(t){this._pendingValue=t}commit(){for(;i(this._pendingValue);){const t=this._pendingValue;this._pendingValue=u,t(this)}if(this._pendingValue===u)return;const t=this._pendingValue,e=this.value,n=null==t||null!=e&&(t.capture!==e.capture||t.once!==e.once||t.passive!==e.passive),r=null!=t&&(null==e||n);n&&this.element.removeEventListener(this.eventName,this._boundHandleEvent,this._options),r&&(this._options=U(t),this.element.addEventListener(this.eventName,this._boundHandleEvent,this._options)),this.value=t,this._pendingValue=u}handleEvent(t){"function"==typeof this.value?this.value.call(this.eventContext||this.element,t):this.value.handleEvent(t)}}const U=t=>t&&(C?{capture:t.capture,passive:t.passive,once:t.once}:t.capture); /** * @license * Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 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 5351c1fe2d4..ead48fc2e5d 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 @@ -54,6 +54,8 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co protected String modelDocPath = "docs/"; protected boolean parcelizeModels = false; + protected boolean serializableModel = false; + protected CodegenConstants.ENUM_PROPERTY_NAMING_TYPE enumPropertyNaming = CodegenConstants.ENUM_PROPERTY_NAMING_TYPE.camelCase; protected SERIALIZATION_LIBRARY_TYPE serializationLibrary = SERIALIZATION_LIBRARY_TYPE.moshi; @@ -411,6 +413,12 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co LOGGER.warn(CodegenConstants.INVOKER_PACKAGE + " with " + this.getName() + " generator is ignored. Use " + CodegenConstants.PACKAGE_NAME + "."); } + if (additionalProperties.containsKey(CodegenConstants.SERIALIZABLE_MODEL)) { + this.setSerializableModel(Boolean.valueOf((String) additionalProperties.get(CodegenConstants.SERIALIZABLE_MODEL))); + } else { + additionalProperties.put(CodegenConstants.SERIALIZABLE_MODEL, serializableModel); + } + if (additionalProperties.containsKey(CodegenConstants.PARCELIZE_MODELS)) { this.setParcelizeModels(Boolean.valueOf((String) additionalProperties.get(CodegenConstants.PARCELIZE_MODELS))); LOGGER.info(CodegenConstants.PARCELIZE_MODELS + " depends on the android framework and " + @@ -468,6 +476,13 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co this.parcelizeModels = parcelizeModels; } + public boolean isSerializableModel() { + return serializableModel; + } + + public void setSerializableModel(boolean serializableModel) { + this.serializableModel = serializableModel; + } /** * Return the sanitized variable name for enum * 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 0cece22bb0b..c633d11ea8c 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 @@ -15,6 +15,9 @@ import kotlinx.android.parcel.Parcelize import kotlinx.serialization.* import kotlinx.serialization.internal.CommonEnumSerializer {{/multiplatform}} +{{#serializableModel}} +import java.io.Serializable +{{/serializableModel}} /** * {{{description}}} {{#vars}} @@ -31,7 +34,9 @@ data class {{classname}} ( {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, {{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}}, {{/-last}}{{/optionalVars}} -){{#parcelizeModels}} : Parcelable{{/parcelizeModels}} +) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}} +{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}} +{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}} {{#hasEnums}} { {{#vars}}{{#isEnum}} diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache index feb6a0b317e..fe88e433f20 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/data_class.mustache @@ -3,6 +3,9 @@ import android.os.Parcelable import kotlinx.android.parcel.Parcelize {{/parcelizeModels}} +{{#serializableModel}} +import java.io.Serializable +{{/serializableModel}} /** * {{{description}}} {{#vars}} @@ -18,7 +21,10 @@ data class {{classname}} ( {{/-last}}{{/requiredVars}}{{#hasRequired}}{{#hasOptional}}, {{/hasOptional}}{{/hasRequired}}{{#optionalVars}}{{>data_class_opt_var}}{{^-last}}, {{/-last}}{{/optionalVars}} -){{#parcelizeModels}} : Parcelable{{/parcelizeModels}} { +) {{^serializableModel}}{{#parcelizeModels}} : Parcelable{{/parcelizeModels}}{{/serializableModel}} +{{^parcelizeModels}}{{#serializableModel}}: Serializable {{/serializableModel}}{{/parcelizeModels}} +{{#parcelizeModels}}{{#serializableModel}} : Parcelable, Serializable {{/serializableModel}}{{/parcelizeModels}} +{ {{#hasEnums}}{{#vars}}{{#isEnum}} /** * {{{description}}} diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index c3a2c7076fa..0e97bd19efb 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file 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/ApiResponse.kt index ada15fee7a1..36730e94745 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/ApiResponse.kt @@ -13,12 +13,17 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * Describes the result of uploading an image resource * @param code * @param type * @param message */ +@Parcelize data class ApiResponse ( @Json(name = "code") @@ -27,5 +32,7 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) +) + + : Parcelable, Serializable diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 426a0e51592..c0c6521a692 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A category for a pet * @param id * @param name */ +@Parcelize data class Category ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) +) + + : Parcelable, Serializable diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 2e9074a650a..afa77d46b46 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * An order for a pets from the pet store * @param id @@ -22,6 +26,7 @@ import com.squareup.moshi.Json * @param status Order Status * @param complete */ +@Parcelize data class Order ( @Json(name = "id") @@ -37,7 +42,9 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) + + : Parcelable, Serializable { /** diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index d870b69e5e7..ac7415733e4 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -15,6 +15,10 @@ import org.openapitools.client.models.Category import org.openapitools.client.models.Tag import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A pet for sale in the pet store * @param id @@ -24,6 +28,7 @@ import com.squareup.moshi.Json * @param tags * @param status pet status in the store */ +@Parcelize data class Pet ( @Json(name = "name") @@ -39,7 +44,9 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) + + : Parcelable, Serializable { /** diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index f9ef87e13fb..9016441f929 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A tag for a pet * @param id * @param name */ +@Parcelize data class Tag ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) +) + + : Parcelable, Serializable diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index dfd63806da9..d553c9f5f62 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A User who is purchasing from the pet store * @param id @@ -24,6 +28,7 @@ import com.squareup.moshi.Json * @param phone * @param userStatus User Status */ +@Parcelize data class User ( @Json(name = "id") @@ -43,5 +48,7 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) + + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION index 2f81801b794..0e97bd19efb 100644 --- a/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/openapi3/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/README.md b/samples/openapi3/client/petstore/kotlin/README.md index cf1793ec2f6..3738c4b9c91 100644 --- a/samples/openapi3/client/petstore/kotlin/README.md +++ b/samples/openapi3/client/petstore/kotlin/README.md @@ -2,8 +2,8 @@ ## Requires -* Kotlin 1.1.2 -* Gradle 3.3 +* Kotlin 1.3.41 +* Gradle 4.9 ## Build @@ -50,6 +50,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional) *FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties *FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**testQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-paramters | *FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case *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 diff --git a/samples/openapi3/client/petstore/kotlin/build.gradle b/samples/openapi3/client/petstore/kotlin/build.gradle index 8668dab3a7e..c09f7912cfe 100644 --- a/samples/openapi3/client/petstore/kotlin/build.gradle +++ b/samples/openapi3/client/petstore/kotlin/build.gradle @@ -1,13 +1,13 @@ group 'org.openapitools' version '1.0.0' -task wrapper(type: Wrapper) { - gradleVersion = '3.3' +wrapper { + gradleVersion = '4.9' distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" } buildscript { - ext.kotlin_version = '1.1.2' + ext.kotlin_version = '1.3.41' repositories { mavenCentral() @@ -23,11 +23,15 @@ repositories { mavenCentral() } +test { + useJUnitPlatform() +} + dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version" - compile "com.squareup.moshi:moshi-kotlin:1.5.0" - compile "com.squareup.moshi:moshi-adapters:1.5.0" - compile "com.squareup.okhttp3:okhttp:3.8.0" - compile "org.threeten:threetenbp:1.3.6" - testCompile "io.kotlintest:kotlintest:2.0.2" + compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + compile "com.squareup.moshi:moshi-kotlin:1.8.0" + compile "com.squareup.moshi:moshi-adapters:1.8.0" + compile "com.squareup.okhttp3:okhttp:4.0.1" + testImplementation "io.kotlintest:kotlintest-runner-junit5:3.1.0" } diff --git a/samples/openapi3/client/petstore/kotlin/settings.gradle b/samples/openapi3/client/petstore/kotlin/settings.gradle index 17e020387e2..7540d01de36 100644 --- a/samples/openapi3/client/petstore/kotlin/settings.gradle +++ b/samples/openapi3/client/petstore/kotlin/settings.gradle @@ -1 +1,2 @@ + rootProject.name = 'kotlin-petstore-client' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt index c2c3f1f0eae..f97cb88d233 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -12,9 +12,12 @@ fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } -fun <T: Any?> toMultiValue(items: List<T>, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List<String> { +fun <T : Any?> toMultiValue(items: Array<T>, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun <T : Any?> toMultiValue(items: Iterable<T>, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List<String> { return when(collectionFormat) { "multi" -> items.map(map) - else -> listOf(items.map(map).joinToString(separator = collectionDelimiter(collectionFormat))) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) } } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt index 7d5ee7a1bb7..7ee276ec597 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param mapProperty * @param mapOfMapProperty */ +@Parcelize + data class AdditionalPropertiesClass ( @Json(name = "map_property") val mapProperty: kotlin.collections.Map<kotlin.String, kotlin.String>? = null, @Json(name = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt index 5f4435f56fa..ec99cb1d03e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param className * @param color */ +@Parcelize + data class Animal ( @Json(name = "className") val className: kotlin.String, @Json(name = "color") val color: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 0fe4589a5f4..09633d15779 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -13,12 +13,18 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param code * @param type * @param message */ +@Parcelize + data class ApiResponse ( @Json(name = "code") val code: kotlin.Int? = null, @@ -26,6 +32,7 @@ data class ApiResponse ( val type: kotlin.String? = null, @Json(name = "message") val message: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index 7ade7d8cff5..ab9c79c6a34 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param arrayArrayNumber */ +@Parcelize + data class ArrayOfArrayOfNumberOnly ( @Json(name = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array<kotlin.Array<java.math.BigDecimal>>? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index 263146cfd9c..9179165e002 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param arrayNumber */ +@Parcelize + data class ArrayOfNumberOnly ( @Json(name = "ArrayNumber") val arrayNumber: kotlin.Array<java.math.BigDecimal>? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt index a430c055932..75c83a35d47 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -14,12 +14,18 @@ package org.openapitools.client.models import org.openapitools.client.models.ReadOnlyFirst import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param arrayOfString * @param arrayArrayOfInteger * @param arrayArrayOfModel */ +@Parcelize + data class ArrayTest ( @Json(name = "array_of_string") val arrayOfString: kotlin.Array<kotlin.String>? = null, @@ -27,6 +33,7 @@ data class ArrayTest ( val arrayArrayOfInteger: kotlin.Array<kotlin.Array<kotlin.Long>>? = null, @Json(name = "array_array_of_model") val arrayArrayOfModel: kotlin.Array<kotlin.Array<ReadOnlyFirst>>? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt index 72b27a54507..3ca2c485116 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param smallCamel @@ -22,6 +26,8 @@ import com.squareup.moshi.Json * @param scAETHFlowPoints * @param ATT_NAME Name of the pet */ +@Parcelize + data class Capitalization ( @Json(name = "smallCamel") val smallCamel: kotlin.String? = null, @@ -36,6 +42,7 @@ data class Capitalization ( /* Name of the pet */ @Json(name = "ATT_NAME") val ATT_NAME: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt index 1ce9e6ef431..1f357573952 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -15,10 +15,16 @@ import org.openapitools.client.models.Animal import org.openapitools.client.models.CatAllOf import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param declawed */ +@Parcelize + data class Cat ( @Json(name = "className") val className: kotlin.String, @@ -26,6 +32,7 @@ data class Cat ( val declawed: kotlin.Boolean? = null, @Json(name = "color") val color: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt index ec9862cd175..b4681baff4d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param declawed */ +@Parcelize + data class CatAllOf ( @Json(name = "declawed") val declawed: kotlin.Boolean? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index 059231f463c..a259794eaf9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param id * @param name */ +@Parcelize + data class Category ( @Json(name = "name") val name: kotlin.String, @Json(name = "id") val id: kotlin.Long? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt index 06245c42beb..f22f7d7c89d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * Model for testing model with \"_class\" property * @param propertyClass */ +@Parcelize + data class ClassModel ( @Json(name = "_class") val propertyClass: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt index 4a0cc69a783..6911d296186 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param client */ +@Parcelize + data class Client ( @Json(name = "client") val client: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt index 19cb002da7e..5dbf742450a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -15,10 +15,16 @@ import org.openapitools.client.models.Animal import org.openapitools.client.models.DogAllOf import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param breed */ +@Parcelize + data class Dog ( @Json(name = "className") val className: kotlin.String, @@ -26,6 +32,7 @@ data class Dog ( val breed: kotlin.String? = null, @Json(name = "color") val color: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt index 71b1b71365a..34de880409e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param breed */ +@Parcelize + data class DogAllOf ( @Json(name = "breed") val breed: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt index 862929784c0..4b85d474d56 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -13,44 +13,54 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param justSymbol * @param arrayEnum */ +@Parcelize + data class EnumArrays ( @Json(name = "just_symbol") val justSymbol: EnumArrays.JustSymbol? = null, @Json(name = "array_enum") val arrayEnum: kotlin.Array<EnumArrays.ArrayEnum>? = null -) +) + : Parcelable, Serializable { + /** * * Values: greaterThanEqual,dollar */ + enum class JustSymbol(val value: kotlin.String){ @Json(name = ">=") greaterThanEqual(">="), @Json(name = "$") dollar("$"); + } -} -{ /** * * Values: fish,crab */ + enum class ArrayEnum(val value: kotlin.String){ @Json(name = "fish") fish("fish"), @Json(name = "crab") crab("crab"); + } -} +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt index c1d5645936e..db8cf07dd99 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumClass.kt @@ -18,6 +18,7 @@ import com.squareup.moshi.Json * * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis */ + enum class EnumClass(val value: kotlin.String){ @@ -33,5 +34,6 @@ enum class EnumClass(val value: kotlin.String){ leftParenthesisXyzRightParenthesis("(xyz)"); + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index 5c407365037..97baa679d50 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -17,6 +17,10 @@ import org.openapitools.client.models.OuterEnumInteger import org.openapitools.client.models.OuterEnumIntegerDefaultValue import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param enumString @@ -28,6 +32,8 @@ import com.squareup.moshi.Json * @param outerEnumDefaultValue * @param outerEnumIntegerDefaultValue */ +@Parcelize + data class EnumTest ( @Json(name = "enum_string_required") val enumStringRequired: EnumTest.EnumStringRequired, @@ -45,13 +51,16 @@ data class EnumTest ( val outerEnumDefaultValue: OuterEnumDefaultValue? = null, @Json(name = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null -) +) + : Parcelable, Serializable { + /** * * Values: uPPER,lower,eMPTY */ + enum class EnumString(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @@ -60,14 +69,14 @@ data class EnumTest ( @Json(name = "") eMPTY(""); + } -} -{ /** * * Values: uPPER,lower,eMPTY */ + enum class EnumStringRequired(val value: kotlin.String){ @Json(name = "UPPER") uPPER("UPPER"), @@ -76,35 +85,36 @@ data class EnumTest ( @Json(name = "") eMPTY(""); + } -} -{ /** * * Values: _1,minus1 */ + enum class EnumInteger(val value: kotlin.Int){ @Json(name = 1) _1(1), @Json(name = -1) minus1(-1); + } -} -{ /** * * Values: _1period1,minus1Period2 */ + enum class EnumNumber(val value: kotlin.Double){ @Json(name = 1.1) _1period1(1.1), @Json(name = -1.2) minus1Period2(-1.2); + } -} +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index 82e56661014..c03e6dbc55e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param file * @param files */ +@Parcelize + data class FileSchemaTestClass ( @Json(name = "file") val file: java.io.File? = null, @Json(name = "files") val files: kotlin.Array<java.io.File>? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt index 4ac59867244..cad77c1bffd 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param bar */ +@Parcelize + data class Foo ( @Json(name = "bar") val bar: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index d185226b0dc..d9d3395bacd 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param integer @@ -31,6 +35,8 @@ import com.squareup.moshi.Json * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ +@Parcelize + data class FormatTest ( @Json(name = "number") val number: java.math.BigDecimal, @@ -64,6 +70,7 @@ data class FormatTest ( /* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ @Json(name = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index 1e649d71f24..4a2b091b8fb 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param bar * @param foo */ +@Parcelize + data class HasOnlyReadOnly ( @Json(name = "bar") val bar: kotlin.String? = null, @Json(name = "foo") val foo: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt index 8f53541bd22..44eb7dd90b9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. * @param nullableMessage */ +@Parcelize + data class HealthCheckResult ( @Json(name = "NullableMessage") val nullableMessage: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt index 70484e68946..5102d26b779 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -13,11 +13,17 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param name Updated name of the pet * @param status Updated status of the pet */ +@Parcelize + data class InlineObject ( /* Updated name of the pet */ @Json(name = "name") @@ -25,6 +31,7 @@ data class InlineObject ( /* Updated status of the pet */ @Json(name = "status") val status: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt index 51f2137de92..4943ba303c0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -13,11 +13,17 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param additionalMetadata Additional data to pass to server * @param file file to upload */ +@Parcelize + data class InlineObject1 ( /* Additional data to pass to server */ @Json(name = "additionalMetadata") @@ -25,6 +31,7 @@ data class InlineObject1 ( /* file to upload */ @Json(name = "file") val file: java.io.File? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index 0f982f05a80..2cb768d23a9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -13,11 +13,17 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param enumFormStringArray Form parameter enum test (string array) * @param enumFormString Form parameter enum test (string) */ +@Parcelize + data class InlineObject2 ( /* Form parameter enum test (string array) */ @Json(name = "enum_form_string_array") @@ -25,27 +31,30 @@ data class InlineObject2 ( /* Form parameter enum test (string) */ @Json(name = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null -) +) + : Parcelable, Serializable { + /** * Form parameter enum test (string array) * Values: greaterThan,dollar */ + enum class EnumFormStringArray(val value: kotlin.String){ @Json(name = ">") greaterThan(">"), @Json(name = "$") dollar("$"); + } -} -{ /** * Form parameter enum test (string) * Values: abc,minusEfg,leftParenthesisXyzRightParenthesis */ + enum class EnumFormString(val value: kotlin.String){ @Json(name = "_abc") abc("_abc"), @@ -54,7 +63,8 @@ data class InlineObject2 ( @Json(name = "(xyz)") leftParenthesisXyzRightParenthesis("(xyz)"); + } -} +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt index 35dc49df571..c6482d344bc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param integer None @@ -30,6 +34,8 @@ import com.squareup.moshi.Json * @param password None * @param callback None */ +@Parcelize + data class InlineObject3 ( /* None */ @Json(name = "number") @@ -73,6 +79,7 @@ data class InlineObject3 ( /* None */ @Json(name = "callback") val callback: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt index 52eef17034a..5eca3073b02 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -13,11 +13,17 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param param field1 * @param param2 field2 */ +@Parcelize + data class InlineObject4 ( /* field1 */ @Json(name = "param") @@ -25,6 +31,7 @@ data class InlineObject4 ( /* field2 */ @Json(name = "param2") val param2: kotlin.String -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt index ca95c5ee037..3529f36465b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -13,11 +13,17 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param additionalMetadata Additional data to pass to server * @param requiredFile file to upload */ +@Parcelize + data class InlineObject5 ( /* file to upload */ @Json(name = "requiredFile") @@ -25,6 +31,7 @@ data class InlineObject5 ( /* Additional data to pass to server */ @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index 5768639b0b2..fa95f8e0011 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -14,13 +14,20 @@ package org.openapitools.client.models import org.openapitools.client.models.Foo import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param string */ +@Parcelize + data class InlineResponseDefault ( @Json(name = "string") val string: Foo? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt index 6e2a75355bd..a639e7bab99 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * - * @param `123minusList` + * @param ``123minusList`` */ +@Parcelize + data class List ( @Json(name = "123-list") - val `123minusList`: kotlin.String? = null -) + val ``123minusList``: kotlin.String? = null +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt index dc1096dc70b..c0287541a49 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param mapMapOfString @@ -20,6 +24,8 @@ import com.squareup.moshi.Json * @param directMap * @param indirectMap */ +@Parcelize + data class MapTest ( @Json(name = "map_map_of_string") val mapMapOfString: kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>? = null, @@ -29,20 +35,24 @@ data class MapTest ( val directMap: kotlin.collections.Map<kotlin.String, kotlin.Boolean>? = null, @Json(name = "indirect_map") val indirectMap: kotlin.collections.Map<kotlin.String, kotlin.Boolean>? = null -) +) + : Parcelable, Serializable { + /** * * Values: uPPER,lower */ + enum class MapOfEnumString(val value: kotlin.collections.Map<kotlin.String, kotlin.String>){ @Json(name = "UPPER") uPPER("UPPER"), @Json(name = "lower") lower("lower"); + } -} +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 7d835a2af54..0f95e28ef1b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -14,12 +14,18 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param uuid * @param dateTime * @param map */ +@Parcelize + data class MixedPropertiesAndAdditionalPropertiesClass ( @Json(name = "uuid") val uuid: java.util.UUID? = null, @@ -27,6 +33,7 @@ data class MixedPropertiesAndAdditionalPropertiesClass ( val dateTime: java.time.LocalDateTime? = null, @Json(name = "map") val map: kotlin.collections.Map<kotlin.String, Animal>? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt index b2e792c8e8e..43835b140f9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * Model for testing model name starting with number * @param name * @param propertyClass */ +@Parcelize + data class Model200Response ( @Json(name = "name") val name: kotlin.Int? = null, @Json(name = "class") val propertyClass: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt index 72cb9d7ad64..93d93a4be13 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -13,13 +13,19 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * Model for testing model name same as property name * @param name * @param snakeCase * @param property - * @param `123number` + * @param ``123number`` */ +@Parcelize + data class Name ( @Json(name = "name") val name: kotlin.Int, @@ -28,7 +34,8 @@ data class Name ( @Json(name = "property") val property: kotlin.String? = null, @Json(name = "123Number") - val `123number`: kotlin.Int? = null -) + val ``123number``: kotlin.Int? = null +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 86bb11c5c1d..703383e7dec 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param integerProp @@ -28,6 +32,8 @@ import com.squareup.moshi.Json * @param objectAndItemsNullableProp * @param objectItemsNullable */ +@Parcelize + data class NullableClass ( @Json(name = "integer_prop") val integerProp: kotlin.Int? = null, @@ -53,6 +59,7 @@ data class NullableClass ( val objectAndItemsNullableProp: kotlin.collections.Map<kotlin.String, kotlin.Any>? = null, @Json(name = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map<kotlin.String, kotlin.Any>? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt index 7385bd95231..89e3580868c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param justNumber */ +@Parcelize + data class NumberOnly ( @Json(name = "JustNumber") val justNumber: java.math.BigDecimal? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index d33f3bf2393..1a84e21729c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param id @@ -22,6 +26,8 @@ import com.squareup.moshi.Json * @param status Order Status * @param complete */ +@Parcelize + data class Order ( @Json(name = "id") val id: kotlin.Long? = null, @@ -36,13 +42,16 @@ data class Order ( val status: Order.Status? = null, @Json(name = "complete") val complete: kotlin.Boolean? = null -) +) + : Parcelable, Serializable { + /** * Order Status * Values: placed,approved,delivered */ + enum class Status(val value: kotlin.String){ @Json(name = "placed") placed("placed"), @@ -51,7 +60,8 @@ data class Order ( @Json(name = "delivered") delivered("delivered"); + } -} +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt index 304f88c52df..de6c6e332cb 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -13,12 +13,18 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param myNumber * @param myString * @param myBoolean */ +@Parcelize + data class OuterComposite ( @Json(name = "my_number") val myNumber: java.math.BigDecimal? = null, @@ -26,6 +32,7 @@ data class OuterComposite ( val myString: kotlin.String? = null, @Json(name = "my_boolean") val myBoolean: kotlin.Boolean? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt index 8d84d271873..86ce0b25a14 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnum.kt @@ -18,6 +18,7 @@ import com.squareup.moshi.Json * * Values: placed,approved,delivered */ + enum class OuterEnum(val value: kotlin.String){ @@ -33,5 +34,6 @@ enum class OuterEnum(val value: kotlin.String){ delivered("delivered"); + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt index b3fa7c45242..bf9e3e79960 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumDefaultValue.kt @@ -18,6 +18,7 @@ import com.squareup.moshi.Json * * Values: placed,approved,delivered */ + enum class OuterEnumDefaultValue(val value: kotlin.String){ @@ -33,5 +34,6 @@ enum class OuterEnumDefaultValue(val value: kotlin.String){ delivered("delivered"); + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt index 9defa9842e4..c7345e41ebe 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumInteger.kt @@ -18,6 +18,7 @@ import com.squareup.moshi.Json * * Values: _0,_1,_2 */ + enum class OuterEnumInteger(val value: kotlin.Int){ @@ -33,5 +34,6 @@ enum class OuterEnumInteger(val value: kotlin.Int){ _2(2); + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt index 8b9a7e71846..f8435385ea3 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterEnumIntegerDefaultValue.kt @@ -18,6 +18,7 @@ import com.squareup.moshi.Json * * Values: _0,_1,_2 */ + enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ @@ -33,5 +34,6 @@ enum class OuterEnumIntegerDefaultValue(val value: kotlin.Int){ _2(2); + } diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index b0c73cfb514..21aa4c57fae 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -15,6 +15,10 @@ import org.openapitools.client.models.Category import org.openapitools.client.models.Tag import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param id @@ -24,6 +28,8 @@ import com.squareup.moshi.Json * @param tags * @param status pet status in the store */ +@Parcelize + data class Pet ( @Json(name = "name") val name: kotlin.String, @@ -38,13 +44,16 @@ data class Pet ( /* pet status in the store */ @Json(name = "status") val status: Pet.Status? = null -) +) + : Parcelable, Serializable { + /** * pet status in the store * Values: available,pending,sold */ + enum class Status(val value: kotlin.String){ @Json(name = "available") available("available"), @@ -53,7 +62,8 @@ data class Pet ( @Json(name = "sold") sold("sold"); + } -} +} diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index 52bf083649a..01926a11816 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param bar * @param baz */ +@Parcelize + data class ReadOnlyFirst ( @Json(name = "bar") val bar: kotlin.String? = null, @Json(name = "baz") val baz: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt index 91c53146843..e6e18331ecb 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * Model for testing reserved words - * @param `return` + * @param ``return`` */ +@Parcelize + data class Return ( @Json(name = "return") - val `return`: kotlin.Int? = null -) + val ``return``: kotlin.Int? = null +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index a4faf3fd57a..a26aa69fd6c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -13,13 +13,20 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket */ +@Parcelize + data class SpecialModelname ( @Json(name = "$special[property.name]") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 37e9e0eaef3..d406f458f03 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -13,16 +13,23 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param id * @param name */ +@Parcelize + data class Tag ( @Json(name = "id") val id: kotlin.Long? = null, @Json(name = "name") val name: kotlin.String? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index 5301e72d376..d252bfff176 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -13,6 +13,10 @@ package org.openapitools.client.models import com.squareup.moshi.Json +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * * @param id @@ -24,6 +28,8 @@ import com.squareup.moshi.Json * @param phone * @param userStatus User Status */ +@Parcelize + data class User ( @Json(name = "id") val id: kotlin.Long? = null, @@ -42,6 +48,7 @@ data class User ( /* User Status */ @Json(name = "userStatus") val userStatus: kotlin.Int? = null -) +) + : Parcelable, Serializable diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION index 06b5019af3f..0e97bd19efb 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts b/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts index f62d3f33c8d..f4561be14be 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/build.gradle.kts @@ -43,9 +43,11 @@ dependencies { compile("com.fasterxml.jackson.dataformat:jackson-dataformat-xml") compile("com.fasterxml.jackson.module:jackson-module-kotlin") + testCompile("org.jetbrains.kotlin:kotlin-test-junit5") testCompile("org.springframework.boot:spring-boot-starter-test") { exclude(module = "junit") } + testCompile("org.jetbrains.kotlinx:kotlinx-coroutines-test:$kotlinxCoroutinesVersion") } repositories { diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml index 1932017d4bf..b0a954d4707 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/pom.xml @@ -96,6 +96,12 @@ <artifactId>swagger-annotations</artifactId> <version>1.5.21</version> </dependency> + <!-- @Nullable annotation --> + <dependency> + <groupId>com.google.code.findbugs</groupId> + <artifactId>jsr305</artifactId> + <version>3.0.2</version> + </dependency> <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-yaml</artifactId> @@ -117,6 +123,12 @@ <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> </dependency> + <dependency> + <groupId>org.jetbrains.kotlin</groupId> + <artifactId>kotlin-test-junit5</artifactId> + <version>1.3.31</version> + <scope>test</scope> + </dependency> </dependencies> <repositories> <repository> diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt index 29de43b1a02..c0aeae1a41c 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -45,142 +45,141 @@ import kotlin.collections.Map class PetApiController(@Autowired(required = true) val service: PetApiService) { @ApiOperation( - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + 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")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.POST]) suspend fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity<Unit> { - return ResponseEntity(service.addPet(pet), HttpStatus.OK) + return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) } @ApiOperation( - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + 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")]) + value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) - suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: String? + value = ["/pet/{petId}"], + method = [RequestMethod.DELETE]) + suspend fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity<Unit> { - return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.OK) + return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( - value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: List<String> + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String> ): ResponseEntity<Flow<Pet>> { - return ResponseEntity(service.findPetsByStatus(status), HttpStatus.OK) + return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( - value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: List<String> -,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: Int? + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String> ): ResponseEntity<Flow<Pet>> { - return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.OK) + return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet::class, - authorizations = [Authorization(value = "api_key")]) + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet::class, + 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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( - value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: Long + value = ["/pet/{petId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity<Pet> { - return ResponseEntity(service.getPetById(petId), HttpStatus.OK) + return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + 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")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.PUT]) suspend fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity<Unit> { - return ResponseEntity(service.updatePet(pet), HttpStatus.OK) + return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + 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")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) - suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: String? -,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: String? + value = ["/pet/{petId}"], + consumes = ["application/x-www-form-urlencoded"], + method = [RequestMethod.POST]) + suspend fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? +,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity<Unit> { - return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.OK) + return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) } @ApiOperation( - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse::class, - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse::class, + 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)]) + value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( - value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) - suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: Long -,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: String? + value = ["/pet/{petId}/uploadImage"], + produces = ["application/json"], + consumes = ["multipart/form-data"], + method = [RequestMethod.POST]) + suspend fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long +,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity<ModelApiResponse> { - return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.OK) + return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt index 2bd53b2a56d..033bd517c44 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -7,17 +7,17 @@ interface PetApiService { suspend fun addPet(pet: Pet): Unit - suspend fun deletePet(petId: Long, apiKey: String?): Unit + suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit - fun findPetsByStatus(status: List<String>): Flow<Pet> + fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): Flow<Pet> - fun findPetsByTags(tags: List<String>, maxCount: Int?): Flow<Pet> + fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): Flow<Pet> - suspend fun getPetById(petId: Long): Pet + suspend fun getPetById(petId: kotlin.Long): Pet suspend fun updatePet(pet: Pet): Unit - suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit + suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit - suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse + suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 009f039d860..e6db20b52c9 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -11,19 +11,19 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override suspend fun deletePet(petId: Long, apiKey: String?): Unit { + override suspend fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?): Unit { TODO("Implement me") } - override fun findPetsByStatus(status: List<String>): Flow<Pet> { + override fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): Flow<Pet> { TODO("Implement me") } - override fun findPetsByTags(tags: List<String>, maxCount: Int?): Flow<Pet> { + override fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): Flow<Pet> { TODO("Implement me") } - override suspend fun getPetById(petId: Long): Pet { + override suspend fun getPetById(petId: kotlin.Long): Pet { TODO("Implement me") } @@ -31,11 +31,11 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override suspend fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit { + override suspend fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?): Unit { TODO("Implement me") } - override suspend fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse { + override suspend fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: org.springframework.core.io.Resource?): ModelApiResponse { TODO("Implement me") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt index 2ee42a77233..9bbe9fa4665 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -44,66 +44,66 @@ import kotlin.collections.Map class StoreApiController(@Autowired(required = true) val service: StoreApiService) { @ApiOperation( - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + value = "Delete purchase order by ID", + nickname = "deleteOrder", + 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")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) - suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: String + value = ["/store/order/{orderId}"], + method = [RequestMethod.DELETE]) + suspend fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity<Unit> { - return ResponseEntity(service.deleteOrder(orderId), HttpStatus.OK) + return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Int::class, - responseContainer = "Map", - authorizations = [Authorization(value = "api_key")]) + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = kotlin.Int::class, + responseContainer = "Map", + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Map::class, responseContainer = "Map")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( - value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) - suspend fun getInventory(): ResponseEntity<Map<String, Int>> { - return ResponseEntity(service.getInventory(), HttpStatus.OK) + value = ["/store/inventory"], + produces = ["application/json"], + method = [RequestMethod.GET]) + suspend fun getInventory(): ResponseEntity<Map<String, kotlin.Int>> { + return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order::class) + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + 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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: Long + value = ["/store/order/{orderId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity<Order> { - return ResponseEntity(service.getOrderById(orderId), HttpStatus.OK) + return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order::class) + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( - value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity<Order> { - return ResponseEntity(service.placeOrder(order), HttpStatus.OK) + return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt index 84dc2837054..89393699d39 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiService.kt @@ -4,11 +4,11 @@ import org.openapitools.model.Order import kotlinx.coroutines.flow.Flow; interface StoreApiService { - suspend fun deleteOrder(orderId: String): Unit + suspend fun deleteOrder(orderId: kotlin.String): Unit - suspend fun getInventory(): Map<String, Int> + suspend fun getInventory(): Map<String, kotlin.Int> - suspend fun getOrderById(orderId: Long): Order + suspend fun getOrderById(orderId: kotlin.Long): Order suspend fun placeOrder(order: Order): Order } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt index f29e7e08c2e..52fc3ff57c0 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/StoreApiServiceImpl.kt @@ -6,15 +6,15 @@ import org.springframework.stereotype.Service @Service class StoreApiServiceImpl : StoreApiService { - override suspend fun deleteOrder(orderId: String): Unit { + override suspend fun deleteOrder(orderId: kotlin.String): Unit { TODO("Implement me") } - override suspend fun getInventory(): Map<String, Int> { + override suspend fun getInventory(): Map<String, kotlin.Int> { TODO("Implement me") } - override suspend fun getOrderById(orderId: Long): Order { + override suspend fun getOrderById(orderId: kotlin.Long): Order { TODO("Implement me") } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt index 1aed45eebdd..0a0c2492d32 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -44,129 +44,129 @@ import kotlin.collections.Map class UserApiController(@Autowired(required = true) val service: UserApiService) { @ApiOperation( - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity<Unit> { - return ResponseEntity(service.createUser(user), HttpStatus.OK) + return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithArray"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow<User> ): ResponseEntity<Unit> { - return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithList"], + consumes = ["application/json"], + method = [RequestMethod.POST]) suspend fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: Flow<User> ): ResponseEntity<Unit> { - return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) - suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + method = [RequestMethod.DELETE]) + suspend fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity<Unit> { - return ResponseEntity(service.deleteUser(username), HttpStatus.OK) + return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User::class) + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + 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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity<User> { - return ResponseEntity(service.getUserByName(username), HttpStatus.OK) + return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String::class) + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = kotlin.String::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( - value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) - suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: String -,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: String -): ResponseEntity<String> { - return ResponseEntity(service.loginUser(username, password), HttpStatus.OK) + value = ["/user/login"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) + suspend fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String +,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String +): ResponseEntity<kotlin.String> { + return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + value = ["/user/logout"], + method = [RequestMethod.GET]) suspend fun logoutUser(): ResponseEntity<Unit> { - return ResponseEntity(service.logoutUser(), HttpStatus.OK) + return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) - suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: String + value = ["/user/{username}"], + consumes = ["application/json"], + method = [RequestMethod.PUT]) + suspend fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity<Unit> { - return ResponseEntity(service.updateUser(username, user), HttpStatus.OK) + return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt index 999ae4f4074..43dd4b0a384 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiService.kt @@ -10,13 +10,13 @@ interface UserApiService { suspend fun createUsersWithListInput(user: Flow<User>): Unit - suspend fun deleteUser(username: String): Unit + suspend fun deleteUser(username: kotlin.String): Unit - suspend fun getUserByName(username: String): User + suspend fun getUserByName(username: kotlin.String): User - suspend fun loginUser(username: String, password: String): String + suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String suspend fun logoutUser(): Unit - suspend fun updateUser(username: String, user: User): Unit + suspend fun updateUser(username: kotlin.String, user: User): Unit } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt index 8872d309e4d..251bd927749 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/api/UserApiServiceImpl.kt @@ -18,15 +18,15 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override suspend fun deleteUser(username: String): Unit { + override suspend fun deleteUser(username: kotlin.String): Unit { TODO("Implement me") } - override suspend fun getUserByName(username: String): User { + override suspend fun getUserByName(username: kotlin.String): User { TODO("Implement me") } - override suspend fun loginUser(username: String, password: String): String { + override suspend fun loginUser(username: kotlin.String, password: kotlin.String): kotlin.String { TODO("Implement me") } @@ -34,7 +34,7 @@ class UserApiServiceImpl : UserApiService { TODO("Implement me") } - override suspend fun updateUser(username: String, user: User): Unit { + override suspend fun updateUser(username: kotlin.String, user: User): Unit { TODO("Implement me") } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt index e042a7f997c..4be27d19748 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Category.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class Category ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @get:Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt index e998bc995ce..ee034530c63 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject ( @ApiModelProperty(example = "null", value = "Updated name of the pet") - @JsonProperty("name") val name: String? = null, + @JsonProperty("name") val name: kotlin.String? = null, @ApiModelProperty(example = "null", value = "Updated status of the pet") - @JsonProperty("status") val status: String? = null + @JsonProperty("status") val status: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt index d29578fd0c0..a289d8c05f7 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/InlineObject1.kt @@ -19,7 +19,7 @@ import io.swagger.annotations.ApiModelProperty data class InlineObject1 ( @ApiModelProperty(example = "null", value = "Additional data to pass to server") - @JsonProperty("additionalMetadata") val additionalMetadata: String? = null, + @JsonProperty("additionalMetadata") val additionalMetadata: kotlin.String? = null, @ApiModelProperty(example = "null", value = "file to upload") @JsonProperty("file") val file: org.springframework.core.io.Resource? = null diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt index 2f844a9c356..0e86b28e937 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/ModelApiResponse.kt @@ -20,13 +20,13 @@ import io.swagger.annotations.ApiModelProperty data class ModelApiResponse ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("code") val code: Int? = null, + @JsonProperty("code") val code: kotlin.Int? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("type") val type: String? = null, + @JsonProperty("type") val type: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("message") val message: String? = null + @JsonProperty("message") val message: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt index e20d850491f..08726893f7d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Order.kt @@ -24,13 +24,13 @@ import io.swagger.annotations.ApiModelProperty data class Order ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("petId") val petId: Long? = null, + @JsonProperty("petId") val petId: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("quantity") val quantity: Int? = null, + @JsonProperty("quantity") val quantity: kotlin.Int? = null, @ApiModelProperty(example = "null", value = "") @JsonProperty("shipDate") val shipDate: java.time.OffsetDateTime? = null, @@ -39,14 +39,14 @@ data class Order ( @JsonProperty("status") val status: Order.Status? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("complete") val complete: Boolean? = null + @JsonProperty("complete") val complete: kotlin.Boolean? = null ) { /** * Order Status * Values: placed,approved,delivered */ - enum class Status(val value: String) { + enum class Status(val value: kotlin.String) { @JsonProperty("placed") placed("placed"), diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt index 9e054ac22f7..4a2e9d26cb9 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Pet.kt @@ -27,20 +27,20 @@ data class Pet ( @get:NotNull @ApiModelProperty(example = "doggie", required = true, value = "") - @JsonProperty("name") val name: String, + @JsonProperty("name") val name: kotlin.String, @get:NotNull @ApiModelProperty(example = "null", required = true, value = "") - @JsonProperty("photoUrls") val photoUrls: List<String>, + @JsonProperty("photoUrls") val photoUrls: kotlin.collections.List<kotlin.String>, @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") @JsonProperty("category") val category: Category? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("tags") val tags: List<Tag>? = null, + @JsonProperty("tags") val tags: kotlin.collections.List<Tag>? = null, @ApiModelProperty(example = "null", value = "pet status in the store") @JsonProperty("status") val status: Pet.Status? = null @@ -50,7 +50,7 @@ data class Pet ( * pet status in the store * Values: available,pending,sold */ - enum class Status(val value: String) { + enum class Status(val value: kotlin.String) { @JsonProperty("available") available("available"), diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt index 40ef1b9a86b..df04dcd035d 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/Tag.kt @@ -19,10 +19,10 @@ import io.swagger.annotations.ApiModelProperty data class Tag ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("name") val name: String? = null + @JsonProperty("name") val name: kotlin.String? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt index 95fe12aa467..619b2e7c2c3 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/main/kotlin/org/openapitools/model/User.kt @@ -25,28 +25,28 @@ import io.swagger.annotations.ApiModelProperty data class User ( @ApiModelProperty(example = "null", value = "") - @JsonProperty("id") val id: Long? = null, + @JsonProperty("id") val id: kotlin.Long? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("username") val username: String? = null, + @JsonProperty("username") val username: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("firstName") val firstName: String? = null, + @JsonProperty("firstName") val firstName: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("lastName") val lastName: String? = null, + @JsonProperty("lastName") val lastName: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("email") val email: String? = null, + @JsonProperty("email") val email: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("password") val password: String? = null, + @JsonProperty("password") val password: kotlin.String? = null, @ApiModelProperty(example = "null", value = "") - @JsonProperty("phone") val phone: String? = null, + @JsonProperty("phone") val phone: kotlin.String? = null, @ApiModelProperty(example = "null", value = "User Status") - @JsonProperty("userStatus") val userStatus: Int? = null + @JsonProperty("userStatus") val userStatus: kotlin.Int? = null ) { } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION index 06b5019af3f..0e97bd19efb 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/kotlin-springboot/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.1-SNAPSHOT \ No newline at end of file +4.1.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml index 10720393bf0..38491e8939c 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/pom.xml +++ b/samples/openapi3/server/petstore/kotlin-springboot/pom.xml @@ -86,6 +86,12 @@ <artifactId>swagger-annotations</artifactId> <version>1.5.21</version> </dependency> + <!-- @Nullable annotation --> + <dependency> + <groupId>com.google.code.findbugs</groupId> + <artifactId>jsr305</artifactId> + <version>3.0.2</version> + </dependency> <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-yaml</artifactId> diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt index 7b397708c7a..4a111fdb7f5 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApi.kt @@ -44,142 +44,141 @@ import kotlin.collections.Map class PetApiController(@Autowired(required = true) val service: PetApiService) { @ApiOperation( - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Add a new pet to the store", + nickname = "addPet", + notes = "", + 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")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.POST]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.POST]) fun addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity<Unit> { - return ResponseEntity(service.addPet(pet), HttpStatus.OK) + return ResponseEntity(service.addPet(pet), HttpStatus.valueOf(405)) } @ApiOperation( - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Deletes a pet", + nickname = "deletePet", + notes = "", + 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")]) + value = [ApiResponse(code = 400, message = "Invalid pet value")]) @RequestMapping( - value = ["/pet/{petId}"], - method = [RequestMethod.DELETE]) + value = ["/pet/{petId}"], + method = [RequestMethod.DELETE]) fun deletePet(@ApiParam(value = "Pet id to delete", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) apiKey: kotlin.String? ): ResponseEntity<Unit> { - return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.OK) + return ResponseEntity(service.deletePet(petId, apiKey), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by status", + nickname = "findPetsByStatus", + notes = "Multiple status values can be provided with comma separated strings", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid status value")]) @RequestMapping( - value = ["/pet/findByStatus"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/findByStatus"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) status: kotlin.collections.List<kotlin.String> ): ResponseEntity<List<Pet>> { - return ResponseEntity(service.findPetsByStatus(status), HttpStatus.OK) + return ResponseEntity(service.findPetsByStatus(status), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet::class, - responseContainer = "List", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Finds Pets by tags", + nickname = "findPetsByTags", + notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", + response = Pet::class, + responseContainer = "List", + authorizations = [Authorization(value = "petstore_auth", scopes = [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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class, responseContainer = "List"),ApiResponse(code = 400, message = "Invalid tag value")]) @RequestMapping( - value = ["/pet/findByTags"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/findByTags"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) tags: kotlin.collections.List<kotlin.String> -,@ApiParam(value = "Maximum number of items to return") @Valid @RequestParam(value = "maxCount", required = false) maxCount: kotlin.Int? ): ResponseEntity<List<Pet>> { - return ResponseEntity(service.findPetsByTags(tags, maxCount), HttpStatus.OK) + return ResponseEntity(service.findPetsByTags(tags), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet::class, - authorizations = [Authorization(value = "api_key")]) + value = "Find pet by ID", + nickname = "getPetById", + notes = "Returns a single pet", + response = Pet::class, + 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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Pet::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found")]) @RequestMapping( - value = ["/pet/{petId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/pet/{petId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getPetById(@ApiParam(value = "ID of pet to return", required=true) @PathVariable("petId") petId: kotlin.Long ): ResponseEntity<Pet> { - return ResponseEntity(service.getPetById(petId), HttpStatus.OK) + return ResponseEntity(service.getPetById(petId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Update an existing pet", + nickname = "updatePet", + notes = "", + 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")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Pet not found"),ApiResponse(code = 405, message = "Validation exception")]) @RequestMapping( - value = ["/pet"], - consumes = ["application/json", "application/xml"], - method = [RequestMethod.PUT]) + value = ["/pet"], + consumes = ["application/json", "application/xml"], + method = [RequestMethod.PUT]) fun updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody pet: Pet ): ResponseEntity<Unit> { - return ResponseEntity(service.updatePet(pet), HttpStatus.OK) + return ResponseEntity(service.updatePet(pet), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "Updates a pet in the store with form data", + nickname = "updatePetWithForm", + notes = "", + 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")]) + value = [ApiResponse(code = 405, message = "Invalid input")]) @RequestMapping( - value = ["/pet/{petId}"], - consumes = ["application/x-www-form-urlencoded"], - method = [RequestMethod.POST]) + value = ["/pet/{petId}"], + consumes = ["application/x-www-form-urlencoded"], + method = [RequestMethod.POST]) fun updatePetWithForm(@ApiParam(value = "ID of pet that needs to be updated", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Updated name of the pet") @RequestParam(value="name", required=false) name: kotlin.String? ,@ApiParam(value = "Updated status of the pet") @RequestParam(value="status", required=false) status: kotlin.String? ): ResponseEntity<Unit> { - return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.OK) + return ResponseEntity(service.updatePetWithForm(petId, name, status), HttpStatus.valueOf(405)) } @ApiOperation( - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse::class, - authorizations = [Authorization(value = "petstore_auth", scopes = [AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), AuthorizationScope(scope = "read:pets", description = "read your pets")])]) + value = "uploads an image", + nickname = "uploadFile", + notes = "", + response = ModelApiResponse::class, + 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)]) + value = [ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse::class)]) @RequestMapping( - value = ["/pet/{petId}/uploadImage"], - produces = ["application/json"], - consumes = ["multipart/form-data"], - method = [RequestMethod.POST]) + value = ["/pet/{petId}/uploadImage"], + produces = ["application/json"], + consumes = ["multipart/form-data"], + method = [RequestMethod.POST]) fun uploadFile(@ApiParam(value = "ID of pet to update", required=true) @PathVariable("petId") petId: kotlin.Long ,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) additionalMetadata: kotlin.String? ,@ApiParam(value = "file detail") @Valid @RequestPart("file") file: org.springframework.core.io.Resource? ): ResponseEntity<ModelApiResponse> { - return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.OK) + return ResponseEntity(service.uploadFile(petId, additionalMetadata, file), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt index 89bae4c1ceb..364f027cf8b 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiService.kt @@ -10,7 +10,7 @@ interface PetApiService { fun findPetsByStatus(status: kotlin.collections.List<kotlin.String>): List<Pet> - fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>, maxCount: kotlin.Int?): List<Pet> + fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): List<Pet> fun getPetById(petId: kotlin.Long): Pet diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt index 26900dc599d..a4e09c0f158 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/PetApiServiceImpl.kt @@ -18,7 +18,7 @@ class PetApiServiceImpl : PetApiService { TODO("Implement me") } - override fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>, maxCount: kotlin.Int?): List<Pet> { + override fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>): List<Pet> { TODO("Implement me") } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt index 16104fb0d22..435631042e4 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/StoreApi.kt @@ -43,66 +43,66 @@ import kotlin.collections.Map class StoreApiController(@Autowired(required = true) val service: StoreApiService) { @ApiOperation( - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") + value = "Delete purchase order by ID", + nickname = "deleteOrder", + 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")]) + value = [ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - method = [RequestMethod.DELETE]) + value = ["/store/order/{orderId}"], + method = [RequestMethod.DELETE]) fun deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted", required=true) @PathVariable("orderId") orderId: kotlin.String ): ResponseEntity<Unit> { - return ResponseEntity(service.deleteOrder(orderId), HttpStatus.OK) + return ResponseEntity(service.deleteOrder(orderId), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = kotlin.Int::class, - responseContainer = "Map", - authorizations = [Authorization(value = "api_key")]) + value = "Returns pet inventories by status", + nickname = "getInventory", + notes = "Returns a map of status codes to quantities", + response = kotlin.Int::class, + responseContainer = "Map", + authorizations = [Authorization(value = "api_key")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.collections.Map::class, responseContainer = "Map")]) @RequestMapping( - value = ["/store/inventory"], - produces = ["application/json"], - method = [RequestMethod.GET]) + value = ["/store/inventory"], + produces = ["application/json"], + method = [RequestMethod.GET]) fun getInventory(): ResponseEntity<Map<String, kotlin.Int>> { - return ResponseEntity(service.getInventory(), HttpStatus.OK) + return ResponseEntity(service.getInventory(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", - response = Order::class) + value = "Find purchase order by ID", + nickname = "getOrderById", + notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", + 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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid ID supplied"),ApiResponse(code = 404, message = "Order not found")]) @RequestMapping( - value = ["/store/order/{orderId}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/store/order/{orderId}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required=true) @PathVariable("orderId") orderId: kotlin.Long ): ResponseEntity<Order> { - return ResponseEntity(service.getOrderById(orderId), HttpStatus.OK) + return ResponseEntity(service.getOrderById(orderId), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order::class) + value = "Place an order for a pet", + nickname = "placeOrder", + notes = "", + response = Order::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) + value = [ApiResponse(code = 200, message = "successful operation", response = Order::class),ApiResponse(code = 400, message = "Invalid Order")]) @RequestMapping( - value = ["/store/order"], - produces = ["application/xml", "application/json"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/store/order"], + produces = ["application/xml", "application/json"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody order: Order ): ResponseEntity<Order> { - return ResponseEntity(service.placeOrder(order), HttpStatus.OK) + return ResponseEntity(service.placeOrder(order), HttpStatus.valueOf(200)) } } diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt index bd7583274b5..f1f7d6eba45 100644 --- a/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/main/kotlin/org/openapitools/api/UserApi.kt @@ -43,129 +43,129 @@ import kotlin.collections.Map class UserApiController(@Autowired(required = true) val service: UserApiService) { @ApiOperation( - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Create user", + nickname = "createUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity<Unit> { - return ResponseEntity(service.createUser(user), HttpStatus.OK) + return ResponseEntity(service.createUser(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithArrayInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithArray"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithArray"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List<User> ): ResponseEntity<Unit> { - return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithArrayInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Creates list of users with given input array", + nickname = "createUsersWithListInput", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/createWithList"], - consumes = ["application/json"], - method = [RequestMethod.POST]) + value = ["/user/createWithList"], + consumes = ["application/json"], + method = [RequestMethod.POST]) fun createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody user: kotlin.collections.List<User> ): ResponseEntity<Unit> { - return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.OK) + return ResponseEntity(service.createUsersWithListInput(user), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Delete user", + nickname = "deleteUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - method = [RequestMethod.DELETE]) + value = ["/user/{username}"], + method = [RequestMethod.DELETE]) fun deleteUser(@ApiParam(value = "The name that needs to be deleted", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity<Unit> { - return ResponseEntity(service.deleteUser(username), HttpStatus.OK) + return ResponseEntity(service.deleteUser(username), HttpStatus.valueOf(400)) } @ApiOperation( - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User::class) + value = "Get user by user name", + nickname = "getUserByName", + notes = "", + 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")]) + value = [ApiResponse(code = 200, message = "successful operation", response = User::class),ApiResponse(code = 400, message = "Invalid username supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/user/{username}"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required=true) @PathVariable("username") username: kotlin.String ): ResponseEntity<User> { - return ResponseEntity(service.getUserByName(username), HttpStatus.OK) + return ResponseEntity(service.getUserByName(username), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = kotlin.String::class) + value = "Logs user into the system", + nickname = "loginUser", + notes = "", + response = kotlin.String::class) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) + value = [ApiResponse(code = 200, message = "successful operation", response = kotlin.String::class),ApiResponse(code = 400, message = "Invalid username/password supplied")]) @RequestMapping( - value = ["/user/login"], - produces = ["application/xml", "application/json"], - method = [RequestMethod.GET]) + value = ["/user/login"], + produces = ["application/xml", "application/json"], + method = [RequestMethod.GET]) fun loginUser(@NotNull @Pattern(regexp="^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) username: kotlin.String ,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) password: kotlin.String ): ResponseEntity<kotlin.String> { - return ResponseEntity(service.loginUser(username, password), HttpStatus.OK) + return ResponseEntity(service.loginUser(username, password), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Logs out current logged in user session", + nickname = "logoutUser", + notes = "", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 200, message = "successful operation")]) + value = [ApiResponse(code = 200, message = "successful operation")]) @RequestMapping( - value = ["/user/logout"], - method = [RequestMethod.GET]) + value = ["/user/logout"], + method = [RequestMethod.GET]) fun logoutUser(): ResponseEntity<Unit> { - return ResponseEntity(service.logoutUser(), HttpStatus.OK) + return ResponseEntity(service.logoutUser(), HttpStatus.valueOf(200)) } @ApiOperation( - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user.", - authorizations = [Authorization(value = "auth_cookie")]) + value = "Updated user", + nickname = "updateUser", + notes = "This can only be done by the logged in user.", + authorizations = [Authorization(value = "auth_cookie")]) @ApiResponses( - value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) + value = [ApiResponse(code = 400, message = "Invalid user supplied"),ApiResponse(code = 404, message = "User not found")]) @RequestMapping( - value = ["/user/{username}"], - consumes = ["application/json"], - method = [RequestMethod.PUT]) + value = ["/user/{username}"], + consumes = ["application/json"], + method = [RequestMethod.PUT]) fun updateUser(@ApiParam(value = "name that need to be deleted", required=true) @PathVariable("username") username: kotlin.String ,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody user: User ): ResponseEntity<Unit> { - return ResponseEntity(service.updateUser(username, user), HttpStatus.OK) + return ResponseEntity(service.updateUser(username, user), HttpStatus.valueOf(400)) } } diff --git a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION index c3a2c7076fa..0e97bd19efb 100644 --- a/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION +++ b/samples/server/petstore/kotlin-server/ktor/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.1.3-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 318f632e229..0cf33dd3eaf 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 4.2.0-SNAPSHOT. +Generated by OpenAPI Generator 4.1.3-SNAPSHOT. ## Requires 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/ApiResponse.kt index d61abe165a0..24913c178cf 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/ApiResponse.kt @@ -12,17 +12,25 @@ package org.openapitools.server.models +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * Describes the result of uploading an image resource * @param code * @param type * @param message */ +@Parcelize data class ApiResponse ( val code: kotlin.Int? = null, val type: kotlin.String? = null, val message: kotlin.String? = null -) { +) + + : Parcelable, Serializable +{ } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt index 5b6aab934e2..e25deafbce6 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt @@ -12,15 +12,23 @@ package org.openapitools.server.models +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A category for a pet * @param id * @param name */ +@Parcelize data class Category ( val id: kotlin.Long? = null, val name: kotlin.String? = null -) { +) + + : Parcelable, Serializable +{ } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt index 119722f85c1..42667105a4c 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt @@ -12,6 +12,10 @@ package org.openapitools.server.models +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * An order for a pets from the pet store * @param id @@ -21,6 +25,7 @@ package org.openapitools.server.models * @param status Order Status * @param complete */ +@Parcelize data class Order ( val id: kotlin.Long? = null, val petId: kotlin.Long? = null, @@ -29,7 +34,10 @@ data class Order ( /* Order Status */ val status: Order.Status? = null, val complete: kotlin.Boolean? = null -) { +) + + : Parcelable, Serializable +{ /** * Order Status diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt index a21ea8ed37e..152e7029a5f 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt @@ -14,6 +14,10 @@ package org.openapitools.server.models import org.openapitools.server.models.Category import org.openapitools.server.models.Tag +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A pet for sale in the pet store * @param id @@ -23,6 +27,7 @@ import org.openapitools.server.models.Tag * @param tags * @param status pet status in the store */ +@Parcelize data class Pet ( val name: kotlin.String, val photoUrls: kotlin.Array<kotlin.String>, @@ -31,7 +36,10 @@ data class Pet ( val tags: kotlin.Array<Tag>? = null, /* pet status in the store */ val status: Pet.Status? = null -) { +) + + : Parcelable, Serializable +{ /** * pet status in the store diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt index eadd8e74d39..fa9a514826e 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt @@ -12,15 +12,23 @@ package org.openapitools.server.models +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A tag for a pet * @param id * @param name */ +@Parcelize data class Tag ( val id: kotlin.Long? = null, val name: kotlin.String? = null -) { +) + + : Parcelable, Serializable +{ } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt index bf6e8f53ecc..8e80f83bbdf 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt @@ -12,6 +12,10 @@ package org.openapitools.server.models +import android.os.Parcelable +import kotlinx.android.parcel.Parcelize + +import java.io.Serializable /** * A User who is purchasing from the pet store * @param id @@ -23,6 +27,7 @@ package org.openapitools.server.models * @param phone * @param userStatus User Status */ +@Parcelize data class User ( val id: kotlin.Long? = null, val username: kotlin.String? = null, @@ -33,7 +38,10 @@ data class User ( val phone: kotlin.String? = null, /* User Status */ val userStatus: kotlin.Int? = null -) { +) + + : Parcelable, Serializable +{ } -- GitLab From eb7b537d9b70f4fe368673a283a8d2b97bb8bba7 Mon Sep 17 00:00:00 2001 From: Jan Weinschenker <jan.weinschenker@holisticon.de> Date: Mon, 30 Sep 2019 20:50:52 +0200 Subject: [PATCH 2/4] test: add samples of api tests --- .../kotlin/org/openapitools/api/PetApiTest.kt | 150 ++++++++++++++++++ .../org/openapitools/api/StoreApiTest.kt | 79 +++++++++ .../org/openapitools/api/UserApiTest.kt | 145 +++++++++++++++++ .../kotlin/org/openapitools/api/PetApiTest.kt | 148 +++++++++++++++++ .../org/openapitools/api/StoreApiTest.kt | 77 +++++++++ .../org/openapitools/api/UserApiTest.kt | 143 +++++++++++++++++ 6 files changed, 742 insertions(+) create mode 100644 samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt create mode 100644 samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt create mode 100644 samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt create mode 100644 samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt create mode 100644 samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt create mode 100644 samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt new file mode 100644 index 00000000000..5000cc2eb5e --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -0,0 +1,150 @@ +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 + +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 + */ + @Test + fun addPetTest() = runBlockingTest { + val pet:Pet? = null + val response: ResponseEntity<Unit> = api.addPet(pet!!) + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deletePetTest() = runBlockingTest { + val petId:kotlin.Long? = null + val apiKey:kotlin.String? = null + val response: ResponseEntity<Unit> = 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 + */ + @Test + fun findPetsByStatusTest() = runBlockingTest { + val status:kotlin.collections.List<kotlin.String>? = null + val response: ResponseEntity<Flow<Pet>> = 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 + */ + @Test + fun findPetsByTagsTest() = runBlockingTest { + val tags:kotlin.collections.List<kotlin.String>? = null + val response: ResponseEntity<Flow<Pet>> = api.findPetsByTags(tags!!) + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getPetByIdTest() = runBlockingTest { + val petId:kotlin.Long? = null + val response: ResponseEntity<Pet> = api.getPetById(petId!!) + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetTest() = runBlockingTest { + val pet:Pet? = null + val response: ResponseEntity<Unit> = api.updatePet(pet!!) + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @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<Unit> = api.updatePetWithForm(petId!!, name!!, status!!) + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @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<ModelApiResponse> = api.uploadFile(petId!!, additionalMetadata!!, file!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt new file mode 100644 index 00000000000..b084fe87b49 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -0,0 +1,79 @@ +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 + +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 + */ + @Test + fun deleteOrderTest() = runBlockingTest { + val orderId:kotlin.String? = null + val response: ResponseEntity<Unit> = 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 + */ + @Test + fun getInventoryTest() = runBlockingTest { + val response: ResponseEntity<Map<String, kotlin.Int>> = 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 + */ + @Test + fun getOrderByIdTest() = runBlockingTest { + val orderId:kotlin.Long? = null + val response: ResponseEntity<Order> = api.getOrderById(orderId!!) + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun placeOrderTest() = runBlockingTest { + val order:Order? = null + val response: ResponseEntity<Order> = api.placeOrder(order!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt new file mode 100644 index 00000000000..03d1eb70a7c --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot-reactive/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -0,0 +1,145 @@ +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 + +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 + */ + @Test + fun createUserTest() = runBlockingTest { + val user:User? = null + val response: ResponseEntity<Unit> = api.createUser(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithArrayInputTest() = runBlockingTest { + val user:kotlin.collections.List<User>? = null + val response: ResponseEntity<Unit> = api.createUsersWithArrayInput(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithListInputTest() = runBlockingTest { + val user:kotlin.collections.List<User>? = null + val response: ResponseEntity<Unit> = api.createUsersWithListInput(user!!) + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteUserTest() = runBlockingTest { + val username:kotlin.String? = null + val response: ResponseEntity<Unit> = api.deleteUser(username!!) + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getUserByNameTest() = runBlockingTest { + val username:kotlin.String? = null + val response: ResponseEntity<User> = api.getUserByName(username!!) + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun loginUserTest() = runBlockingTest { + val username:kotlin.String? = null + val password:kotlin.String? = null + val response: ResponseEntity<kotlin.String> = api.loginUser(username!!, password!!) + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun logoutUserTest() = runBlockingTest { + val response: ResponseEntity<Unit> = api.logoutUser() + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updateUserTest() = runBlockingTest { + val username:kotlin.String? = null + val user:User? = null + val response: ResponseEntity<Unit> = api.updateUser(username!!, user!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt new file mode 100644 index 00000000000..fbb4dec50a3 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/PetApiTest.kt @@ -0,0 +1,148 @@ +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 { + + 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 + */ + @Test + fun addPetTest() { + val pet:Pet? = null + val response: ResponseEntity<Unit> = api.addPet(pet!!) + + // TODO: test validations + } + + /** + * Deletes a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deletePetTest() { + val petId:kotlin.Long? = null + val apiKey:kotlin.String? = null + val response: ResponseEntity<Unit> = 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 + */ + @Test + fun findPetsByStatusTest() { + val status:kotlin.collections.List<kotlin.String>? = null + val response: ResponseEntity<List<Pet>> = 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 + */ + @Test + fun findPetsByTagsTest() { + val tags:kotlin.collections.List<kotlin.String>? = null + val response: ResponseEntity<List<Pet>> = api.findPetsByTags(tags!!) + + // TODO: test validations + } + + /** + * Find pet by ID + * + * Returns a single pet + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getPetByIdTest() { + val petId:kotlin.Long? = null + val response: ResponseEntity<Pet> = api.getPetById(petId!!) + + // TODO: test validations + } + + /** + * Update an existing pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updatePetTest() { + val pet:Pet? = null + val response: ResponseEntity<Unit> = api.updatePet(pet!!) + + // TODO: test validations + } + + /** + * Updates a pet in the store with form data + * + * + * + * @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<Unit> = api.updatePetWithForm(petId!!, name!!, status!!) + + // TODO: test validations + } + + /** + * uploads an image + * + * + * + * @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<ModelApiResponse> = api.uploadFile(petId!!, additionalMetadata!!, file!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt new file mode 100644 index 00000000000..423f98d297f --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/StoreApiTest.kt @@ -0,0 +1,77 @@ +package org.openapitools.api + +import org.openapitools.model.Order +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +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 + */ + @Test + fun deleteOrderTest() { + val orderId:kotlin.String? = null + val response: ResponseEntity<Unit> = 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 + */ + @Test + fun getInventoryTest() { + val response: ResponseEntity<Map<String, kotlin.Int>> = 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 + */ + @Test + fun getOrderByIdTest() { + val orderId:kotlin.Long? = null + val response: ResponseEntity<Order> = api.getOrderById(orderId!!) + + // TODO: test validations + } + + /** + * Place an order for a pet + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun placeOrderTest() { + val order:Order? = null + val response: ResponseEntity<Order> = api.placeOrder(order!!) + + // TODO: test validations + } + +} diff --git a/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt new file mode 100644 index 00000000000..033b9efd611 --- /dev/null +++ b/samples/openapi3/server/petstore/kotlin-springboot/src/test/kotlin/org/openapitools/api/UserApiTest.kt @@ -0,0 +1,143 @@ +package org.openapitools.api + +import org.openapitools.model.User +import org.junit.jupiter.api.Test + +import org.springframework.http.ResponseEntity + +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 + */ + @Test + fun createUserTest() { + val user:User? = null + val response: ResponseEntity<Unit> = api.createUser(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithArrayInputTest() { + val user:kotlin.collections.List<User>? = null + val response: ResponseEntity<Unit> = api.createUsersWithArrayInput(user!!) + + // TODO: test validations + } + + /** + * Creates list of users with given input array + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun createUsersWithListInputTest() { + val user:kotlin.collections.List<User>? = null + val response: ResponseEntity<Unit> = api.createUsersWithListInput(user!!) + + // TODO: test validations + } + + /** + * Delete user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun deleteUserTest() { + val username:kotlin.String? = null + val response: ResponseEntity<Unit> = api.deleteUser(username!!) + + // TODO: test validations + } + + /** + * Get user by user name + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun getUserByNameTest() { + val username:kotlin.String? = null + val response: ResponseEntity<User> = api.getUserByName(username!!) + + // TODO: test validations + } + + /** + * Logs user into the system + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun loginUserTest() { + val username:kotlin.String? = null + val password:kotlin.String? = null + val response: ResponseEntity<kotlin.String> = api.loginUser(username!!, password!!) + + // TODO: test validations + } + + /** + * Logs out current logged in user session + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun logoutUserTest() { + val response: ResponseEntity<Unit> = api.logoutUser() + + // TODO: test validations + } + + /** + * Updated user + * + * This can only be done by the logged in user. + * + * @throws ApiException + * if the Api call fails + */ + @Test + fun updateUserTest() { + val username:kotlin.String? = null + val user:User? = null + val response: ResponseEntity<Unit> = api.updateUser(username!!, user!!) + + // TODO: test validations + } + +} -- GitLab From 43c861e822857031b70cffa143b35cc4ae24ce07 Mon Sep 17 00:00:00 2001 From: Jan Weinschenker <jan.weinschenker@holisticon.de> Date: Mon, 30 Sep 2019 21:46:31 +0200 Subject: [PATCH 3/4] docs: add markdown docu for new configOption serializableModel --- docs/generators/kotlin-server.md | 1 + docs/generators/kotlin.md | 1 + 2 files changed, 2 insertions(+) diff --git a/docs/generators/kotlin-server.md b/docs/generators/kotlin-server.md index 4c18a6165c9..6df6e83855f 100644 --- a/docs/generators/kotlin-server.md +++ b/docs/generators/kotlin-server.md @@ -16,6 +16,7 @@ sidebar_label: kotlin-server |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| |serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |parcelizeModels|toggle "@Parcelize" for generated models| |null| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |library|library template (sub-template)|<dl><dt>**ktor**</dt><dd>ktor framework</dd><dl>|ktor| |featureAutoHead|Automatically provide responses to HEAD requests for existing routes that have the GET verb defined.| |true| |featureConditionalHeaders|Avoid sending content if client already has same content, by checking ETag or LastModified properties.| |false| diff --git a/docs/generators/kotlin.md b/docs/generators/kotlin.md index 264842d4bb2..3dc2492d077 100644 --- a/docs/generators/kotlin.md +++ b/docs/generators/kotlin.md @@ -16,6 +16,7 @@ sidebar_label: kotlin |enumPropertyNaming|Naming convention for enum properties: 'camelCase', 'PascalCase', 'snake_case', 'UPPERCASE', and 'original'| |camelCase| |serializationLibrary|What serialization library to use: 'moshi' (default), or 'gson'| |moshi| |parcelizeModels|toggle "@Parcelize" for generated models| |null| +|serializableModel|boolean - toggle "implements Serializable" for generated models| |false| |dateLibrary|Option. Date library to use|<dl><dt>**string**</dt><dd>String</dd><dt>**java8**</dt><dd>Java 8 native JSR310 (jvm only)</dd><dt>**threetenbp**</dt><dd>Threetenbp (jvm only)</dd><dl>|java8| |collectionType|Option. Collection type to use|<dl><dt>**array**</dt><dd>kotlin.Array</dd><dt>**list**</dt><dd>kotlin.collections.List</dd><dl>|array| |library|Library template (sub-template) to use|<dl><dt>**jvm**</dt><dd>Platform: Java Virtual Machine. HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1.</dd><dt>**multiplatform**</dt><dd>Platform: Kotlin multiplatform. HTTP client: Ktor 1.2.4. JSON processing: Kotlinx Serialization: 0.12.0.</dd><dl>|jvm| -- GitLab From e0fed0091ca48a72fef6d1734fb5f4d59f1f2104 Mon Sep 17 00:00:00 2001 From: Jan Weinschenker <jan.weinschenker@holisticon.de> Date: Tue, 1 Oct 2019 05:54:31 +0200 Subject: [PATCH 4/4] fix: do not use parcelize in script --- bin/kotlin-client-petstore.sh | 2 +- bin/kotlin-client-string.sh | 2 +- bin/kotlin-server-petstore.sh | 2 +- bin/kotlin-springboot-petstore-server.sh | 2 +- bin/openapi3/kotlin-client-petstore.sh | 2 +- bin/openapi3/kotlin-springboot-petstore-server.sh | 2 +- .../kotlin/org/openapitools/client/models/ApiResponse.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/Category.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Order.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Pet.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Tag.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/User.kt | 6 +----- .../openapitools/client/models/AdditionalPropertiesClass.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/Animal.kt | 6 +----- .../kotlin/org/openapitools/client/models/ApiResponse.kt | 6 +----- .../openapitools/client/models/ArrayOfArrayOfNumberOnly.kt | 6 +----- .../org/openapitools/client/models/ArrayOfNumberOnly.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/ArrayTest.kt | 6 +----- .../kotlin/org/openapitools/client/models/Capitalization.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Cat.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/CatAllOf.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/Category.kt | 6 +----- .../kotlin/org/openapitools/client/models/ClassModel.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/Client.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Dog.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/DogAllOf.kt | 6 +----- .../kotlin/org/openapitools/client/models/EnumArrays.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/EnumTest.kt | 6 +----- .../org/openapitools/client/models/FileSchemaTestClass.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Foo.kt | 6 +----- .../kotlin/org/openapitools/client/models/FormatTest.kt | 6 +----- .../org/openapitools/client/models/HasOnlyReadOnly.kt | 6 +----- .../org/openapitools/client/models/HealthCheckResult.kt | 6 +----- .../kotlin/org/openapitools/client/models/InlineObject.kt | 6 +----- .../kotlin/org/openapitools/client/models/InlineObject1.kt | 6 +----- .../kotlin/org/openapitools/client/models/InlineObject2.kt | 6 +----- .../kotlin/org/openapitools/client/models/InlineObject3.kt | 6 +----- .../kotlin/org/openapitools/client/models/InlineObject4.kt | 6 +----- .../kotlin/org/openapitools/client/models/InlineObject5.kt | 6 +----- .../org/openapitools/client/models/InlineResponseDefault.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/List.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/MapTest.kt | 6 +----- .../models/MixedPropertiesAndAdditionalPropertiesClass.kt | 6 +----- .../org/openapitools/client/models/Model200Response.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Name.kt | 6 +----- .../kotlin/org/openapitools/client/models/NullableClass.kt | 6 +----- .../kotlin/org/openapitools/client/models/NumberOnly.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Order.kt | 6 +----- .../kotlin/org/openapitools/client/models/OuterComposite.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Pet.kt | 6 +----- .../kotlin/org/openapitools/client/models/ReadOnlyFirst.kt | 6 +----- .../main/kotlin/org/openapitools/client/models/Return.kt | 6 +----- .../org/openapitools/client/models/SpecialModelname.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/Tag.kt | 6 +----- .../src/main/kotlin/org/openapitools/client/models/User.kt | 6 +----- .../kotlin/org/openapitools/server/models/ApiResponse.kt | 6 +----- .../main/kotlin/org/openapitools/server/models/Category.kt | 6 +----- .../src/main/kotlin/org/openapitools/server/models/Order.kt | 6 +----- .../src/main/kotlin/org/openapitools/server/models/Pet.kt | 6 +----- .../src/main/kotlin/org/openapitools/server/models/Tag.kt | 6 +----- .../src/main/kotlin/org/openapitools/server/models/User.kt | 6 +----- 61 files changed, 61 insertions(+), 281 deletions(-) diff --git a/bin/kotlin-client-petstore.sh b/bin/kotlin-client-petstore.sh index 820c3fc4bd9..409911eb113 100755 --- a/bin/kotlin-client-petstore.sh +++ b/bin/kotlin-client-petstore.sh @@ -27,6 +27,6 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true,parcelizeModels=true -o samples/client/petstore/kotlin $@" +ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o samples/client/petstore/kotlin $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-client-string.sh b/bin/kotlin-client-string.sh index e0af2514075..57fae03ab11 100755 --- a/bin/kotlin-client-string.sh +++ b/bin/kotlin-client-string.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-string --additional-properties dateLibrary=string,serializableModel=true,parcelizeModels=true -o samples/client/petstore/kotlin-string $@" +ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-petstore-string --additional-properties dateLibrary=string,serializableModel=true -o samples/client/petstore/kotlin-string $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-server-petstore.sh b/bin/kotlin-server-petstore.sh index 57ce7b6296f..755a560a1f1 100755 --- a/bin/kotlin-server-petstore.sh +++ b/bin/kotlin-server-petstore.sh @@ -27,7 +27,7 @@ fi # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor --additional-properties hideGenerationTimestamp=true,serializableModel=true,parcelizeModels=true $@" +ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor --additional-properties hideGenerationTimestamp=true,serializableModel=true $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/bin/kotlin-springboot-petstore-server.sh b/bin/kotlin-springboot-petstore-server.sh index 89bc4cce4ef..73b56bcf8fa 100755 --- a/bin/kotlin-springboot-petstore-server.sh +++ b/bin/kotlin-springboot-petstore-server.sh @@ -26,7 +26,7 @@ then fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true,parcelizeModels=true" +ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true" echo "Cleaning previously generated files if any from samples/server/petstore/kotlin-springboot" rm -rf samples/server/petstore/kotlin-springboot diff --git a/bin/openapi3/kotlin-client-petstore.sh b/bin/openapi3/kotlin-client-petstore.sh index 2172e549127..d0352276800 100755 --- a/bin/openapi3/kotlin-client-petstore.sh +++ b/bin/openapi3/kotlin-client-petstore.sh @@ -26,7 +26,7 @@ then fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true,parcelizeModels=true -o samples/openapi3/client/petstore/kotlin $@" +ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8,serializableModel=true -o samples/openapi3/client/petstore/kotlin $@" echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin" rm -rf samples/openapi3/client/petstore/kotlin diff --git a/bin/openapi3/kotlin-springboot-petstore-server.sh b/bin/openapi3/kotlin-springboot-petstore-server.sh index f97c81774d1..8779e1a0412 100755 --- a/bin/openapi3/kotlin-springboot-petstore-server.sh +++ b/bin/openapi3/kotlin-springboot-petstore-server.sh @@ -26,7 +26,7 @@ then fi export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true,parcelizeModels=true" +ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-spring -g kotlin-spring -o samples/openapi3/server/petstore/kotlin-springboot --additional-properties=library=spring-boot,beanValidations=true,swaggerAnnotations=true,serviceImplementation=true,serializableModel=true" echo "Cleaning previously generated files if any from samples/server/openapi3/petstore/kotlin-springboot" rm -rf samples/server/openapi3/petstore/kotlin-springboot 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/ApiResponse.kt index 36730e94745..6d5c231ccc8 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/ApiResponse.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * Describes the result of uploading an image resource @@ -23,7 +20,6 @@ import java.io.Serializable * @param type * @param message */ -@Parcelize data class ApiResponse ( @Json(name = "code") @@ -33,6 +29,6 @@ data class ApiResponse ( @Json(name = "message") val message: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index c0c6521a692..1fe92af826c 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A category for a pet * @param id * @param name */ -@Parcelize data class Category ( @Json(name = "id") @@ -30,6 +26,6 @@ data class Category ( @Json(name = "name") val name: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index afa77d46b46..a5478a61626 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * An order for a pets from the pet store @@ -26,7 +23,6 @@ import java.io.Serializable * @param status Order Status * @param complete */ -@Parcelize data class Order ( @Json(name = "id") @@ -43,8 +39,8 @@ data class Order ( @Json(name = "complete") val complete: kotlin.Boolean? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index ac7415733e4..3b4dfc22abd 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -15,9 +15,6 @@ import org.openapitools.client.models.Category import org.openapitools.client.models.Tag import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A pet for sale in the pet store @@ -28,7 +25,6 @@ import java.io.Serializable * @param tags * @param status pet status in the store */ -@Parcelize data class Pet ( @Json(name = "name") @@ -45,8 +41,8 @@ data class Pet ( @Json(name = "status") val status: Pet.Status? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index 9016441f929..1d97954c460 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A tag for a pet * @param id * @param name */ -@Parcelize data class Tag ( @Json(name = "id") @@ -30,6 +26,6 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index d553c9f5f62..df835a5d968 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A User who is purchasing from the pet store @@ -28,7 +25,6 @@ import java.io.Serializable * @param phone * @param userStatus User Status */ -@Parcelize data class User ( @Json(name = "id") @@ -49,6 +45,6 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt index 7ee276ec597..4367965e2dc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/AdditionalPropertiesClass.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param mapProperty * @param mapOfMapProperty */ -@Parcelize data class AdditionalPropertiesClass ( @Json(name = "map_property") @@ -30,6 +26,6 @@ data class AdditionalPropertiesClass ( @Json(name = "map_of_map_property") val mapOfMapProperty: kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt index ec99cb1d03e..ba590f165b8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Animal.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param className * @param color */ -@Parcelize data class Animal ( @Json(name = "className") @@ -30,6 +26,6 @@ data class Animal ( @Json(name = "color") val color: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt index 09633d15779..22773e65057 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -23,7 +20,6 @@ import java.io.Serializable * @param type * @param message */ -@Parcelize data class ApiResponse ( @Json(name = "code") @@ -33,6 +29,6 @@ data class ApiResponse ( @Json(name = "message") val message: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt index ab9c79c6a34..5c9048466e0 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfArrayOfNumberOnly.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param arrayArrayNumber */ -@Parcelize data class ArrayOfArrayOfNumberOnly ( @Json(name = "ArrayArrayNumber") val arrayArrayNumber: kotlin.Array<kotlin.Array<java.math.BigDecimal>>? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt index 9179165e002..214ef4b0cfe 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayOfNumberOnly.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param arrayNumber */ -@Parcelize data class ArrayOfNumberOnly ( @Json(name = "ArrayNumber") val arrayNumber: kotlin.Array<java.math.BigDecimal>? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt index 75c83a35d47..d406e97bf71 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ArrayTest.kt @@ -14,9 +14,6 @@ package org.openapitools.client.models import org.openapitools.client.models.ReadOnlyFirst import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -24,7 +21,6 @@ import java.io.Serializable * @param arrayArrayOfInteger * @param arrayArrayOfModel */ -@Parcelize data class ArrayTest ( @Json(name = "array_of_string") @@ -34,6 +30,6 @@ data class ArrayTest ( @Json(name = "array_array_of_model") val arrayArrayOfModel: kotlin.Array<kotlin.Array<ReadOnlyFirst>>? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt index 3ca2c485116..c9153d08cc2 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Capitalization.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -26,7 +23,6 @@ import java.io.Serializable * @param scAETHFlowPoints * @param ATT_NAME Name of the pet */ -@Parcelize data class Capitalization ( @Json(name = "smallCamel") @@ -43,6 +39,6 @@ data class Capitalization ( @Json(name = "ATT_NAME") val ATT_NAME: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt index 1f357573952..05c1647fb79 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Cat.kt @@ -15,15 +15,11 @@ import org.openapitools.client.models.Animal import org.openapitools.client.models.CatAllOf import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param declawed */ -@Parcelize data class Cat ( @Json(name = "className") @@ -33,6 +29,6 @@ data class Cat ( @Json(name = "color") val color: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt index b4681baff4d..c4cb55cb62c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/CatAllOf.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param declawed */ -@Parcelize data class CatAllOf ( @Json(name = "declawed") val declawed: kotlin.Boolean? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt index a259794eaf9..f3280e75d4c 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Category.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param id * @param name */ -@Parcelize data class Category ( @Json(name = "name") @@ -30,6 +26,6 @@ data class Category ( @Json(name = "id") val id: kotlin.Long? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt index f22f7d7c89d..7580a49224f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ClassModel.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * Model for testing model with \"_class\" property * @param propertyClass */ -@Parcelize data class ClassModel ( @Json(name = "_class") val propertyClass: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt index 6911d296186..09324d61a09 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Client.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param client */ -@Parcelize data class Client ( @Json(name = "client") val client: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt index 5dbf742450a..54a2bb6feaf 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Dog.kt @@ -15,15 +15,11 @@ import org.openapitools.client.models.Animal import org.openapitools.client.models.DogAllOf import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param breed */ -@Parcelize data class Dog ( @Json(name = "className") @@ -33,6 +29,6 @@ data class Dog ( @Json(name = "color") val color: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt index 34de880409e..6085540ff7f 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/DogAllOf.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param breed */ -@Parcelize data class DogAllOf ( @Json(name = "breed") val breed: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt index 4b85d474d56..79b1a4c1018 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumArrays.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param justSymbol * @param arrayEnum */ -@Parcelize data class EnumArrays ( @Json(name = "just_symbol") @@ -30,8 +26,8 @@ data class EnumArrays ( @Json(name = "array_enum") val arrayEnum: kotlin.Array<EnumArrays.ArrayEnum>? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt index 97baa679d50..52ea113cc92 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/EnumTest.kt @@ -17,9 +17,6 @@ import org.openapitools.client.models.OuterEnumInteger import org.openapitools.client.models.OuterEnumIntegerDefaultValue import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -32,7 +29,6 @@ import java.io.Serializable * @param outerEnumDefaultValue * @param outerEnumIntegerDefaultValue */ -@Parcelize data class EnumTest ( @Json(name = "enum_string_required") @@ -52,8 +48,8 @@ data class EnumTest ( @Json(name = "outerEnumIntegerDefaultValue") val outerEnumIntegerDefaultValue: OuterEnumIntegerDefaultValue? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt index c03e6dbc55e..ab39639e0cc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FileSchemaTestClass.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param file * @param files */ -@Parcelize data class FileSchemaTestClass ( @Json(name = "file") @@ -30,6 +26,6 @@ data class FileSchemaTestClass ( @Json(name = "files") val files: kotlin.Array<java.io.File>? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt index cad77c1bffd..0dd32c21afb 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Foo.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param bar */ -@Parcelize data class Foo ( @Json(name = "bar") val bar: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt index d9d3395bacd..e746da485f9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/FormatTest.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -35,7 +32,6 @@ import java.io.Serializable * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */ -@Parcelize data class FormatTest ( @Json(name = "number") @@ -71,6 +67,6 @@ data class FormatTest ( @Json(name = "pattern_with_digits_and_delimiter") val patternWithDigitsAndDelimiter: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt index 4a2b091b8fb..04eef4d206b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HasOnlyReadOnly.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param bar * @param foo */ -@Parcelize data class HasOnlyReadOnly ( @Json(name = "bar") @@ -30,6 +26,6 @@ data class HasOnlyReadOnly ( @Json(name = "foo") val foo: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt index 44eb7dd90b9..ce497df1fca 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/HealthCheckResult.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. * @param nullableMessage */ -@Parcelize data class HealthCheckResult ( @Json(name = "NullableMessage") val nullableMessage: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt index 5102d26b779..f2f290f4081 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param name Updated name of the pet * @param status Updated status of the pet */ -@Parcelize data class InlineObject ( /* Updated name of the pet */ @@ -32,6 +28,6 @@ data class InlineObject ( @Json(name = "status") val status: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt index 4943ba303c0..ea1e3ae2411 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param additionalMetadata Additional data to pass to server * @param file file to upload */ -@Parcelize data class InlineObject1 ( /* Additional data to pass to server */ @@ -32,6 +28,6 @@ data class InlineObject1 ( @Json(name = "file") val file: java.io.File? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt index 2cb768d23a9..ec48e39edf2 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject2.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param enumFormStringArray Form parameter enum test (string array) * @param enumFormString Form parameter enum test (string) */ -@Parcelize data class InlineObject2 ( /* Form parameter enum test (string array) */ @@ -32,8 +28,8 @@ data class InlineObject2 ( @Json(name = "enum_form_string") val enumFormString: InlineObject2.EnumFormString? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt index c6482d344bc..b2725c7fc12 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject3.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -34,7 +31,6 @@ import java.io.Serializable * @param password None * @param callback None */ -@Parcelize data class InlineObject3 ( /* None */ @@ -80,6 +76,6 @@ data class InlineObject3 ( @Json(name = "callback") val callback: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt index 5eca3073b02..f6776d3b7fc 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject4.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param param field1 * @param param2 field2 */ -@Parcelize data class InlineObject4 ( /* field1 */ @@ -32,6 +28,6 @@ data class InlineObject4 ( @Json(name = "param2") val param2: kotlin.String ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt index 3529f36465b..0497fa03e67 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineObject5.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param additionalMetadata Additional data to pass to server * @param requiredFile file to upload */ -@Parcelize data class InlineObject5 ( /* file to upload */ @@ -32,6 +28,6 @@ data class InlineObject5 ( @Json(name = "additionalMetadata") val additionalMetadata: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt index fa95f8e0011..b09c724605e 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/InlineResponseDefault.kt @@ -14,20 +14,16 @@ package org.openapitools.client.models import org.openapitools.client.models.Foo import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param string */ -@Parcelize data class InlineResponseDefault ( @Json(name = "string") val string: Foo? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt index a639e7bab99..43f321eabcb 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/List.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param ``123minusList`` */ -@Parcelize data class List ( @Json(name = "123-list") val ``123minusList``: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt index c0287541a49..bf1aa56a158 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MapTest.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -24,7 +21,6 @@ import java.io.Serializable * @param directMap * @param indirectMap */ -@Parcelize data class MapTest ( @Json(name = "map_map_of_string") @@ -36,8 +32,8 @@ data class MapTest ( @Json(name = "indirect_map") val indirectMap: kotlin.collections.Map<kotlin.String, kotlin.Boolean>? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt index 0f95e28ef1b..1551efc4c2a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/MixedPropertiesAndAdditionalPropertiesClass.kt @@ -14,9 +14,6 @@ package org.openapitools.client.models import org.openapitools.client.models.Animal import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -24,7 +21,6 @@ import java.io.Serializable * @param dateTime * @param map */ -@Parcelize data class MixedPropertiesAndAdditionalPropertiesClass ( @Json(name = "uuid") @@ -34,6 +30,6 @@ data class MixedPropertiesAndAdditionalPropertiesClass ( @Json(name = "map") val map: kotlin.collections.Map<kotlin.String, Animal>? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt index 43835b140f9..bb071875225 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Model200Response.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * Model for testing model name starting with number * @param name * @param propertyClass */ -@Parcelize data class Model200Response ( @Json(name = "name") @@ -30,6 +26,6 @@ data class Model200Response ( @Json(name = "class") val propertyClass: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt index 93d93a4be13..1362bd97c1b 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Name.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * Model for testing model name same as property name @@ -24,7 +21,6 @@ import java.io.Serializable * @param property * @param ``123number`` */ -@Parcelize data class Name ( @Json(name = "name") @@ -36,6 +32,6 @@ data class Name ( @Json(name = "123Number") val ``123number``: kotlin.Int? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt index 703383e7dec..7bfd1d97c1a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NullableClass.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -32,7 +29,6 @@ import java.io.Serializable * @param objectAndItemsNullableProp * @param objectItemsNullable */ -@Parcelize data class NullableClass ( @Json(name = "integer_prop") @@ -60,6 +56,6 @@ data class NullableClass ( @Json(name = "object_items_nullable") val objectItemsNullable: kotlin.collections.Map<kotlin.String, kotlin.Any>? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt index 89e3580868c..d14ad1907e1 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/NumberOnly.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param justNumber */ -@Parcelize data class NumberOnly ( @Json(name = "JustNumber") val justNumber: java.math.BigDecimal? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt index 1a84e21729c..07459585e99 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Order.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -26,7 +23,6 @@ import java.io.Serializable * @param status Order Status * @param complete */ -@Parcelize data class Order ( @Json(name = "id") @@ -43,8 +39,8 @@ data class Order ( @Json(name = "complete") val complete: kotlin.Boolean? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt index de6c6e332cb..21565c2cff3 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/OuterComposite.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -23,7 +20,6 @@ import java.io.Serializable * @param myString * @param myBoolean */ -@Parcelize data class OuterComposite ( @Json(name = "my_number") @@ -33,6 +29,6 @@ data class OuterComposite ( @Json(name = "my_boolean") val myBoolean: kotlin.Boolean? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt index 21aa4c57fae..23abc63ce39 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt @@ -15,9 +15,6 @@ import org.openapitools.client.models.Category import org.openapitools.client.models.Tag import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -28,7 +25,6 @@ import java.io.Serializable * @param tags * @param status pet status in the store */ -@Parcelize data class Pet ( @Json(name = "name") @@ -45,8 +41,8 @@ data class Pet ( @Json(name = "status") val status: Pet.Status? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt index 01926a11816..325a4c5ffd8 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/ReadOnlyFirst.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param bar * @param baz */ -@Parcelize data class ReadOnlyFirst ( @Json(name = "bar") @@ -30,6 +26,6 @@ data class ReadOnlyFirst ( @Json(name = "baz") val baz: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt index e6e18331ecb..6670a26a8f9 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Return.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * Model for testing reserved words * @param ``return`` */ -@Parcelize data class Return ( @Json(name = "return") val ``return``: kotlin.Int? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt index a26aa69fd6c..2bcfeb506eb 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/SpecialModelname.kt @@ -13,20 +13,16 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket */ -@Parcelize data class SpecialModelname ( @Json(name = "$special[property.name]") val dollarSpecialLeftSquareBracketPropertyPeriodNameRightSquareBracket: kotlin.Long? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt index d406f458f03..7596c7d495d 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Tag.kt @@ -13,16 +13,12 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * * @param id * @param name */ -@Parcelize data class Tag ( @Json(name = "id") @@ -30,6 +26,6 @@ data class Tag ( @Json(name = "name") val name: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable diff --git a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt index d252bfff176..d6bd140f13a 100644 --- a/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt +++ b/samples/openapi3/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/User.kt @@ -13,9 +13,6 @@ package org.openapitools.client.models import com.squareup.moshi.Json -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * @@ -28,7 +25,6 @@ import java.io.Serializable * @param phone * @param userStatus User Status */ -@Parcelize data class User ( @Json(name = "id") @@ -49,6 +45,6 @@ data class User ( @Json(name = "userStatus") val userStatus: kotlin.Int? = null ) +: Serializable - : Parcelable, Serializable 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/ApiResponse.kt index 24913c178cf..5ced7087da8 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/ApiResponse.kt @@ -12,9 +12,6 @@ package org.openapitools.server.models -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * Describes the result of uploading an image resource @@ -22,14 +19,13 @@ import java.io.Serializable * @param type * @param message */ -@Parcelize data class ApiResponse ( val code: kotlin.Int? = null, val type: kotlin.String? = null, val message: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable { } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt index e25deafbce6..a347a27877f 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Category.kt @@ -12,22 +12,18 @@ package org.openapitools.server.models -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A category for a pet * @param id * @param name */ -@Parcelize data class Category ( val id: kotlin.Long? = null, val name: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable { } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt index 42667105a4c..f3eba3816ed 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Order.kt @@ -12,9 +12,6 @@ package org.openapitools.server.models -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * An order for a pets from the pet store @@ -25,7 +22,6 @@ import java.io.Serializable * @param status Order Status * @param complete */ -@Parcelize data class Order ( val id: kotlin.Long? = null, val petId: kotlin.Long? = null, @@ -35,8 +31,8 @@ data class Order ( val status: Order.Status? = null, val complete: kotlin.Boolean? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt index 152e7029a5f..07644fc8bd2 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Pet.kt @@ -14,9 +14,6 @@ package org.openapitools.server.models import org.openapitools.server.models.Category import org.openapitools.server.models.Tag -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A pet for sale in the pet store @@ -27,7 +24,6 @@ import java.io.Serializable * @param tags * @param status pet status in the store */ -@Parcelize data class Pet ( val name: kotlin.String, val photoUrls: kotlin.Array<kotlin.String>, @@ -37,8 +33,8 @@ data class Pet ( /* pet status in the store */ val status: Pet.Status? = null ) +: Serializable - : Parcelable, Serializable { /** diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt index fa9a514826e..aa13b7ca76c 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/Tag.kt @@ -12,22 +12,18 @@ package org.openapitools.server.models -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A tag for a pet * @param id * @param name */ -@Parcelize data class Tag ( val id: kotlin.Long? = null, val name: kotlin.String? = null ) +: Serializable - : Parcelable, Serializable { } diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt index 8e80f83bbdf..0aa8a67299f 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/models/User.kt @@ -12,9 +12,6 @@ package org.openapitools.server.models -import android.os.Parcelable -import kotlinx.android.parcel.Parcelize - import java.io.Serializable /** * A User who is purchasing from the pet store @@ -27,7 +24,6 @@ import java.io.Serializable * @param phone * @param userStatus User Status */ -@Parcelize data class User ( val id: kotlin.Long? = null, val username: kotlin.String? = null, @@ -39,8 +35,8 @@ data class User ( /* User Status */ val userStatus: kotlin.Int? = null ) +: Serializable - : Parcelable, Serializable { } -- GitLab