diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7..bc66e2a3865 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v10-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7..bc66e2a3865 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7..bc66e2a3865 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v6-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7..bc66e2a3865 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-not-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7..bc66e2a3865 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v7-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/single-request-parameter/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v8-provided-in-root/builds/with-prefixed-module-name/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES index 7f11560dda7..bc66e2a3865 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/default/.openapi-generator/FILES @@ -9,11 +9,11 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts variables.ts diff --git a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES index d85eeefc6f2..a2650d9db08 100644 --- a/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-angular-v9-provided-in-root/builds/with-npm/.openapi-generator/FILES @@ -9,12 +9,12 @@ configuration.ts encoder.ts git_push.sh index.ts -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts ng-package.json package.json diff --git a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES index ff52c7c5b2b..c4f1df469e4 100644 --- a/samples/client/petstore/typescript-node/default/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/default/.openapi-generator/FILES @@ -5,10 +5,10 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts diff --git a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES index d24a1934784..914f5ced854 100644 --- a/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES +++ b/samples/client/petstore/typescript-node/npm/.openapi-generator/FILES @@ -5,12 +5,12 @@ api/petApi.ts api/storeApi.ts api/userApi.ts git_push.sh -model/apiResponse.ts -model/category.ts -model/order.ts -model/pet.ts -model/tag.ts -model/user.ts +model/./apiResponse.ts +model/./category.ts +model/./order.ts +model/./pet.ts +model/./tag.ts +model/./user.ts model/models.ts package.json tsconfig.json diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt index 1c2b5967d0f..3ac3578638d 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/PetApi.kt @@ -1,80 +1,80 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.server.apis - -import com.google.gson.Gson -import io.ktor.application.call -import io.ktor.auth.UserIdPrincipal -import io.ktor.auth.authentication -import io.ktor.auth.authenticate -import io.ktor.auth.OAuthAccessTokenResponse -import io.ktor.auth.OAuthServerSettings -import io.ktor.http.ContentType -import io.ktor.http.HttpStatusCode -import io.ktor.locations.KtorExperimentalLocationsAPI -import io.ktor.locations.delete -import io.ktor.locations.get -import io.ktor.response.respond -import io.ktor.response.respondText -import io.ktor.routing.Route -import io.ktor.routing.post -import io.ktor.routing.put -import io.ktor.routing.route - -import org.openapitools.server.Paths -import org.openapitools.server.infrastructure.ApiPrincipal - - -import org.openapitools.server.models.ApiResponse -import org.openapitools.server.models.Pet - -@KtorExperimentalLocationsAPI -fun Route.PetApi() { - val gson = Gson() - val empty = mutableMapOf() - - route("/pet") { - authenticate("petstore_auth") { - post { - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - } - } - - - delete { _: Paths.deletePet -> - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - - - get { _: Paths.findPetsByStatus -> - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.server.apis + +import com.google.gson.Gson +import io.ktor.application.call +import io.ktor.auth.UserIdPrincipal +import io.ktor.auth.authentication +import io.ktor.auth.authenticate +import io.ktor.auth.OAuthAccessTokenResponse +import io.ktor.auth.OAuthServerSettings +import io.ktor.http.ContentType +import io.ktor.http.HttpStatusCode +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.response.respond +import io.ktor.response.respondText +import io.ktor.routing.Route +import io.ktor.routing.post +import io.ktor.routing.put +import io.ktor.routing.route + +import org.openapitools.server.Paths +import org.openapitools.server.infrastructure.ApiPrincipal + + +import org.openapitools.server.models.ApiResponse +import org.openapitools.server.models.Pet + +@KtorExperimentalLocationsAPI +fun Route.PetApi() { + val gson = Gson() + val empty = mutableMapOf() + + route("/pet") { + authenticate("petstore_auth") { + post { + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + call.respond(HttpStatusCode.NotImplemented) + } + } + } + } + + + delete { _: Paths.deletePet -> + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + call.respond(HttpStatusCode.NotImplemented) + } + } + + + get { _: Paths.findPetsByStatus -> + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + val exampleContentType = "application/json" val exampleContentString = """{ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -91,24 +91,24 @@ fun Route.PetApi() { "id" : 1 } ], "status" : "available" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - } - - - get { _: Paths.findPetsByTags -> - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" + }""" + + when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) + } + } + } + + + get { _: Paths.findPetsByTags -> + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + val exampleContentType = "application/json" val exampleContentString = """{ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -125,24 +125,24 @@ fun Route.PetApi() { "id" : 1 } ], "status" : "available" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - } - - - get { _: Paths.getPetById -> - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" + }""" + + when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) + } + } + } + + + get { _: Paths.getPetById -> + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + val exampleContentType = "application/json" val exampleContentString = """{ "photoUrls" : [ "photoUrls", "photoUrls" ], "name" : "doggie", @@ -159,70 +159,70 @@ fun Route.PetApi() { "id" : 1 } ], "status" : "available" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - } - - - route("/pet") { - authenticate("petstore_auth") { - put { - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - } - } - - - route("/pet/{petId}") { - authenticate("petstore_auth") { - post { - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - } - } - - - route("/pet/{petId}/uploadImage") { - authenticate("petstore_auth") { - post { - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - val exampleContentType = "application/json" + }""" + + when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) + } + } + } + + + route("/pet") { + authenticate("petstore_auth") { + put { + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + call.respond(HttpStatusCode.NotImplemented) + } + } + } + } + + + route("/pet/{petId}") { + authenticate("petstore_auth") { + post { + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + call.respond(HttpStatusCode.NotImplemented) + } + } + } + } + + + route("/pet/{petId}/uploadImage") { + authenticate("petstore_auth") { + post { + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + val exampleContentType = "application/json" val exampleContentString = """{ "code" : 0, "type" : "type", "message" : "message" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - } - } - } - -} + }""" + + when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) + } + } + } + } + } + +} diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt index 121bf335787..17b2c526bd9 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/StoreApi.kt @@ -1,64 +1,64 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.server.apis - -import com.google.gson.Gson -import io.ktor.application.call -import io.ktor.auth.UserIdPrincipal -import io.ktor.auth.authentication -import io.ktor.auth.authenticate -import io.ktor.auth.OAuthAccessTokenResponse -import io.ktor.auth.OAuthServerSettings -import io.ktor.http.ContentType -import io.ktor.http.HttpStatusCode -import io.ktor.locations.KtorExperimentalLocationsAPI -import io.ktor.locations.delete -import io.ktor.locations.get -import io.ktor.response.respond -import io.ktor.response.respondText -import io.ktor.routing.Route -import io.ktor.routing.post -import io.ktor.routing.put -import io.ktor.routing.route - -import org.openapitools.server.Paths -import org.openapitools.server.infrastructure.ApiPrincipal - - -import org.openapitools.server.models.Order - -@KtorExperimentalLocationsAPI -fun Route.StoreApi() { - val gson = Gson() - val empty = mutableMapOf() - - delete { _: Paths.deleteOrder -> - call.respond(HttpStatusCode.NotImplemented) - } - - - get { _: Paths.getInventory -> - val principal = call.authentication.principal() - - if (principal == null) { - call.respond(HttpStatusCode.Unauthorized) - } else { - call.respond(HttpStatusCode.NotImplemented) - } - } - - - get { _: Paths.getOrderById -> - val exampleContentType = "application/json" +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.server.apis + +import com.google.gson.Gson +import io.ktor.application.call +import io.ktor.auth.UserIdPrincipal +import io.ktor.auth.authentication +import io.ktor.auth.authenticate +import io.ktor.auth.OAuthAccessTokenResponse +import io.ktor.auth.OAuthServerSettings +import io.ktor.http.ContentType +import io.ktor.http.HttpStatusCode +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.response.respond +import io.ktor.response.respondText +import io.ktor.routing.Route +import io.ktor.routing.post +import io.ktor.routing.put +import io.ktor.routing.route + +import org.openapitools.server.Paths +import org.openapitools.server.infrastructure.ApiPrincipal + + +import org.openapitools.server.models.Order + +@KtorExperimentalLocationsAPI +fun Route.StoreApi() { + val gson = Gson() + val empty = mutableMapOf() + + delete { _: Paths.deleteOrder -> + call.respond(HttpStatusCode.NotImplemented) + } + + + get { _: Paths.getInventory -> + val principal = call.authentication.principal() + + if (principal == null) { + call.respond(HttpStatusCode.Unauthorized) + } else { + call.respond(HttpStatusCode.NotImplemented) + } + } + + + get { _: Paths.getOrderById -> + val exampleContentType = "application/json" val exampleContentString = """{ "petId" : 6, "quantity" : 1, @@ -66,19 +66,19 @@ fun Route.StoreApi() { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - - - route("/store/order") { - post { - val exampleContentType = "application/json" + }""" + + when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) + } + } + + + route("/store/order") { + post { + val exampleContentType = "application/json" val exampleContentString = """{ "petId" : 6, "quantity" : 1, @@ -86,14 +86,14 @@ fun Route.StoreApi() { "shipDate" : "2000-01-23T04:56:07.000+00:00", "complete" : false, "status" : "placed" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - } - -} + }""" + + when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) + } + } + } + +} diff --git a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt index 91ef1163890..7fc0b78fa99 100644 --- a/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt +++ b/samples/server/petstore/kotlin-server/ktor/src/main/kotlin/org/openapitools/server/apis/UserApi.kt @@ -1,74 +1,74 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.server.apis - -import com.google.gson.Gson -import io.ktor.application.call -import io.ktor.auth.UserIdPrincipal -import io.ktor.auth.authentication -import io.ktor.auth.authenticate -import io.ktor.auth.OAuthAccessTokenResponse -import io.ktor.auth.OAuthServerSettings -import io.ktor.http.ContentType -import io.ktor.http.HttpStatusCode -import io.ktor.locations.KtorExperimentalLocationsAPI -import io.ktor.locations.delete -import io.ktor.locations.get -import io.ktor.response.respond -import io.ktor.response.respondText -import io.ktor.routing.Route -import io.ktor.routing.post -import io.ktor.routing.put -import io.ktor.routing.route - -import org.openapitools.server.Paths -import org.openapitools.server.infrastructure.ApiPrincipal - - -import org.openapitools.server.models.User - -@KtorExperimentalLocationsAPI -fun Route.UserApi() { - val gson = Gson() - val empty = mutableMapOf() - - route("/user") { - post { - call.respond(HttpStatusCode.NotImplemented) - } - } - - - route("/user/createWithArray") { - post { - call.respond(HttpStatusCode.NotImplemented) - } - } - - - route("/user/createWithList") { - post { - call.respond(HttpStatusCode.NotImplemented) - } - } - - - delete { _: Paths.deleteUser -> - call.respond(HttpStatusCode.NotImplemented) - } - - - get { _: Paths.getUserByName -> - val exampleContentType = "application/json" +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +package org.openapitools.server.apis + +import com.google.gson.Gson +import io.ktor.application.call +import io.ktor.auth.UserIdPrincipal +import io.ktor.auth.authentication +import io.ktor.auth.authenticate +import io.ktor.auth.OAuthAccessTokenResponse +import io.ktor.auth.OAuthServerSettings +import io.ktor.http.ContentType +import io.ktor.http.HttpStatusCode +import io.ktor.locations.KtorExperimentalLocationsAPI +import io.ktor.locations.delete +import io.ktor.locations.get +import io.ktor.response.respond +import io.ktor.response.respondText +import io.ktor.routing.Route +import io.ktor.routing.post +import io.ktor.routing.put +import io.ktor.routing.route + +import org.openapitools.server.Paths +import org.openapitools.server.infrastructure.ApiPrincipal + + +import org.openapitools.server.models.User + +@KtorExperimentalLocationsAPI +fun Route.UserApi() { + val gson = Gson() + val empty = mutableMapOf() + + route("/user") { + post { + call.respond(HttpStatusCode.NotImplemented) + } + } + + + route("/user/createWithArray") { + post { + call.respond(HttpStatusCode.NotImplemented) + } + } + + + route("/user/createWithList") { + post { + call.respond(HttpStatusCode.NotImplemented) + } + } + + + delete { _: Paths.deleteUser -> + call.respond(HttpStatusCode.NotImplemented) + } + + + get { _: Paths.getUserByName -> + val exampleContentType = "application/json" val exampleContentString = """{ "firstName" : "firstName", "lastName" : "lastName", @@ -78,30 +78,30 @@ fun Route.UserApi() { "id" : 0, "email" : "email", "username" : "username" - }""" - - when(exampleContentType) { - "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) - "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) - else -> call.respondText(exampleContentString) - } - } - - - get { _: Paths.loginUser -> - call.respond(HttpStatusCode.NotImplemented) - } - - - get { _: Paths.logoutUser -> - call.respond(HttpStatusCode.NotImplemented) - } - - - route("/user/{username}") { - put { - call.respond(HttpStatusCode.NotImplemented) - } - } - -} + }""" + + when(exampleContentType) { + "application/json" -> call.respond(gson.fromJson(exampleContentString, empty::class.java)) + "application/xml" -> call.respondText(exampleContentString, ContentType.Text.Xml) + else -> call.respondText(exampleContentString) + } + } + + + get { _: Paths.loginUser -> + call.respond(HttpStatusCode.NotImplemented) + } + + + get { _: Paths.logoutUser -> + call.respond(HttpStatusCode.NotImplemented) + } + + + route("/user/{username}") { + put { + call.respond(HttpStatusCode.NotImplemented) + } + } + +} diff --git a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES index 8c41d6e8cf5..b00a0510b77 100644 --- a/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES +++ b/samples/server/petstore/php-symfony/SymfonyBundle-php/.openapi-generator/FILES @@ -1,26 +1,26 @@ -Api/ApiServer.php -Api/PetApiInterface.php -Api/StoreApiInterface.php -Api/UserApiInterface.php -Controller/Controller.php -Controller/PetController.php -Controller/StoreController.php -Controller/UserController.php -Model/ApiResponse.php -Model/Category.php -Model/Order.php -Model/Pet.php -Model/Tag.php -Model/User.php -Service/JmsSerializer.php -Service/SerializerInterface.php -Service/StrictJsonDeserializationVisitor.php -Service/SymfonyValidator.php -Service/TypeMismatchException.php -Service/ValidatorInterface.php -Tests/AppKernel.php -Tests/Controller/ControllerTest.php -Tests/test_config.yml +./Api/ApiServer.php +./Api/PetApiInterface.php +./Api/StoreApiInterface.php +./Api/UserApiInterface.php +./Controller/Controller.php +./Controller/PetController.php +./Controller/StoreController.php +./Controller/UserController.php +./Model/ApiResponse.php +./Model/Category.php +./Model/Order.php +./Model/Pet.php +./Model/Tag.php +./Model/User.php +./Service/JmsSerializer.php +./Service/SerializerInterface.php +./Service/StrictJsonDeserializationVisitor.php +./Service/SymfonyValidator.php +./Service/TypeMismatchException.php +./Service/ValidatorInterface.php +./Tests/AppKernel.php +./Tests/Controller/ControllerTest.php +./Tests/test_config.yml .coveralls.yml .gitignore .php_cs.dist