diff --git a/bin/configs/java-resteasy.yaml b/bin/configs/java-resteasy.yaml index a6b09924858..16142531108 100644 --- a/bin/configs/java-resteasy.yaml +++ b/bin/configs/java-resteasy.yaml @@ -1,8 +1,8 @@ generatorName: java outputDir: samples/client/petstore/java/resteasy -library: resteasy inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: artifactId: petstore-resteasy hideGenerationTimestamp: "true" + library: resteasy diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java index f494204a184..635bc0b13d7 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/config/CodegenConfigurator.java @@ -746,6 +746,11 @@ public class CodegenConfigurator { config.additionalProperties().put(CodegenConstants.TEMPLATE_DIR, workflowSettings.getTemplateDir()); } + // if library is found in additionalProperties, set the library option accordingly + if (config.additionalProperties().containsKey("library")) { + config.setLibrary(String.valueOf(config.additionalProperties().get("library"))); + } + ClientOptInput input = new ClientOptInput() .config(config) .userDefinedTemplates(userDefinedTemplates); diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/FILES b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/FILES index 9cfbb490924..fa7d703fae2 100644 --- a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/.openapi-generator/FILES @@ -8,13 +8,13 @@ gradlew gradlew.bat settings.gradle src/main/AndroidManifest.xml -src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt -src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt -src/main/kotlin/org/openapitools/client/request/GsonRequest.kt -src/main/kotlin/org/openapitools/client/request/IRequestFactory.kt -src/main/kotlin/org/openapitools/client/request/RequestFactory.kt +src/main/java/org/openapitools/client/apis/DefaultApi.kt +src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/java/org/openapitools/client/request/GsonRequest.kt +src/main/java/org/openapitools/client/request/IRequestFactory.kt +src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/request/GsonRequest.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/request/GsonRequest.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/request/IRequestFactory.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/request/IRequestFactory.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/request/RequestFactory.kt b/samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt similarity index 100% rename from samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/kotlin/org/openapitools/client/request/RequestFactory.kt rename to samples/client/petstore/kotlin-array-simple-string-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/.openapi-generator/FILES b/samples/client/petstore/kotlin-array-simple-string-multiplatform/.openapi-generator/FILES index 6d9189fa063..78f5b4e762f 100644 --- a/samples/client/petstore/kotlin-array-simple-string-multiplatform/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/.openapi-generator/FILES @@ -6,22 +6,22 @@ gradle/wrapper/gradle-wrapper.properties gradlew gradlew.bat settings.gradle.kts +src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt +src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt src/commonTest/kotlin/util/Coroutine.kt src/iosTest/kotlin/util/Coroutine.kt src/jsTest/kotlin/util/Coroutine.kt src/jvmTest/kotlin/util/Coroutine.kt -src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt -src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt -src/main/kotlin/org/openapitools/client/auth/Authentication.kt -src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt -src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt -src/main/kotlin/org/openapitools/client/auth/OAuth.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt -src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt -src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt -src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt -src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt -src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt diff --git a/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 00000000000..7478c1af4ec --- /dev/null +++ b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,68 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + + +import org.openapitools.client.infrastructure.* +import io.ktor.client.HttpClientConfig +import io.ktor.client.request.forms.formData +import io.ktor.client.engine.HttpClientEngine +import kotlinx.serialization.json.Json +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +open class DefaultApi( + baseUrl: String = ApiClient.BASE_URL, + httpClientEngine: HttpClientEngine? = null, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, + jsonSerializer: Json = ApiClient.JSON_DEFAULT +) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonSerializer) { + + /** + * + * + * @param ids + * @return void + */ + open suspend fun idsGet(ids: kotlin.collections.List): HttpResponse { + + val localVariableAuthNames = listOf() + + val localVariableBody = + io.ktor.client.utils.EmptyContent + + val localVariableQuery = mutableMapOf>() + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.GET, + "/{ids}".replace("{" + "ids" + "}", ids.joinToString(",")), + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + ) + + return request( + localVariableConfig, + localVariableBody, + localVariableAuthNames + ).wrap() + } + + +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/Authentication.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/Authentication.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/auth/OAuth.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt rename to samples/client/petstore/kotlin-array-simple-string-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/.openapi-generator/FILES b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/.openapi-generator/FILES index 109097a52c7..b3293eef4ed 100644 --- a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/.openapi-generator/FILES @@ -7,23 +7,23 @@ gradle/wrapper/gradle-wrapper.properties gradlew gradlew.bat settings.gradle.kts +src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt +src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/commonMain/kotlin/org/openapitools/client/models/Apa.kt src/commonTest/kotlin/util/Coroutine.kt src/iosTest/kotlin/util/Coroutine.kt src/jsTest/kotlin/util/Coroutine.kt src/jvmTest/kotlin/util/Coroutine.kt -src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt -src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt -src/main/kotlin/org/openapitools/client/auth/Authentication.kt -src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt -src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt -src/main/kotlin/org/openapitools/client/auth/OAuth.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt -src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt -src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt -src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt -src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt -src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt -src/main/kotlin/org/openapitools/client/models/Apa.kt diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt new file mode 100644 index 00000000000..3ca371d4e09 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt @@ -0,0 +1,69 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.apis + +import org.openapitools.client.models.Apa + +import org.openapitools.client.infrastructure.* +import io.ktor.client.HttpClientConfig +import io.ktor.client.request.forms.formData +import io.ktor.client.engine.HttpClientEngine +import kotlinx.serialization.json.Json +import io.ktor.http.ParametersBuilder +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +open class DefaultApi( + baseUrl: String = ApiClient.BASE_URL, + httpClientEngine: HttpClientEngine? = null, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, + jsonSerializer: Json = ApiClient.JSON_DEFAULT +) : ApiClient(baseUrl, httpClientEngine, httpClientConfig, jsonSerializer) { + + /** + * + * + * @param apa + * @return void + */ + open suspend fun testPost(apa: Apa): HttpResponse { + + val localVariableAuthNames = listOf() + + val localVariableBody = apa + + val localVariableQuery = mutableMapOf>() + val localVariableHeaders = mutableMapOf() + + val localVariableConfig = RequestConfig( + RequestMethod.POST, + "/test", + query = localVariableQuery, + headers = localVariableHeaders, + requiresAuthentication = false, + ) + + return jsonRequest( + localVariableConfig, + localVariableBody, + localVariableAuthNames + ).wrap() + } + + + +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt new file mode 100644 index 00000000000..8bd8b59a8f8 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.auth + +class ApiKeyAuth(private val location: String, val paramName: String) : Authentication { + var apiKey: String? = null + var apiKeyPrefix: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val key: String = apiKey ?: return + val prefix: String? = apiKeyPrefix + val value: String = if (prefix != null) "$prefix $key" else key + when (location) { + "query" -> query[paramName] = listOf(value) + "header" -> headers[paramName] = value + } + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt new file mode 100644 index 00000000000..2c5dfb4acc5 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.auth + +interface Authentication { + + /** + * Apply authentication settings to header and query params. + * + * @param query Query parameters. + * @param headers Header parameters. + */ + fun apply(query: MutableMap>, headers: MutableMap) + +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt new file mode 100644 index 00000000000..40276dbb985 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.auth + +import io.ktor.util.InternalAPI +import io.ktor.util.encodeBase64 + +class HttpBasicAuth : Authentication { + var username: String? = null + var password: String? = null + + @OptIn(InternalAPI::class) + override fun apply(query: MutableMap>, headers: MutableMap) { + if (username == null && password == null) return + val str = (username ?: "") + ":" + (password ?: "") + val auth = str.encodeBase64() + headers["Authorization"] = "Basic $auth" + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt new file mode 100644 index 00000000000..a6fb285af5c --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt @@ -0,0 +1,14 @@ +package org.openapitools.client.auth + +class HttpBearerAuth(private val scheme: String?) : Authentication { + var bearerToken: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val token: String = bearerToken ?: return + headers["Authorization"] = (if (scheme != null) upperCaseBearer(scheme)!! + " " else "") + token + } + + private fun upperCaseBearer(scheme: String): String? { + return if ("bearer".equals(scheme, ignoreCase = true)) "Bearer" else scheme + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt new file mode 100644 index 00000000000..0e8f30f3938 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt @@ -0,0 +1,10 @@ +package org.openapitools.client.auth + +class OAuth : Authentication { + var accessToken: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val token: String = accessToken ?: return + headers["Authorization"] = "Bearer $token" + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..a4a4491eac0 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..789d093c0c7 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,172 @@ +package org.openapitools.client.infrastructure + +import io.ktor.client.HttpClient +import io.ktor.client.HttpClientConfig +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.plugins.contentnegotiation.ContentNegotiation +import io.ktor.client.request.* +import io.ktor.client.request.forms.FormDataContent +import io.ktor.client.request.forms.MultiPartFormDataContent +import io.ktor.client.request.header +import io.ktor.client.request.parameter +import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json +import io.ktor.http.* +import io.ktor.http.content.PartData +import kotlin.Unit +import kotlinx.serialization.json.Json + +import org.openapitools.client.auth.* + +open class ApiClient( + private val baseUrl: String, + httpClientEngine: HttpClientEngine?, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, + private val jsonBlock: Json +) { + + private val clientConfig: (HttpClientConfig<*>) -> Unit by lazy { + { + it.install(ContentNegotiation) { json(jsonBlock) } + httpClientConfig?.invoke(it) + } + } + + private val client: HttpClient by lazy { + httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) + } + + private val authentications: kotlin.collections.Map? = null + + companion object { + const val BASE_URL = "http://localhost" + val JSON_DEFAULT = Json { + ignoreUnknownKeys = true + prettyPrint = true + isLenient = true + } + protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType) + } + + /** + * Set the username for the first HTTP basic authentication. + * + * @param username Username + */ + fun setUsername(username: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + ?: throw Exception("No HTTP basic authentication configured") + auth.username = username + } + + /** + * Set the password for the first HTTP basic authentication. + * + * @param password Password + */ + fun setPassword(password: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + ?: throw Exception("No HTTP basic authentication configured") + auth.password = password + } + + /** + * Set the API key value for the first API key authentication. + * + * @param apiKey API key + * @param paramName The name of the API key parameter, or null or set the first key. + */ + fun setApiKey(apiKey: String, paramName: String? = null) { + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + ?: throw Exception("No API key authentication configured") + auth.apiKey = apiKey + } + + /** + * Set the API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @param paramName The name of the API key parameter, or null or set the first key. + */ + fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + ?: throw Exception("No API key authentication configured") + auth.apiKeyPrefix = apiKeyPrefix + } + + /** + * Set the access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + fun setAccessToken(accessToken: String) { + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? + ?: throw Exception("No OAuth2 authentication configured") + auth.accessToken = accessToken + } + + /** + * Set the access token for the first Bearer authentication. + * + * @param bearerToken The bearer token. + */ + fun setBearerToken(bearerToken: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + ?: throw Exception("No Bearer authentication configured") + auth.bearerToken = bearerToken + } + + protected suspend fun multipartFormRequest(requestConfig: RequestConfig, body: kotlin.collections.List?, authNames: kotlin.collections.List): HttpResponse { + return request(requestConfig, MultiPartFormDataContent(body ?: listOf()), authNames) + } + + protected suspend fun urlEncodedFormRequest(requestConfig: RequestConfig, body: Parameters?, authNames: kotlin.collections.List): HttpResponse { + return request(requestConfig, FormDataContent(body ?: Parameters.Empty), authNames) + } + + protected suspend fun jsonRequest(requestConfig: RequestConfig, body: Any? = null, authNames: kotlin.collections.List): HttpResponse = request(requestConfig, body, authNames) + + protected suspend fun request(requestConfig: RequestConfig, body: Any? = null, authNames: kotlin.collections.List): HttpResponse { + requestConfig.updateForAuth(authNames) + val headers = requestConfig.headers + + return client.request { + this.url { + this.takeFrom(URLBuilder(baseUrl)) + appendPath(requestConfig.path.trimStart('/').split('/')) + requestConfig.query.forEach { query -> + query.value.forEach { value -> + parameter(query.key, value) + } + } + } + this.method = requestConfig.method.httpMethod + headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { + this.setBody(body) + } + } + } + + private fun RequestConfig.updateForAuth(authNames: kotlin.collections.List) { + for (authName in authNames) { + val auth = authentications?.get(authName) ?: throw Exception("Authentication undefined: $authName") + auth.apply(query, headers) + } + } + + private fun URLBuilder.appendPath(components: kotlin.collections.List): URLBuilder = apply { + encodedPath = encodedPath.trimEnd('/') + components.joinToString("/", prefix = "/") { it.encodeURLQueryComponent() } + } + + private val RequestMethod.httpMethod: HttpMethod + get() = when (this) { + RequestMethod.DELETE -> HttpMethod.Delete + RequestMethod.GET -> HttpMethod.Get + RequestMethod.HEAD -> HttpMethod.Head + RequestMethod.PATCH -> HttpMethod.Patch + RequestMethod.PUT -> HttpMethod.Put + RequestMethod.POST -> HttpMethod.Post + RequestMethod.OPTIONS -> HttpMethod.Options + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt new file mode 100644 index 00000000000..5aeea089489 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt @@ -0,0 +1,30 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +class Base64ByteArray(val value: ByteArray) { + @Serializer(Base64ByteArray::class) + companion object : KSerializer { + override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING) + override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64()) + override fun deserialize(decoder: Decoder) = Base64ByteArray(decoder.decodeString().decodeBase64Bytes()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false + other as Base64ByteArray + return value.contentEquals(other.value) + } + + override fun hashCode(): Int { + return value.contentHashCode() + } + + override fun toString(): String { + return "Base64ByteArray(${hex(value)})" + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt new file mode 100644 index 00000000000..0ff85787389 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt @@ -0,0 +1,100 @@ +package org.openapitools.client.infrastructure + +import io.ktor.utils.io.core.* +import kotlin.experimental.and + +private val digits = "0123456789abcdef".toCharArray() +private const val BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" +private const val BASE64_MASK: Byte = 0x3f +private const val BASE64_PAD = '=' +private val BASE64_INVERSE_ALPHABET = IntArray(256) { BASE64_ALPHABET.indexOf(it.toChar()) } + +private fun String.toCharArray(): CharArray = CharArray(length) { get(it) } +private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it] = 0 } +private fun Int.toBase64(): Char = BASE64_ALPHABET[this] +private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK +internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64() +internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { dropLastWhile { it == BASE64_PAD } }.decodeBase64Bytes().readBytes() + +/** + * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes. + * + * Taken from https://github.com/ktorio/ktor/blob/master/ktor-utils/common/src/io/ktor/util/Crypto.kt + */ +internal fun hex(bytes: ByteArray): String { + val result = CharArray(bytes.size * 2) + var resultIndex = 0 + val digits = digits + + for (element in bytes) { + val b = element.toInt() and 0xff + result[resultIndex++] = digits[b shr 4] + result[resultIndex++] = digits[b and 0x0f] + } + + return result.concatToString() +} + +/** + * Decode bytes from HEX string. It should be no spaces and `0x` prefixes. + * + * Taken from https://github.com/ktorio/ktor/blob/master/ktor-utils/common/src/io/ktor/util/Crypto.kt + */ +internal fun hex(s: String): ByteArray { + val result = ByteArray(s.length / 2) + for (idx in result.indices) { + val srcIdx = idx * 2 + val high = s[srcIdx].toString().toInt(16) shl 4 + val low = s[srcIdx + 1].toString().toInt(16) + result[idx] = (high or low).toByte() + } + + return result +} + +/** + * Encode [ByteReadPacket] in base64 format. + * + * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt + */ +private fun ByteReadPacket.encodeBase64(): String = buildString { + val data = ByteArray(3) + while (remaining > 0) { + val read = readAvailable(data) + data.clearFrom(read) + + val padSize = (data.size - read) * 8 / 6 + val chunk = ((data[0].toInt() and 0xFF) shl 16) or + ((data[1].toInt() and 0xFF) shl 8) or + (data[2].toInt() and 0xFF) + + for (index in data.size downTo padSize) { + val char = (chunk shr (6 * index)) and BASE64_MASK.toInt() + append(char.toBase64()) + } + + repeat(padSize) { append(BASE64_PAD) } + } +} + +/** + * Decode [ByteReadPacket] from base64 format + * + * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt + */ +private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket { + val data = ByteArray(4) + + while (remaining > 0) { + val read = readAvailable(data) + + val chunk = data.foldIndexed(0) { index, result, current -> + result or (current.fromBase64().toInt() shl ((3 - index) * 6)) + } + + for (index in data.size - 2 downTo (data.size - read)) { + val origin = (chunk shr (8 * index)) and 0xff + writeByte(origin.toByte()) + } + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt new file mode 100644 index 00000000000..4285d605ea6 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt @@ -0,0 +1,51 @@ +package org.openapitools.client.infrastructure + +import io.ktor.http.Headers +import io.ktor.http.isSuccess +import io.ktor.util.reflect.TypeInfo +import io.ktor.util.reflect.typeInfo + +open class HttpResponse(val response: io.ktor.client.statement.HttpResponse, val provider: BodyProvider) { + val status: Int = response.status.value + val success: Boolean = response.status.isSuccess() + val headers: Map> = response.headers.mapEntries() + suspend fun body(): T = provider.body(response) + suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type) + + companion object { + private fun Headers.mapEntries(): Map> { + val result = mutableMapOf>() + entries().forEach { result[it.key] = it.value } + return result + } + } +} + +interface BodyProvider { + suspend fun body(response: io.ktor.client.statement.HttpResponse): T + suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V +} + +class TypedBodyProvider(private val type: TypeInfo) : BodyProvider { + @Suppress("UNCHECKED_CAST") + override suspend fun body(response: io.ktor.client.statement.HttpResponse): T = + response.call.body(type) as T + + @Suppress("UNCHECKED_CAST") + override suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V = + response.call.body(type) as V +} + +class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider { + override suspend fun body(response: io.ktor.client.statement.HttpResponse): T = + block(provider.body(response)) + + override suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V = + provider.typedBody(response, type) +} + +inline fun io.ktor.client.statement.HttpResponse.wrap(): HttpResponse = + HttpResponse(this, TypedBodyProvider(typeInfo())) + +fun HttpResponse.map(block: T.() -> V): HttpResponse = + HttpResponse(response, MappedBodyProvider(provider, block)) diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt new file mode 100644 index 00000000000..d10d7c50652 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt @@ -0,0 +1,30 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +class OctetByteArray(val value: ByteArray) { + @Serializer(OctetByteArray::class) + companion object : KSerializer { + override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING) + override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value)) + override fun deserialize(decoder: Decoder) = OctetByteArray(hex(decoder.decodeString())) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false + other as OctetByteArray + return value.contentEquals(other.value) + } + + override fun hashCode(): Int { + return value.contentHashCode() + } + + override fun toString(): String { + return "OctetByteArray(${hex(value)})" + } +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 00000000000..be00e38fbae --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..c3518a2d173 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, + val body: T? = null +) diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..beb56f07cdd --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} diff --git a/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt new file mode 100644 index 00000000000..08e06c597b4 --- /dev/null +++ b/samples/client/petstore/kotlin-bigdecimal-default-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt @@ -0,0 +1,51 @@ +/** + * + * Please note: + * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * Do not edit this file manually. + * + */ + +@file:Suppress( + "ArrayInDataClass", + "EnumEntryName", + "RemoveRedundantQualifierName", + "UnusedImport" +) + +package org.openapitools.client.models + + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +/** + * + * + * @param bepa + * @param cepa + * @param depa + * @param epa + * @param fepa + * @param gepa + */ +@Serializable + +data class Apa ( + + @SerialName(value = "bepa") @Required val bepa: kotlin.Double = (0).toDouble(), + + @SerialName(value = "cepa") @Required val cepa: kotlin.Double = (6.28318).toDouble(), + + @SerialName(value = "depa") val depa: kotlin.Double? = (71).toDouble(), + + @SerialName(value = "epa") val epa: kotlin.Double? = (-71).toDouble(), + + @Deprecated(message = "This property is deprecated.") + @SerialName(value = "fepa") val fepa: kotlin.Double? = (100).toDouble(), + + @SerialName(value = "gepa") val gepa: kotlin.Double? = null + +) + diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/FILES b/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/FILES index 921e2bcf09d..a0ca34edb5c 100644 --- a/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-default-values-jvm-volley/.openapi-generator/FILES @@ -9,16 +9,16 @@ gradlew gradlew.bat settings.gradle src/main/AndroidManifest.xml -src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt -src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt -src/main/kotlin/org/openapitools/client/infrastructure/ITransformForStorage.kt -src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt -src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt -src/main/kotlin/org/openapitools/client/models/Apa.kt -src/main/kotlin/org/openapitools/client/models/room/ApaRoomModel.kt -src/main/kotlin/org/openapitools/client/request/GsonRequest.kt -src/main/kotlin/org/openapitools/client/request/IRequestFactory.kt -src/main/kotlin/org/openapitools/client/request/RequestFactory.kt +src/main/java/org/openapitools/client/apis/DefaultApi.kt +src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt +src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt +src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +src/main/java/org/openapitools/client/models/Apa.kt +src/main/java/org/openapitools/client/models/room/ApaRoomModel.kt +src/main/java/org/openapitools/client/request/GsonRequest.kt +src/main/java/org/openapitools/client/request/IRequestFactory.kt +src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/apis/DefaultApi.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ByteArrayAdapter.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/CollectionFormats.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/CollectionFormats.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/ITransformForStorage.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/ITransformForStorage.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/ITransformForStorage.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateAdapter.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/Apa.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/Apa.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/room/ApaRoomModel.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/room/ApaRoomModel.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/models/room/ApaRoomModel.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/models/room/ApaRoomModel.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/request/GsonRequest.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/request/GsonRequest.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/GsonRequest.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/request/IRequestFactory.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/request/IRequestFactory.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/IRequestFactory.kt diff --git a/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/request/RequestFactory.kt b/samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-jvm-volley/src/main/kotlin/org/openapitools/client/request/RequestFactory.kt rename to samples/client/petstore/kotlin-default-values-jvm-volley/src/main/java/org/openapitools/client/request/RequestFactory.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/.openapi-generator/FILES b/samples/client/petstore/kotlin-default-values-multiplatform/.openapi-generator/FILES index 109097a52c7..b3293eef4ed 100644 --- a/samples/client/petstore/kotlin-default-values-multiplatform/.openapi-generator/FILES +++ b/samples/client/petstore/kotlin-default-values-multiplatform/.openapi-generator/FILES @@ -7,23 +7,23 @@ gradle/wrapper/gradle-wrapper.properties gradlew gradlew.bat settings.gradle.kts +src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt +src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt +src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +src/commonMain/kotlin/org/openapitools/client/models/Apa.kt src/commonTest/kotlin/util/Coroutine.kt src/iosTest/kotlin/util/Coroutine.kt src/jsTest/kotlin/util/Coroutine.kt src/jvmTest/kotlin/util/Coroutine.kt -src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt -src/main/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt -src/main/kotlin/org/openapitools/client/auth/Authentication.kt -src/main/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt -src/main/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt -src/main/kotlin/org/openapitools/client/auth/OAuth.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt -src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt -src/main/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt -src/main/kotlin/org/openapitools/client/infrastructure/Bytes.kt -src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt -src/main/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt -src/main/kotlin/org/openapitools/client/infrastructure/PartConfig.kt -src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt -src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt -src/main/kotlin/org/openapitools/client/models/Apa.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/apis/DefaultApi.kt rename to samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/apis/DefaultApi.kt diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt new file mode 100644 index 00000000000..8bd8b59a8f8 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/ApiKeyAuth.kt @@ -0,0 +1,16 @@ +package org.openapitools.client.auth + +class ApiKeyAuth(private val location: String, val paramName: String) : Authentication { + var apiKey: String? = null + var apiKeyPrefix: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val key: String = apiKey ?: return + val prefix: String? = apiKeyPrefix + val value: String = if (prefix != null) "$prefix $key" else key + when (location) { + "query" -> query[paramName] = listOf(value) + "header" -> headers[paramName] = value + } + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt new file mode 100644 index 00000000000..2c5dfb4acc5 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/Authentication.kt @@ -0,0 +1,13 @@ +package org.openapitools.client.auth + +interface Authentication { + + /** + * Apply authentication settings to header and query params. + * + * @param query Query parameters. + * @param headers Header parameters. + */ + fun apply(query: MutableMap>, headers: MutableMap) + +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt new file mode 100644 index 00000000000..40276dbb985 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBasicAuth.kt @@ -0,0 +1,17 @@ +package org.openapitools.client.auth + +import io.ktor.util.InternalAPI +import io.ktor.util.encodeBase64 + +class HttpBasicAuth : Authentication { + var username: String? = null + var password: String? = null + + @OptIn(InternalAPI::class) + override fun apply(query: MutableMap>, headers: MutableMap) { + if (username == null && password == null) return + val str = (username ?: "") + ":" + (password ?: "") + val auth = str.encodeBase64() + headers["Authorization"] = "Basic $auth" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt new file mode 100644 index 00000000000..a6fb285af5c --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/HttpBearerAuth.kt @@ -0,0 +1,14 @@ +package org.openapitools.client.auth + +class HttpBearerAuth(private val scheme: String?) : Authentication { + var bearerToken: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val token: String = bearerToken ?: return + headers["Authorization"] = (if (scheme != null) upperCaseBearer(scheme)!! + " " else "") + token + } + + private fun upperCaseBearer(scheme: String): String? { + return if ("bearer".equals(scheme, ignoreCase = true)) "Bearer" else scheme + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt new file mode 100644 index 00000000000..0e8f30f3938 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/auth/OAuth.kt @@ -0,0 +1,10 @@ +package org.openapitools.client.auth + +class OAuth : Authentication { + var accessToken: String? = null + + override fun apply(query: MutableMap>, headers: MutableMap) { + val token: String = accessToken ?: return + headers["Authorization"] = "Bearer $token" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt new file mode 100644 index 00000000000..a4a4491eac0 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt @@ -0,0 +1,23 @@ +package org.openapitools.client.infrastructure + +typealias MultiValueMap = MutableMap> + +fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { + "csv" -> "," + "tsv" -> "\t" + "pipe" -> "|" + "space" -> " " + else -> "" +} + +val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } + +fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) + = toMultiValue(items.asIterable(), collectionFormat, map) + +fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { + return when(collectionFormat) { + "multi" -> items.map(map) + else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt new file mode 100644 index 00000000000..789d093c0c7 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/ApiClient.kt @@ -0,0 +1,172 @@ +package org.openapitools.client.infrastructure + +import io.ktor.client.HttpClient +import io.ktor.client.HttpClientConfig +import io.ktor.client.engine.HttpClientEngine +import io.ktor.client.plugins.contentnegotiation.ContentNegotiation +import io.ktor.client.request.* +import io.ktor.client.request.forms.FormDataContent +import io.ktor.client.request.forms.MultiPartFormDataContent +import io.ktor.client.request.header +import io.ktor.client.request.parameter +import io.ktor.client.statement.HttpResponse +import io.ktor.serialization.kotlinx.json.json +import io.ktor.http.* +import io.ktor.http.content.PartData +import kotlin.Unit +import kotlinx.serialization.json.Json + +import org.openapitools.client.auth.* + +open class ApiClient( + private val baseUrl: String, + httpClientEngine: HttpClientEngine?, + httpClientConfig: ((HttpClientConfig<*>) -> Unit)? = null, + private val jsonBlock: Json +) { + + private val clientConfig: (HttpClientConfig<*>) -> Unit by lazy { + { + it.install(ContentNegotiation) { json(jsonBlock) } + httpClientConfig?.invoke(it) + } + } + + private val client: HttpClient by lazy { + httpClientEngine?.let { HttpClient(it, clientConfig) } ?: HttpClient(clientConfig) + } + + private val authentications: kotlin.collections.Map? = null + + companion object { + const val BASE_URL = "http://localhost" + val JSON_DEFAULT = Json { + ignoreUnknownKeys = true + prettyPrint = true + isLenient = true + } + protected val UNSAFE_HEADERS = listOf(HttpHeaders.ContentType) + } + + /** + * Set the username for the first HTTP basic authentication. + * + * @param username Username + */ + fun setUsername(username: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + ?: throw Exception("No HTTP basic authentication configured") + auth.username = username + } + + /** + * Set the password for the first HTTP basic authentication. + * + * @param password Password + */ + fun setPassword(password: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBasicAuth } as HttpBasicAuth? + ?: throw Exception("No HTTP basic authentication configured") + auth.password = password + } + + /** + * Set the API key value for the first API key authentication. + * + * @param apiKey API key + * @param paramName The name of the API key parameter, or null or set the first key. + */ + fun setApiKey(apiKey: String, paramName: String? = null) { + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName)} as ApiKeyAuth? + ?: throw Exception("No API key authentication configured") + auth.apiKey = apiKey + } + + /** + * Set the API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @param paramName The name of the API key parameter, or null or set the first key. + */ + fun setApiKeyPrefix(apiKeyPrefix: String, paramName: String? = null) { + val auth = authentications?.values?.firstOrNull { it is ApiKeyAuth && (paramName == null || paramName == it.paramName) } as ApiKeyAuth? + ?: throw Exception("No API key authentication configured") + auth.apiKeyPrefix = apiKeyPrefix + } + + /** + * Set the access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + fun setAccessToken(accessToken: String) { + val auth = authentications?.values?.firstOrNull { it is OAuth } as OAuth? + ?: throw Exception("No OAuth2 authentication configured") + auth.accessToken = accessToken + } + + /** + * Set the access token for the first Bearer authentication. + * + * @param bearerToken The bearer token. + */ + fun setBearerToken(bearerToken: String) { + val auth = authentications?.values?.firstOrNull { it is HttpBearerAuth } as HttpBearerAuth? + ?: throw Exception("No Bearer authentication configured") + auth.bearerToken = bearerToken + } + + protected suspend fun multipartFormRequest(requestConfig: RequestConfig, body: kotlin.collections.List?, authNames: kotlin.collections.List): HttpResponse { + return request(requestConfig, MultiPartFormDataContent(body ?: listOf()), authNames) + } + + protected suspend fun urlEncodedFormRequest(requestConfig: RequestConfig, body: Parameters?, authNames: kotlin.collections.List): HttpResponse { + return request(requestConfig, FormDataContent(body ?: Parameters.Empty), authNames) + } + + protected suspend fun jsonRequest(requestConfig: RequestConfig, body: Any? = null, authNames: kotlin.collections.List): HttpResponse = request(requestConfig, body, authNames) + + protected suspend fun request(requestConfig: RequestConfig, body: Any? = null, authNames: kotlin.collections.List): HttpResponse { + requestConfig.updateForAuth(authNames) + val headers = requestConfig.headers + + return client.request { + this.url { + this.takeFrom(URLBuilder(baseUrl)) + appendPath(requestConfig.path.trimStart('/').split('/')) + requestConfig.query.forEach { query -> + query.value.forEach { value -> + parameter(query.key, value) + } + } + } + this.method = requestConfig.method.httpMethod + headers.filter { header -> !UNSAFE_HEADERS.contains(header.key) }.forEach { header -> this.header(header.key, header.value) } + if (requestConfig.method in listOf(RequestMethod.PUT, RequestMethod.POST, RequestMethod.PATCH)) { + this.setBody(body) + } + } + } + + private fun RequestConfig.updateForAuth(authNames: kotlin.collections.List) { + for (authName in authNames) { + val auth = authentications?.get(authName) ?: throw Exception("Authentication undefined: $authName") + auth.apply(query, headers) + } + } + + private fun URLBuilder.appendPath(components: kotlin.collections.List): URLBuilder = apply { + encodedPath = encodedPath.trimEnd('/') + components.joinToString("/", prefix = "/") { it.encodeURLQueryComponent() } + } + + private val RequestMethod.httpMethod: HttpMethod + get() = when (this) { + RequestMethod.DELETE -> HttpMethod.Delete + RequestMethod.GET -> HttpMethod.Get + RequestMethod.HEAD -> HttpMethod.Head + RequestMethod.PATCH -> HttpMethod.Patch + RequestMethod.PUT -> HttpMethod.Put + RequestMethod.POST -> HttpMethod.Post + RequestMethod.OPTIONS -> HttpMethod.Options + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt new file mode 100644 index 00000000000..5aeea089489 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Base64ByteArray.kt @@ -0,0 +1,30 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +class Base64ByteArray(val value: ByteArray) { + @Serializer(Base64ByteArray::class) + companion object : KSerializer { + override val descriptor = PrimitiveSerialDescriptor("Base64ByteArray", PrimitiveKind.STRING) + override fun serialize(encoder: Encoder, obj: Base64ByteArray) = encoder.encodeString(obj.value.encodeBase64()) + override fun deserialize(decoder: Decoder) = Base64ByteArray(decoder.decodeString().decodeBase64Bytes()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false + other as Base64ByteArray + return value.contentEquals(other.value) + } + + override fun hashCode(): Int { + return value.contentHashCode() + } + + override fun toString(): String { + return "Base64ByteArray(${hex(value)})" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt new file mode 100644 index 00000000000..0ff85787389 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/Bytes.kt @@ -0,0 +1,100 @@ +package org.openapitools.client.infrastructure + +import io.ktor.utils.io.core.* +import kotlin.experimental.and + +private val digits = "0123456789abcdef".toCharArray() +private const val BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" +private const val BASE64_MASK: Byte = 0x3f +private const val BASE64_PAD = '=' +private val BASE64_INVERSE_ALPHABET = IntArray(256) { BASE64_ALPHABET.indexOf(it.toChar()) } + +private fun String.toCharArray(): CharArray = CharArray(length) { get(it) } +private fun ByteArray.clearFrom(from: Int) = (from until size).forEach { this[it] = 0 } +private fun Int.toBase64(): Char = BASE64_ALPHABET[this] +private fun Byte.fromBase64(): Byte = BASE64_INVERSE_ALPHABET[toInt() and 0xff].toByte() and BASE64_MASK +internal fun ByteArray.encodeBase64(): String = buildPacket { writeFully(this@encodeBase64) }.encodeBase64() +internal fun String.decodeBase64Bytes(): ByteArray = buildPacket { dropLastWhile { it == BASE64_PAD } }.decodeBase64Bytes().readBytes() + +/** + * Encode [bytes] as a HEX string with no spaces, newlines and `0x` prefixes. + * + * Taken from https://github.com/ktorio/ktor/blob/master/ktor-utils/common/src/io/ktor/util/Crypto.kt + */ +internal fun hex(bytes: ByteArray): String { + val result = CharArray(bytes.size * 2) + var resultIndex = 0 + val digits = digits + + for (element in bytes) { + val b = element.toInt() and 0xff + result[resultIndex++] = digits[b shr 4] + result[resultIndex++] = digits[b and 0x0f] + } + + return result.concatToString() +} + +/** + * Decode bytes from HEX string. It should be no spaces and `0x` prefixes. + * + * Taken from https://github.com/ktorio/ktor/blob/master/ktor-utils/common/src/io/ktor/util/Crypto.kt + */ +internal fun hex(s: String): ByteArray { + val result = ByteArray(s.length / 2) + for (idx in result.indices) { + val srcIdx = idx * 2 + val high = s[srcIdx].toString().toInt(16) shl 4 + val low = s[srcIdx + 1].toString().toInt(16) + result[idx] = (high or low).toByte() + } + + return result +} + +/** + * Encode [ByteReadPacket] in base64 format. + * + * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt + */ +private fun ByteReadPacket.encodeBase64(): String = buildString { + val data = ByteArray(3) + while (remaining > 0) { + val read = readAvailable(data) + data.clearFrom(read) + + val padSize = (data.size - read) * 8 / 6 + val chunk = ((data[0].toInt() and 0xFF) shl 16) or + ((data[1].toInt() and 0xFF) shl 8) or + (data[2].toInt() and 0xFF) + + for (index in data.size downTo padSize) { + val char = (chunk shr (6 * index)) and BASE64_MASK.toInt() + append(char.toBase64()) + } + + repeat(padSize) { append(BASE64_PAD) } + } +} + +/** + * Decode [ByteReadPacket] from base64 format + * + * Taken from https://github.com/ktorio/ktor/blob/424d1d2cfaa3281302c60af9500f738c8c2fc846/ktor-utils/common/src/io/ktor/util/Base64.kt + */ +private fun ByteReadPacket.decodeBase64Bytes(): Input = buildPacket { + val data = ByteArray(4) + + while (remaining > 0) { + val read = readAvailable(data) + + val chunk = data.foldIndexed(0) { index, result, current -> + result or (current.fromBase64().toInt() shl ((3 - index) * 6)) + } + + for (index in data.size - 2 downTo (data.size - read)) { + val origin = (chunk shr (8 * index)) and 0xff + writeByte(origin.toByte()) + } + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt new file mode 100644 index 00000000000..4285d605ea6 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt @@ -0,0 +1,51 @@ +package org.openapitools.client.infrastructure + +import io.ktor.http.Headers +import io.ktor.http.isSuccess +import io.ktor.util.reflect.TypeInfo +import io.ktor.util.reflect.typeInfo + +open class HttpResponse(val response: io.ktor.client.statement.HttpResponse, val provider: BodyProvider) { + val status: Int = response.status.value + val success: Boolean = response.status.isSuccess() + val headers: Map> = response.headers.mapEntries() + suspend fun body(): T = provider.body(response) + suspend fun typedBody(type: TypeInfo): V = provider.typedBody(response, type) + + companion object { + private fun Headers.mapEntries(): Map> { + val result = mutableMapOf>() + entries().forEach { result[it.key] = it.value } + return result + } + } +} + +interface BodyProvider { + suspend fun body(response: io.ktor.client.statement.HttpResponse): T + suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V +} + +class TypedBodyProvider(private val type: TypeInfo) : BodyProvider { + @Suppress("UNCHECKED_CAST") + override suspend fun body(response: io.ktor.client.statement.HttpResponse): T = + response.call.body(type) as T + + @Suppress("UNCHECKED_CAST") + override suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V = + response.call.body(type) as V +} + +class MappedBodyProvider(private val provider: BodyProvider, private val block: S.() -> T) : BodyProvider { + override suspend fun body(response: io.ktor.client.statement.HttpResponse): T = + block(provider.body(response)) + + override suspend fun typedBody(response: io.ktor.client.statement.HttpResponse, type: TypeInfo): V = + provider.typedBody(response, type) +} + +inline fun io.ktor.client.statement.HttpResponse.wrap(): HttpResponse = + HttpResponse(this, TypedBodyProvider(typeInfo())) + +fun HttpResponse.map(block: T.() -> V): HttpResponse = + HttpResponse(response, MappedBodyProvider(provider, block)) diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt new file mode 100644 index 00000000000..d10d7c50652 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/OctetByteArray.kt @@ -0,0 +1,30 @@ +package org.openapitools.client.infrastructure + +import kotlinx.serialization.* +import kotlinx.serialization.descriptors.* +import kotlinx.serialization.encoding.* + +@Serializable +class OctetByteArray(val value: ByteArray) { + @Serializer(OctetByteArray::class) + companion object : KSerializer { + override val descriptor = PrimitiveSerialDescriptor("OctetByteArray", PrimitiveKind.STRING) + override fun serialize(encoder: Encoder, obj: OctetByteArray) = encoder.encodeString(hex(obj.value)) + override fun deserialize(decoder: Decoder) = OctetByteArray(hex(decoder.decodeString())) + } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false + other as OctetByteArray + return value.contentEquals(other.value) + } + + override fun hashCode(): Int { + return value.contentHashCode() + } + + override fun toString(): String { + return "OctetByteArray(${hex(value)})" + } +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt new file mode 100644 index 00000000000..be00e38fbae --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/PartConfig.kt @@ -0,0 +1,11 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given part of a multi-part request. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class PartConfig( + val headers: MutableMap = mutableMapOf(), + val body: T? = null +) diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt new file mode 100644 index 00000000000..c3518a2d173 --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt @@ -0,0 +1,18 @@ +package org.openapitools.client.infrastructure + +/** + * Defines a config object for a given request. + * NOTE: This object doesn't include 'body' because it + * allows for caching of the constructed object + * for many request definitions. + * NOTE: Headers is a Map because rfc2616 defines + * multi-valued headers as csv-only. + */ +data class RequestConfig( + val method: RequestMethod, + val path: String, + val headers: MutableMap = mutableMapOf(), + val query: MutableMap> = mutableMapOf(), + val requiresAuthentication: Boolean, + val body: T? = null +) diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt new file mode 100644 index 00000000000..beb56f07cdd --- /dev/null +++ b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt @@ -0,0 +1,8 @@ +package org.openapitools.client.infrastructure + +/** + * Provides enumerated HTTP verbs + */ +enum class RequestMethod { + GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT +} diff --git a/samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt b/samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt similarity index 100% rename from samples/client/petstore/kotlin-default-values-multiplatform/src/main/kotlin/org/openapitools/client/models/Apa.kt rename to samples/client/petstore/kotlin-default-values-multiplatform/src/commonMain/kotlin/org/openapitools/client/models/Apa.kt diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/.openapi-generator/FILES index fb0e5751e4a..038f8f76549 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/.openapi-generator/FILES @@ -56,5 +56,5 @@ src/gen/java/org/openapitools/model/User.java src/gen/java/org/openapitools/model/XmlItem.java src/main/docker/Dockerfile.jvm src/main/docker/Dockerfile.native -src/main/openapi/openapi.yaml +src/main/resources/META-INF/openapi.yaml src/main/resources/application.properties diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/pom.xml b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/pom.xml index 2b84d8826d5..ab81a897fa4 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/pom.xml +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/pom.xml @@ -22,7 +22,6 @@ 2.22.1 2.1.1 1.3.2 - 1.6.10 @@ -65,12 +64,6 @@ javax.annotation-api ${javax.annotation-api-version} - - io.swagger - swagger-annotations - ${io.swagger.annotations.version} - provided - diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java index b06f4a03534..db6516e3f3b 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -6,7 +6,6 @@ import javax.ws.rs.*; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; import java.io.InputStream; @@ -55,7 +54,6 @@ import javax.validation.Valid; scheme = "basic" ) }) -@Api(description = "the another-fake API") @Path("/another-fake/dummy") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class AnotherFakeApi { @@ -63,10 +61,6 @@ public class AnotherFakeApi { @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @ApiOperation(value = "To test special tags", notes = "To test special tags and operation ID starting with number", response = Client.class, tags={ "$another-fake?" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "call123testSpecialTags", summary = "To test special tags", description = "To test special tags and operation ID starting with number") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="$another-fake?") diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java index 61401ef4311..ff33d5f5797 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeApi.java @@ -16,7 +16,6 @@ import javax.ws.rs.*; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; import java.io.InputStream; @@ -65,7 +64,6 @@ import javax.validation.Valid; scheme = "basic" ) }) -@Api(description = "the fake API") @Path("/fake") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class FakeApi { @@ -73,10 +71,6 @@ public class FakeApi { @POST @Path("/create_xml_item") @Consumes({ "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" }) - @ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", response = Void.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createXmlItem", summary = "creates an XmlItem", description = "this route creates an XmlItem") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -92,10 +86,6 @@ public class FakeApi { @POST @Path("/outer/boolean") @Produces({ "*/*" }) - @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output boolean", response = Boolean.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterBooleanSerialize", summary = "", description = "Test serialization of outer boolean types") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -111,10 +101,6 @@ public class FakeApi { @POST @Path("/outer/composite") @Produces({ "*/*" }) - @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterCompositeSerialize", summary = "", description = "Test serialization of object with outer number type") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -130,10 +116,6 @@ public class FakeApi { @POST @Path("/outer/number") @Produces({ "*/*" }) - @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output number", response = BigDecimal.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterNumberSerialize", summary = "", description = "Test serialization of outer number types") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -149,10 +131,6 @@ public class FakeApi { @POST @Path("/outer/string") @Produces({ "*/*" }) - @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Output string", response = String.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "fakeOuterStringSerialize", summary = "", description = "Test serialization of outer string types") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -168,10 +146,6 @@ public class FakeApi { @PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) - @ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testBodyWithFileSchema", summary = "", description = "For this test, the body for this request much reference a schema named `File`.") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -187,10 +161,6 @@ public class FakeApi { @PUT @Path("/body-with-query-params") @Consumes({ "application/json" }) - @ApiOperation(value = "", notes = "", response = Void.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testBodyWithQueryParams", summary = "", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -206,10 +176,6 @@ public class FakeApi { @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @ApiOperation(value = "To test \"client\" model", notes = "To test \"client\" model", response = Client.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testClientModel", summary = "To test \"client\" model", description = "To test \"client\" model") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -224,14 +190,6 @@ public class FakeApi { @POST @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", response = Void.class, authorizations = { - - @Authorization(value = "http_basic_test") - }, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "http_basic_test") }) @@ -251,14 +209,6 @@ public class FakeApi { @GET @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "To test enum parameters", notes = "To test enum parameters", response = Void.class, tags={ "fake" }) - @io.swagger.annotations.ApiImplicitParams({ - @io.swagger.annotations.ApiImplicitParam(name = "enum_header_string", value = "Header parameter enum test (string)", dataType = "String", paramType = "header") - }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid request", response = Void.class), - @ApiResponse(code = 404, message = "Not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testEnumParameters", summary = "To test enum parameters", description = "To test enum parameters") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -270,15 +220,11 @@ public class FakeApi { }) }) - public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { + public Response testEnumParameters(@HeaderParam("enum_header_string_array") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { return Response.ok().entity("magic!").build(); } @DELETE - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Something wrong", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testGroupParameters", summary = "Fake endpoint to test group parameters (optional)", description = "Fake endpoint to test group parameters (optional)") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -287,17 +233,13 @@ public class FakeApi { }) }) - public Response testGroupParameters(@QueryParam("required_string_group") @NotNull @ApiParam("Required String in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @ApiParam("Required Boolean in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @ApiParam("Required Integer in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @ApiParam("String in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @ApiParam("Boolean in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @ApiParam("Integer in group parameters") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Integer in group parameters") Long int64Group) { + public Response testGroupParameters(@QueryParam("required_string_group") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required String in group parameters") Integer requiredStringGroup,@HeaderParam("required_boolean_group") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Boolean in group parameters") Boolean requiredBooleanGroup,@QueryParam("required_int64_group") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Required Integer in group parameters") Long requiredInt64Group,@QueryParam("string_group") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="String in group parameters") Integer stringGroup,@HeaderParam("boolean_group") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Boolean in group parameters") Boolean booleanGroup,@QueryParam("int64_group") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Integer in group parameters") Long int64Group) { return Response.ok().entity("magic!").build(); } @POST @Path("/inline-additionalProperties") @Consumes({ "application/json" }) - @ApiOperation(value = "test inline additionalProperties", notes = "", response = Void.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -313,10 +255,6 @@ public class FakeApi { @GET @Path("/jsonFormData") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "test json serialization of form data", notes = "", response = Void.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testJsonFormData", summary = "test json serialization of form data", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -331,10 +269,6 @@ public class FakeApi { @PUT @Path("/test-query-parameters") - @ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Success", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "testQueryParameterCollectionFormat", summary = "", description = "To test the collection format in query parameters") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="fake") @@ -351,14 +285,6 @@ public class FakeApi { @Path("/{petId}/uploadImageWithRequiredFile") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image (required)", 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") }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -369,7 +295,7 @@ public class FakeApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = ModelApiResponse.class)) }) }) - public Response uploadFileWithRequiredFile(@PathParam("petId") @ApiParam("ID of pet to update") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) { + public Response uploadFileWithRequiredFile(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId, @FormParam(value = "requiredFile") InputStream requiredFileInputStream,@FormParam(value = "additionalMetadata") String additionalMetadata) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index 136bc89ca55..81eb04cee87 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -6,7 +6,6 @@ import javax.ws.rs.*; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; import java.io.InputStream; @@ -55,7 +54,6 @@ import javax.validation.Valid; scheme = "basic" ) }) -@Api(description = "the fake_classname_test API") @Path("/fake_classname_test") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class FakeClassnameTestApi { @@ -63,13 +61,6 @@ public class FakeClassnameTestApi { @PATCH @Consumes({ "application/json" }) @Produces({ "application/json" }) - @ApiOperation(value = "To test class name in snake case", notes = "To test class name in snake case", response = Client.class, authorizations = { - - @Authorization(value = "api_key_query") - }, tags={ "fake_classname_tags 123#$%^" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Client.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key_query") }) diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java index 7d6744130a1..eb3a367e22c 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/PetApi.java @@ -9,7 +9,6 @@ import javax.ws.rs.*; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; import java.io.InputStream; @@ -58,22 +57,12 @@ import javax.validation.Valid; scheme = "basic" ) }) -@Api(description = "the pet API") @Path("/pet") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class PetApi { @POST @Consumes({ "application/json", "application/xml" }) - @ApiOperation(value = "Add a new pet to the store", notes = "", response = Void.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") }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), - @ApiResponse(code = 405, message = "Invalid input", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -93,18 +82,6 @@ public class PetApi { @DELETE @Path("/{petId}") - @ApiOperation(value = "Deletes a pet", notes = "", response = Void.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") }) - }, tags={ "pet" }) - @io.swagger.annotations.ApiImplicitParams({ - @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") - }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), - @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -118,22 +95,13 @@ public class PetApi { }) }) - public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Pet id to delete") Long petId) { + public Response deletePet(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Pet id to delete") Long petId) { return Response.ok().entity("magic!").build(); } @GET @Path("/findByStatus") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by status", notes = "Multiple status values can be provided with comma separated strings", response = Pet.class, responseContainer = "List", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -149,22 +117,13 @@ public class PetApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") }) }) - public Response findPetsByStatus(@QueryParam("status") @NotNull @ApiParam("Status values that need to be considered for filter") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Status values that need to be considered for filter") List status) { + public Response findPetsByStatus(@QueryParam("status") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Status values that need to be considered for filter") List status) { return Response.ok().entity("magic!").build(); } @GET @Path("/findByTags") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Finds Pets by tags", notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", response = Pet.class, responseContainer = "Set", authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "Set"), - @ApiResponse(code = 400, message = "Invalid tag value", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -180,22 +139,13 @@ public class PetApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") }) }) - public Response findPetsByTags(@QueryParam("tags") @NotNull @ApiParam("Tags to filter by") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Tags to filter by") Set tags) { + public Response findPetsByTags(@QueryParam("tags") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="Tags to filter by") Set tags) { return Response.ok().entity("magic!").build(); } @GET @Path("/{petId}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find pet by ID", notes = "Returns a single pet", response = Pet.class, authorizations = { - - @Authorization(value = "api_key") - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @ApiResponse(code = 404, message = "Pet not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key") }) @@ -215,23 +165,12 @@ public class PetApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") }) }) - public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to return") Long petId) { + public Response getPetById(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to return") Long petId) { return Response.ok().entity("magic!").build(); } @PUT @Consumes({ "application/json", "application/xml" }) - @ApiOperation(value = "Update an existing pet", notes = "", response = Void.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") }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @ApiResponse(code = 404, message = "Pet not found", response = Void.class), - @ApiResponse(code = 405, message = "Validation exception", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -258,14 +197,6 @@ public class PetApi { @POST @Path("/{petId}") @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Updates a pet in the store with form data", notes = "", response = Void.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") }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 405, message = "Invalid input", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -276,7 +207,7 @@ public class PetApi { }) }) - public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { + public Response updatePetWithForm(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { return Response.ok().entity("magic!").build(); } @@ -284,14 +215,6 @@ public class PetApi { @Path("/{petId}/uploadImage") @Consumes({ "multipart/form-data" }) @Produces({ "application/json" }) - @ApiOperation(value = "uploads an image", 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") }) - }, tags={ "pet" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "petstore_auth", scopes = { "write:pets", "read:pets" }) }) @@ -302,7 +225,7 @@ public class PetApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json", schema = @org.eclipse.microprofile.openapi.annotations.media.Schema(implementation = ModelApiResponse.class)) }) }) - public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) { + public Response uploadFile(@PathParam("petId") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream _fileInputStream) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java index 73c4630de84..7145db220ec 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/StoreApi.java @@ -7,7 +7,6 @@ import javax.ws.rs.*; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; import java.io.InputStream; @@ -56,18 +55,12 @@ import javax.validation.Valid; scheme = "basic" ) }) -@Api(description = "the store API") @Path("/store") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class StoreApi { @DELETE @Path("/order/{order_id}") - @ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = Void.class, tags={ "store" }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @ApiResponse(code = 404, message = "Order not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deleteOrder", summary = "Delete purchase order by ID", description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store") @@ -79,20 +72,13 @@ public class StoreApi { }) }) - public Response deleteOrder(@PathParam("order_id") @ApiParam("ID of the order that needs to be deleted") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of the order that needs to be deleted") String orderId) { + public Response deleteOrder(@PathParam("order_id") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of the order that needs to be deleted") String orderId) { return Response.ok().entity("magic!").build(); } @GET @Path("/inventory") @Produces({ "application/json" }) - @ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { - - @Authorization(value = "api_key") - }, tags={ "store" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirements(value={ @org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement(name = "api_key") }) @@ -110,12 +96,6 @@ public class StoreApi { @GET @Path("/order/{order_id}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", response = Order.class, tags={ "store" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), - @ApiResponse(code = 404, message = "Order not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getOrderById", summary = "Find purchase order by ID", description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store") @@ -133,18 +113,13 @@ public class StoreApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") }) }) - public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) @ApiParam("ID of pet that needs to be fetched") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be fetched") Long orderId) { + public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="ID of pet that needs to be fetched") Long orderId) { return Response.ok().entity("magic!").build(); } @POST @Path("/order") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "placeOrder", summary = "Place an order for a pet", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="store") diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java index 6c571ba222a..cf63562ad52 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/api/UserApi.java @@ -7,7 +7,6 @@ import javax.ws.rs.*; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; import java.io.InputStream; @@ -56,16 +55,11 @@ import javax.validation.Valid; scheme = "basic" ) }) -@Api(description = "the user API") @Path("/user") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") public class UserApi { @POST - @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUser", summary = "Create user", description = "This can only be done by the logged in user.") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -80,10 +74,6 @@ public class UserApi { @POST @Path("/createWithArray") - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -98,10 +88,6 @@ public class UserApi { @POST @Path("/createWithList") - @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -116,11 +102,6 @@ public class UserApi { @DELETE @Path("/{username}") - @ApiOperation(value = "Delete user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "deleteUser", summary = "Delete user", description = "This can only be done by the logged in user.") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -132,19 +113,13 @@ public class UserApi { }) }) - public Response deleteUser(@PathParam("username") @ApiParam("The name that needs to be deleted") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be deleted") String username) { + public Response deleteUser(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be deleted") String username) { return Response.ok().entity("magic!").build(); } @GET @Path("/{username}") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Get user by user name", notes = "", response = User.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "getUserByName", summary = "Get user by user name", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -162,18 +137,13 @@ public class UserApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") }) }) - public Response getUserByName(@PathParam("username") @ApiParam("The name that needs to be fetched. Use user1 for testing.") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be fetched. Use user1 for testing.") String username) { + public Response getUserByName(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The name that needs to be fetched. Use user1 for testing.") String username) { return Response.ok().entity("magic!").build(); } @GET @Path("/login") @Produces({ "application/xml", "application/json" }) - @ApiOperation(value = "Logs user into the system", notes = "", response = String.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "loginUser", summary = "Logs user into the system", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -190,16 +160,12 @@ public class UserApi { @org.eclipse.microprofile.openapi.annotations.media.Content(mediaType="application/json") }) }) - public Response loginUser(@QueryParam("username") @NotNull @ApiParam("The user name for login") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The user name for login") String username,@QueryParam("password") @NotNull @ApiParam("The password for login in clear text") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The password for login in clear text") String password) { + public Response loginUser(@QueryParam("username") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The user name for login") String username,@QueryParam("password") @NotNull @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="The password for login in clear text") String password) { return Response.ok().entity("magic!").build(); } @GET @Path("/logout") - @ApiOperation(value = "Logs out current logged in user session", notes = "", response = Void.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "logoutUser", summary = "Logs out current logged in user session", description = "") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -214,11 +180,6 @@ public class UserApi { @PUT @Path("/{username}") - @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) - @ApiResponses(value = { - @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), - @ApiResponse(code = 404, message = "User not found", response = Void.class) - }) @org.eclipse.microprofile.openapi.annotations.Operation(operationId = "updateUser", summary = "Updated user", description = "This can only be done by the logged in user.") @org.eclipse.microprofile.openapi.annotations.tags.Tag(name="user") @@ -230,7 +191,7 @@ public class UserApi { }) }) - public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="name that need to be deleted") String username,@Valid @NotNull User body) { + public Response updateUser(@PathParam("username") @org.eclipse.microprofile.openapi.annotations.parameters.Parameter(description="name that need to be deleted") String username,@Valid @NotNull User body) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java index 5e6dcbc18a0..f523f2dfc3a 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -31,7 +28,6 @@ public class AdditionalPropertiesAnyType extends HashMap impleme } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java index e83b83c7c06..75a3feaa86c 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -32,7 +29,6 @@ public class AdditionalPropertiesArray extends HashMap implements } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java index 335b344a9d1..844ee598e7c 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -31,7 +28,6 @@ public class AdditionalPropertiesBoolean extends HashMap implem } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 7470375ebd3..487447f725c 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.List; @@ -10,7 +8,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -60,7 +57,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_string") public Map getMapString() { @@ -96,7 +92,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_number") public Map getMapNumber() { @@ -132,7 +127,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_integer") public Map getMapInteger() { @@ -168,7 +162,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_boolean") public Map getMapBoolean() { @@ -204,7 +197,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_array_integer") public Map> getMapArrayInteger() { @@ -240,7 +232,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_array_anytype") public Map> getMapArrayAnytype() { @@ -276,7 +267,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_map_string") public Map> getMapMapString() { @@ -312,7 +302,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_map_anytype") public Map> getMapMapAnytype() { @@ -348,7 +337,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("anytype_1") public Object getAnytype1() { @@ -368,7 +356,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("anytype_2") public Object getAnytype2() { @@ -388,7 +375,6 @@ public class AdditionalPropertiesClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("anytype_3") public Object getAnytype3() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java index 14c944e3a89..d8f656105a0 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -31,7 +28,6 @@ public class AdditionalPropertiesInteger extends HashMap implem } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java index 0f2a791d658..5d54f8f12c3 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -32,7 +29,6 @@ public class AdditionalPropertiesNumber extends HashMap impl } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java index bce0bd580cb..a545ce84df8 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -31,7 +28,6 @@ public class AdditionalPropertiesObject extends HashMap implements } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java index 49c4103a291..97e95145eda 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -31,7 +28,6 @@ public class AdditionalPropertiesString extends HashMap implemen } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java index 25d8d641ed7..bef18919cb7 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Animal.java @@ -3,13 +3,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -47,7 +44,6 @@ public class Animal implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("className") @NotNull @@ -68,7 +64,6 @@ public class Animal implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("color") public String getColor() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 3ba36e8ad04..de54ff26852 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -39,7 +36,6 @@ public class ArrayOfArrayOfNumberOnly implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("ArrayArrayNumber") public List> getArrayArrayNumber() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java index 03061373b7d..7cd3974f72e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -39,7 +36,6 @@ public class ArrayOfNumberOnly implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("ArrayNumber") public List getArrayNumber() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java index d3bd3d2af08..02b2b582552 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ArrayTest.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.model.ReadOnlyFirst; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -43,7 +40,6 @@ public class ArrayTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("array_of_string") public List getArrayOfString() { @@ -79,7 +75,6 @@ public class ArrayTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("array_array_of_integer") public List> getArrayArrayOfInteger() { @@ -115,7 +110,6 @@ public class ArrayTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("array_array_of_model") public List> getArrayArrayOfModel() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java index 3d9d08170e5..6579d5bf287 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/BigCat.java @@ -1,13 +1,10 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Cat; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -85,7 +82,6 @@ public class BigCat extends Cat implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("kind") public KindEnum getKind() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java index a28d39de52d..b576c29b1b3 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Capitalization.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -46,7 +43,6 @@ public class Capitalization implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("smallCamel") public String getSmallCamel() { @@ -66,7 +62,6 @@ public class Capitalization implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("CapitalCamel") public String getCapitalCamel() { @@ -86,7 +81,6 @@ public class Capitalization implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("small_Snake") public String getSmallSnake() { @@ -106,7 +100,6 @@ public class Capitalization implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("Capital_Snake") public String getCapitalSnake() { @@ -126,7 +119,6 @@ public class Capitalization implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("SCA_ETH_Flow_Points") public String getScAETHFlowPoints() { @@ -147,7 +139,6 @@ public class Capitalization implements Serializable { } - @ApiModelProperty(value = "Name of the pet ") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Name of the pet ") @JsonProperty("ATT_NAME") public String getATTNAME() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java index 261092ceff1..e157f2f26a4 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Cat.java @@ -1,13 +1,10 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -38,7 +35,6 @@ public class Cat extends Animal implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("declawed") public Boolean getDeclawed() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java index 0b651b8c481..6042f69858d 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Category.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -38,7 +35,6 @@ public class Category implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("id") public Long getId() { @@ -58,7 +54,6 @@ public class Category implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("name") @NotNull diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java index c66044c0a52..64ef907cca0 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ClassModel.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -16,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model with \"_class\" property **/ -@ApiModel(description = "Model for testing model with \"_class\" property") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model with \"_class\" property") @JsonTypeName("ClassModel") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") @@ -38,7 +35,6 @@ public class ClassModel implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("_class") public String getPropertyClass() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java index 19978679674..fea01a8c174 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Client.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -36,7 +33,6 @@ public class Client implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("client") public String getClient() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java index ea094ca80fb..ae5bee8c43e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Dog.java @@ -1,13 +1,10 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.Animal; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -38,7 +35,6 @@ public class Dog extends Animal implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("breed") public String getBreed() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java index a68d69b7b2c..4078a504e36 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumArrays.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -134,7 +131,6 @@ public class EnumArrays implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("just_symbol") public JustSymbolEnum getJustSymbol() { @@ -154,7 +150,6 @@ public class EnumArrays implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("array_enum") public List getArrayEnum() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java index cace39eb462..c929ea4d07e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/EnumTest.java @@ -1,14 +1,11 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import org.openapitools.model.OuterEnum; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -234,7 +231,6 @@ public class EnumTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("enum_string") public EnumStringEnum getEnumString() { @@ -254,7 +250,6 @@ public class EnumTest implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("enum_string_required") @NotNull @@ -275,7 +270,6 @@ public class EnumTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("enum_integer") public EnumIntegerEnum getEnumInteger() { @@ -295,7 +289,6 @@ public class EnumTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("enum_number") public EnumNumberEnum getEnumNumber() { @@ -315,7 +308,6 @@ public class EnumTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("outerEnum") public OuterEnum getOuterEnum() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java index 19afafdf601..ce3d333c2d2 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FileSchemaTestClass.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; import org.openapitools.model.ModelFile; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -41,7 +38,6 @@ public class FileSchemaTestClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("file") public ModelFile getFile() { @@ -61,7 +57,6 @@ public class FileSchemaTestClass implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("files") public List getFiles() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java index 41a5aac47d1..4bf137765e8 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/FormatTest.java @@ -1,8 +1,6 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.File; import java.math.BigDecimal; import java.time.LocalDate; @@ -13,7 +11,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -71,7 +68,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("integer") @Min(10) @Max(100) public Integer getInteger() { @@ -93,7 +89,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("int32") @Min(20) @Max(200) public Integer getInt32() { @@ -113,7 +108,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("int64") public Long getInt64() { @@ -135,7 +129,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("number") @NotNull @@ -158,7 +151,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("float") @DecimalMin("54.3") @DecimalMax("987.6") public Float getFloat() { @@ -180,7 +172,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("double") @DecimalMin("67.8") @DecimalMax("123.4") public Double getDouble() { @@ -200,7 +191,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("string") @Pattern(regexp="/[a-z]/i") public String getString() { @@ -220,7 +210,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("byte") @NotNull @@ -241,7 +230,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("binary") public File getBinary() { @@ -261,7 +249,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("date") @NotNull @@ -282,7 +269,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("dateTime") public LocalDateTime getDateTime() { @@ -302,7 +288,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "72f98069-206d-4f12-9f12-3d1e525a8e84", description = "") @JsonProperty("uuid") public UUID getUuid() { @@ -322,7 +307,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("password") @NotNull @@ -343,7 +327,6 @@ public class FormatTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("BigDecimal") public BigDecimal getBigDecimal() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java index 0584fe0ee6f..bf267cb8170 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/HasOnlyReadOnly.java @@ -1,13 +1,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -39,7 +36,6 @@ public class HasOnlyReadOnly implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("bar") public String getBar() { @@ -59,7 +55,6 @@ public class HasOnlyReadOnly implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("foo") public String getFoo() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java index d43c57dc79c..6dcb32d2662 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MapTest.java @@ -1,14 +1,11 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -91,7 +88,6 @@ public class MapTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_map_of_string") public Map> getMapMapOfString() { @@ -127,7 +123,6 @@ public class MapTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map_of_enum_string") public Map getMapOfEnumString() { @@ -163,7 +158,6 @@ public class MapTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("direct_map") public Map getDirectMap() { @@ -199,7 +193,6 @@ public class MapTest implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("indirect_map") public Map getIndirectMap() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 52df830f8fd..bab8ecb9aa9 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.time.LocalDateTime; import java.util.HashMap; import java.util.Map; @@ -11,7 +9,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -45,7 +42,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("uuid") public UUID getUuid() { @@ -65,7 +61,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("dateTime") public LocalDateTime getDateTime() { @@ -85,7 +80,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass implements Serializabl } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("map") public Map getMap() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java index ee5ff5d3e86..c940dad7d45 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Model200Response.java @@ -1,13 +1,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model name starting with number **/ -@ApiModel(description = "Model for testing model name starting with number") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model name starting with number") @JsonTypeName("200_response") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") @@ -41,7 +38,6 @@ public class Model200Response implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public Integer getName() { @@ -61,7 +57,6 @@ public class Model200Response implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("class") public String getPropertyClass() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java index e0cbfb7d662..9ae159bb65e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelApiResponse.java @@ -1,13 +1,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -41,7 +38,6 @@ public class ModelApiResponse implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("code") public Integer getCode() { @@ -61,7 +57,6 @@ public class ModelApiResponse implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("type") public String getType() { @@ -81,7 +76,6 @@ public class ModelApiResponse implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("message") public String getMessage() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java index 3d88d4cef9c..45cb3818c8a 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelFile.java @@ -1,13 +1,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** * Must be named `File` for test. **/ -@ApiModel(description = "Must be named `File` for test.") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description="Must be named `File` for test.") @JsonTypeName("File") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") @@ -40,7 +37,6 @@ public class ModelFile implements Serializable { } - @ApiModelProperty(value = "Test capitalization") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Test capitalization") @JsonProperty("sourceURI") public String getSourceURI() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java index 44b300c0b2a..b9bc20f72c0 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelList.java @@ -1,13 +1,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -37,7 +34,6 @@ public class ModelList implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("123-list") public String get123list() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java index f0129830c50..3323530e072 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ModelReturn.java @@ -1,13 +1,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -17,7 +14,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing reserved words **/ -@ApiModel(description = "Model for testing reserved words") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing reserved words") @JsonTypeName("Return") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") @@ -39,7 +36,6 @@ public class ModelReturn implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("return") public Integer getReturn() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java index 1bc085a16fe..a9d98919760 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Name.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -16,7 +13,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName; /** * Model for testing model name same as property name **/ -@ApiModel(description = "Model for testing model name same as property name") + @org.eclipse.microprofile.openapi.annotations.media.Schema(description="Model for testing model name same as property name") @JsonTypeName("Name") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen") @@ -44,7 +41,6 @@ public class Name implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("name") @NotNull @@ -65,7 +61,6 @@ public class Name implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("snake_case") public Integer getSnakeCase() { @@ -85,7 +80,6 @@ public class Name implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("property") public String getProperty() { @@ -105,7 +99,6 @@ public class Name implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("123Number") public Integer get123number() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java index 2c8d35de677..9ff873b25b7 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/NumberOnly.java @@ -1,13 +1,10 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -37,7 +34,6 @@ public class NumberOnly implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("JustNumber") public BigDecimal getJustNumber() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java index bde0f4e504b..325a1392d1b 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Order.java @@ -1,13 +1,10 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.time.LocalDateTime; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -94,7 +91,6 @@ public class Order implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("id") public Long getId() { @@ -114,7 +110,6 @@ public class Order implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("petId") public Long getPetId() { @@ -134,7 +129,6 @@ public class Order implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("quantity") public Integer getQuantity() { @@ -154,7 +148,6 @@ public class Order implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("shipDate") public LocalDateTime getShipDate() { @@ -175,7 +168,6 @@ public class Order implements Serializable { } - @ApiModelProperty(value = "Order Status") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "Order Status") @JsonProperty("status") public StatusEnum getStatus() { @@ -195,7 +187,6 @@ public class Order implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("complete") public Boolean getComplete() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java index e9e8e43ad76..70e4b8f73e5 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/OuterComposite.java @@ -1,13 +1,10 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -41,7 +38,6 @@ public class OuterComposite implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("my_number") public BigDecimal getMyNumber() { @@ -61,7 +57,6 @@ public class OuterComposite implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("my_string") public String getMyString() { @@ -81,7 +76,6 @@ public class OuterComposite implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("my_boolean") public Boolean getMyBoolean() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java index 814ab97e40f..de2fb0fc406 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Pet.java @@ -1,8 +1,6 @@ package org.openapitools.model; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.LinkedHashSet; import java.util.List; @@ -13,7 +11,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -100,7 +97,6 @@ public class Pet implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("id") public Long getId() { @@ -120,7 +116,6 @@ public class Pet implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("category") public Category getCategory() { @@ -140,7 +135,6 @@ public class Pet implements Serializable { } - @ApiModelProperty(example = "doggie", required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "doggie", required = true, description = "") @JsonProperty("name") @NotNull @@ -161,7 +155,6 @@ public class Pet implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("photoUrls") @NotNull @@ -199,7 +192,6 @@ public class Pet implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("tags") public List getTags() { @@ -236,7 +228,6 @@ public class Pet implements Serializable { } - @ApiModelProperty(value = "pet status in the store") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "pet status in the store") @JsonProperty("status") public StatusEnum getStatus() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java index e544200620c..eed1298e234 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/ReadOnlyFirst.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -38,7 +35,6 @@ public class ReadOnlyFirst implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("bar") public String getBar() { @@ -58,7 +54,6 @@ public class ReadOnlyFirst implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("baz") public String getBaz() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java index 61db35744e0..d4ed4d44510 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -1,13 +1,10 @@ package org.openapitools.model; import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -37,7 +34,6 @@ public class SpecialModelName implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("$special[property.name]") public Long get$SpecialPropertyName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java index e113a876a48..5eef1df4ab9 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/Tag.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -38,7 +35,6 @@ public class Tag implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("id") public Long getId() { @@ -58,7 +54,6 @@ public class Tag implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name") public String getName() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java index 295441b2fdd..c742fb7a90a 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderDefault.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -47,7 +44,6 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("string_item") @NotNull @@ -68,7 +64,6 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("number_item") @NotNull @@ -89,7 +84,6 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("integer_item") @NotNull @@ -110,7 +104,6 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("bool_item") @NotNull @@ -131,7 +124,6 @@ public class TypeHolderDefault implements Serializable { } - @ApiModelProperty(required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(required = true, description = "") @JsonProperty("array_item") @NotNull diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java index a75b956bd67..6d547b839ff 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/TypeHolderExample.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -49,7 +46,6 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "what", required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "what", required = true, description = "") @JsonProperty("string_item") @NotNull @@ -70,7 +66,6 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "1.234", required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", required = true, description = "") @JsonProperty("number_item") @NotNull @@ -91,7 +86,6 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "1.234", required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", required = true, description = "") @JsonProperty("float_item") @NotNull @@ -112,7 +106,6 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "-2", required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", required = true, description = "") @JsonProperty("integer_item") @NotNull @@ -133,7 +126,6 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "true", required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", required = true, description = "") @JsonProperty("bool_item") @NotNull @@ -154,7 +146,6 @@ public class TypeHolderExample implements Serializable { } - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "[0, 1, 2, 3]", required = true, description = "") @JsonProperty("array_item") @NotNull diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java index c8516ebe602..aed3620354e 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/User.java @@ -1,12 +1,9 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -50,7 +47,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("id") public Long getId() { @@ -70,7 +66,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("username") public String getUsername() { @@ -90,7 +85,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("firstName") public String getFirstName() { @@ -110,7 +104,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("lastName") public String getLastName() { @@ -130,7 +123,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("email") public String getEmail() { @@ -150,7 +142,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("password") public String getPassword() { @@ -170,7 +161,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("phone") public String getPhone() { @@ -191,7 +181,6 @@ public class User implements Serializable { } - @ApiModelProperty(value = "User Status") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "User Status") @JsonProperty("userStatus") public Integer getUserStatus() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java index 144d26fc69c..e1bfb8270a0 100644 --- a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/gen/java/org/openapitools/model/XmlItem.java @@ -1,7 +1,5 @@ package org.openapitools.model; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; @@ -9,7 +7,6 @@ import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; -import io.swagger.annotations.*; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; @@ -95,7 +92,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("attribute_string") public String getAttributeString() { @@ -115,7 +111,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("attribute_number") public BigDecimal getAttributeNumber() { @@ -135,7 +130,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("attribute_integer") public Integer getAttributeInteger() { @@ -155,7 +149,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("attribute_boolean") public Boolean getAttributeBoolean() { @@ -175,7 +168,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("wrapped_array") public List getWrappedArray() { @@ -211,7 +203,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("name_string") public String getNameString() { @@ -231,7 +222,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("name_number") public BigDecimal getNameNumber() { @@ -251,7 +241,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("name_integer") public Integer getNameInteger() { @@ -271,7 +260,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("name_boolean") public Boolean getNameBoolean() { @@ -291,7 +279,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name_array") public List getNameArray() { @@ -327,7 +314,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("name_wrapped_array") public List getNameWrappedArray() { @@ -363,7 +349,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("prefix_string") public String getPrefixString() { @@ -383,7 +368,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("prefix_number") public BigDecimal getPrefixNumber() { @@ -403,7 +387,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("prefix_integer") public Integer getPrefixInteger() { @@ -423,7 +406,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("prefix_boolean") public Boolean getPrefixBoolean() { @@ -443,7 +425,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_array") public List getPrefixArray() { @@ -479,7 +460,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_wrapped_array") public List getPrefixWrappedArray() { @@ -515,7 +495,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("namespace_string") public String getNamespaceString() { @@ -535,7 +514,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("namespace_number") public BigDecimal getNamespaceNumber() { @@ -555,7 +533,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("namespace_integer") public Integer getNamespaceInteger() { @@ -575,7 +552,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("namespace_boolean") public Boolean getNamespaceBoolean() { @@ -595,7 +571,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("namespace_array") public List getNamespaceArray() { @@ -631,7 +606,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("namespace_wrapped_array") public List getNamespaceWrappedArray() { @@ -667,7 +641,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "string", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "string", description = "") @JsonProperty("prefix_ns_string") public String getPrefixNsString() { @@ -687,7 +660,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "1.234", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "1.234", description = "") @JsonProperty("prefix_ns_number") public BigDecimal getPrefixNsNumber() { @@ -707,7 +679,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "-2", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "-2", description = "") @JsonProperty("prefix_ns_integer") public Integer getPrefixNsInteger() { @@ -727,7 +698,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(example = "true", value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(example = "true", description = "") @JsonProperty("prefix_ns_boolean") public Boolean getPrefixNsBoolean() { @@ -747,7 +717,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_ns_array") public List getPrefixNsArray() { @@ -783,7 +752,6 @@ public class XmlItem implements Serializable { } - @ApiModelProperty(value = "") @org.eclipse.microprofile.openapi.annotations.media.Schema(description = "") @JsonProperty("prefix_ns_wrapped_array") public List getPrefixNsWrappedArray() { diff --git a/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/main/resources/META-INF/openapi.yaml b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/main/resources/META-INF/openapi.yaml new file mode 100644 index 00000000000..eded577e74f --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-microprofile-openapi-annotations/src/main/resources/META-INF/openapi.yaml @@ -0,0 +1,2276 @@ +openapi: 3.0.1 +info: + description: "This spec is mainly for testing Petstore server and contains fake\ + \ endpoints, models. Please do not use this for any other purpose. Special characters:\ + \ \" \\" + license: + name: Apache-2.0 + url: https://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- url: http://petstore.swagger.io:80/v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /pet: + post: + operationId: addPet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + x-codegen-request-body-name: body + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: pet + put: + operationId: updatePet + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + "405": + content: {} + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + x-codegen-request-body-name: body + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + "400": + content: {} + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/findByTags: + get: + deprecated: true + description: "Multiple tags can be provided with comma separated strings. Use\ + \ tag1, tag2, tag3 for testing." + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + uniqueItems: true + style: form + responses: + "200": + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + uniqueItems: true + description: successful operation + "400": + content: {} + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - in: header + name: api_key + schema: + type: string + - description: Pet id to delete + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: {} + description: successful operation + "400": + content: {} + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + in: path + name: petId + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + x-accepts: application/json + x-tags: + - tag: pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/updatePetWithForm_request' + responses: + "405": + content: {} + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + x-tags: + - tag: pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFile_request' + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + x-content-type: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + "200": + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid Order + summary: Place an order for a pet + tags: + - store + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: application/json + x-tags: + - tag: store + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + in: path + name: order_id + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Delete purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generate exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + "400": + content: {} + description: Invalid ID supplied + "404": + content: {} + description: Order not found + summary: Find purchase order by ID + tags: + - store + x-accepts: application/json + x-tags: + - tag: store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Create user + tags: + - user + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + content: + '*/*': + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + responses: + default: + content: {} + description: successful operation + summary: Creates list of users with given input array + tags: + - user + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + in: query + name: username + required: true + schema: + type: string + - description: The password for login in clear text + in: query + name: password + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + format: int32 + type: integer + X-Expires-After: + description: date in UTC when token expires + schema: + format: date-time + type: string + "400": + content: {} + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/logout: + get: + operationId: logoutUser + responses: + default: + content: {} + description: successful operation + summary: Logs out current logged in user session + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + in: path + name: username + required: true + schema: + type: string + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Delete user + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + in: path + name: username + required: true + schema: + type: string + responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + summary: Get user by user name + tags: + - user + x-accepts: application/json + x-tags: + - tag: user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + in: path + name: username + required: true + schema: + type: string + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + "400": + content: {} + description: Invalid user supplied + "404": + content: {} + description: User not found + summary: Updated user + tags: + - user + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: application/json + x-tags: + - tag: user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + x-codegen-request-body-name: body + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: fake_classname_tags 123#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + in: query + name: required_string_group + required: true + schema: + type: integer + - description: Required Boolean in group parameters + in: header + name: required_boolean_group + required: true + schema: + type: boolean + - description: Required Integer in group parameters + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + - description: String in group parameters + in: query + name: string_group + schema: + type: integer + - description: Boolean in group parameters + in: header + name: boolean_group + schema: + type: boolean + - description: Integer in group parameters + in: query + name: int64_group + schema: + format: int64 + type: integer + responses: + "400": + content: {} + description: Something wrong + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + x-accepts: application/json + x-tags: + - tag: fake + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + in: header + name: enum_header_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (string array) + explode: false + in: query + name: enum_query_string_array + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + in: query + name: enum_query_string + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + - description: Query parameter enum test (double) + in: query + name: enum_query_integer + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + - description: Query parameter enum test (double) + in: query + name: enum_query_double + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEnumParameters_request' + responses: + "400": + content: {} + description: Invalid request + "404": + content: {} + description: Not found + summary: To test enum parameters + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + x-tags: + - tag: fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + x-codegen-request-body-name: body + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: fake + post: + description: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testEndpointParameters_request' + required: true + responses: + "400": + content: {} + description: Invalid username supplied + "404": + content: {} + description: User not found + security: + - http_basic_test: [] + summary: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + x-tags: + - tag: fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + required: false + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + x-codegen-request-body-name: body + x-content-type: '*/*' + x-accepts: '*/*' + x-tags: + - tag: fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/testJsonFormData_request' + required: true + responses: + "200": + content: {} + description: successful operation + summary: test json serialization of form data + tags: + - fake + x-content-type: application/x-www-form-urlencoded + x-accepts: application/json + x-tags: + - tag: fake + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + "200": + content: {} + description: successful operation + summary: test inline additionalProperties + tags: + - fake + x-codegen-request-body-name: param + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - in: query + name: query + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: fake + /fake/create_xml_item: + post: + description: this route creates an XmlItem + operationId: createXmlItem + requestBody: + content: + application/xml: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + application/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-8: + schema: + $ref: '#/components/schemas/XmlItem' + text/xml; charset=utf-16: + schema: + $ref: '#/components/schemas/XmlItem' + description: XmlItem Body + required: true + responses: + "200": + content: {} + description: successful operation + summary: creates an XmlItem + tags: + - fake + x-codegen-request-body-name: XmlItem + x-content-type: application/xml + x-accepts: application/json + x-tags: + - tag: fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + x-codegen-request-body-name: body + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: $another-fake? + /fake/body-with-file-schema: + put: + description: "For this test, the body for this request much reference a schema\ + \ named `File`." + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + "200": + content: {} + description: Success + tags: + - fake + x-codegen-request-body-name: body + x-content-type: application/json + x-accepts: application/json + x-tags: + - tag: fake + /fake/test-query-parameters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: false + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + - in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + "200": + content: {} + description: Success + tags: + - fake + x-accepts: application/json + x-tags: + - tag: fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + in: path + name: petId + required: true + schema: + format: int64 + type: integer + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/uploadFileWithRequiredFile_request' + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + x-content-type: multipart/form-data + x-accepts: application/json + x-tags: + - tag: pet +components: + schemas: + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + uniqueItems: true + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + $special[model.name]: + properties: + $special[property.name]: + format: int64 + type: integer + type: object + xml: + name: "$special[model.name]" + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + type: object + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + "123Number": + readOnly: true + type: integer + required: + - name + type: object + xml: + name: Name + "200_response": + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + type: object + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + type: object + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + breed: + type: string + type: object + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - properties: + declawed: + type: boolean + type: object + BigCat: + allOf: + - $ref: '#/components/schemas/Cat' + - properties: + kind: + enum: + - lions + - tigers + - leopards + - jaguars + type: string + type: object + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: "/[a-z]/i" + type: string + byte: + format: byte + pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + BigDecimal: + format: number + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_string: + additionalProperties: + type: string + type: object + map_number: + additionalProperties: + type: number + type: object + map_integer: + additionalProperties: + type: integer + type: object + map_boolean: + additionalProperties: + type: boolean + type: object + map_array_integer: + additionalProperties: + items: + type: integer + type: array + type: object + map_array_anytype: + additionalProperties: + items: + properties: {} + type: object + type: array + type: object + map_map_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_map_anytype: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + type: object + anytype_1: + properties: {} + type: object + anytype_2: + type: object + anytype_3: + properties: {} + type: object + type: object + AdditionalPropertiesString: + additionalProperties: + type: string + properties: + name: + type: string + type: object + AdditionalPropertiesInteger: + additionalProperties: + type: integer + properties: + name: + type: string + type: object + AdditionalPropertiesNumber: + additionalProperties: + type: number + properties: + name: + type: string + type: object + AdditionalPropertiesBoolean: + additionalProperties: + type: boolean + properties: + name: + type: string + type: object + AdditionalPropertiesArray: + additionalProperties: + items: + properties: {} + type: object + type: array + properties: + name: + type: string + type: object + AdditionalPropertiesObject: + additionalProperties: + additionalProperties: + properties: {} + type: object + type: object + properties: + name: + type: string + type: object + AdditionalPropertiesAnyType: + additionalProperties: + properties: {} + type: object + properties: + name: + type: string + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + "123-list": + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + type: string + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + TypeHolderDefault: + properties: + string_item: + default: what + type: string + number_item: + type: number + integer_item: + type: integer + bool_item: + default: true + type: boolean + array_item: + items: + type: integer + type: array + required: + - array_item + - bool_item + - integer_item + - number_item + - string_item + type: object + TypeHolderExample: + properties: + string_item: + example: what + type: string + number_item: + example: 1.234 + type: number + float_item: + example: 1.234 + format: float + type: number + integer_item: + example: -2 + type: integer + bool_item: + example: true + type: boolean + array_item: + example: + - 0 + - 1 + - 2 + - 3 + items: + type: integer + type: array + required: + - array_item + - bool_item + - float_item + - integer_item + - number_item + - string_item + type: object + XmlItem: + properties: + attribute_string: + example: string + type: string + xml: + attribute: true + attribute_number: + example: 1.234 + type: number + xml: + attribute: true + attribute_integer: + example: -2 + type: integer + xml: + attribute: true + attribute_boolean: + example: true + type: boolean + xml: + attribute: true + wrapped_array: + items: + type: integer + type: array + xml: + wrapped: true + name_string: + example: string + type: string + xml: + name: xml_name_string + name_number: + example: 1.234 + type: number + xml: + name: xml_name_number + name_integer: + example: -2 + type: integer + xml: + name: xml_name_integer + name_boolean: + example: true + type: boolean + xml: + name: xml_name_boolean + name_array: + items: + type: integer + xml: + name: xml_name_array_item + type: array + name_wrapped_array: + items: + type: integer + xml: + name: xml_name_wrapped_array_item + type: array + xml: + name: xml_name_wrapped_array + wrapped: true + prefix_string: + example: string + type: string + xml: + prefix: ab + prefix_number: + example: 1.234 + type: number + xml: + prefix: cd + prefix_integer: + example: -2 + type: integer + xml: + prefix: ef + prefix_boolean: + example: true + type: boolean + xml: + prefix: gh + prefix_array: + items: + type: integer + xml: + prefix: ij + type: array + prefix_wrapped_array: + items: + type: integer + xml: + prefix: mn + type: array + xml: + prefix: kl + wrapped: true + namespace_string: + example: string + type: string + xml: + namespace: http://a.com/schema + namespace_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + namespace_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + namespace_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + namespace_array: + items: + type: integer + xml: + namespace: http://e.com/schema + type: array + namespace_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + type: array + xml: + namespace: http://f.com/schema + wrapped: true + prefix_ns_string: + example: string + type: string + xml: + namespace: http://a.com/schema + prefix: a + prefix_ns_number: + example: 1.234 + type: number + xml: + namespace: http://b.com/schema + prefix: b + prefix_ns_integer: + example: -2 + type: integer + xml: + namespace: http://c.com/schema + prefix: c + prefix_ns_boolean: + example: true + type: boolean + xml: + namespace: http://d.com/schema + prefix: d + prefix_ns_array: + items: + type: integer + xml: + namespace: http://e.com/schema + prefix: e + type: array + prefix_ns_wrapped_array: + items: + type: integer + xml: + namespace: http://g.com/schema + prefix: g + type: array + xml: + namespace: http://f.com/schema + prefix: f + wrapped: true + type: object + xml: + namespace: http://a.com/schema + prefix: pre + updatePetWithForm_request: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + uploadFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + testEnumParameters_request: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + testEndpointParameters_request: + properties: + integer: + description: None + format: int32 + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: "/[a-z]/i" + type: string + pattern_without_delimiter: + description: None + pattern: "^[A-Z].*" + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + testJsonFormData_request: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + uploadFileWithRequiredFile_request: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http +x-original-swagger-version: "2.0"