diff --git a/.github/workflows/samples-dotnet.yaml b/.github/workflows/samples-dotnet.yaml index ddae0329c66..2edaf7f92a2 100644 --- a/.github/workflows/samples-dotnet.yaml +++ b/.github/workflows/samples-dotnet.yaml @@ -8,7 +8,6 @@ on: - 'samples/server/petstore/aspnetcore-6.0/**' - 'samples/server/petstore/aspnetcore-6.0-pocoModels/**' - 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**' - - 'samples/server/petstore/aspnetcore-6.0-useNewtonsoft/**' pull_request: paths: - 'samples/client/petstore/csharp/**net6.0**/' diff --git a/.github/workflows/samples-dotnet6-server.yaml b/.github/workflows/samples-dotnet6-server.yaml index aff0bb3a803..6f91443ad1a 100644 --- a/.github/workflows/samples-dotnet6-server.yaml +++ b/.github/workflows/samples-dotnet6-server.yaml @@ -6,7 +6,6 @@ on: - 'samples/server/petstore/aspnetcore-6.0/**' - 'samples/server/petstore/aspnetcore-6.0-pocoModels/**' - 'samples/server/petstore/aspnetcore-6.0-useSwashBuckle/**' - - 'samples/server/petstore/aspnetcore-6.0-useNewtonsoft/**' pull_request: paths: - 'samples/server/petstore/aspnetcore-6.0/**' diff --git a/bin/configs/unmaintained/openapi3/cpp-qt5-client-cpp-qt5.yaml b/bin/configs/unmaintained/openapi3/cpp-qt-client-cpp-qt.yaml similarity index 62% rename from bin/configs/unmaintained/openapi3/cpp-qt5-client-cpp-qt5.yaml rename to bin/configs/unmaintained/openapi3/cpp-qt-client-cpp-qt.yaml index 904d99a7510..8e9d8cf5bb8 100644 --- a/bin/configs/unmaintained/openapi3/cpp-qt5-client-cpp-qt5.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-qt-client-cpp-qt.yaml @@ -1,4 +1,4 @@ -generatorName: cpp-qt5-client -outputDir: samples/client/petstore/cpp-qt5 +generatorName: cpp-qt-client +outputDir: samples/client/petstore/cpp-qt inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-client +templateDir: modules/openapi-generator/src/main/resources/cpp-qt-client diff --git a/bin/configs/unmaintained/openapi3/cpp-qt5-qhttpengine-server.yaml b/bin/configs/unmaintained/openapi3/cpp-qt-qhttpengine-server.yaml similarity index 52% rename from bin/configs/unmaintained/openapi3/cpp-qt5-qhttpengine-server.yaml rename to bin/configs/unmaintained/openapi3/cpp-qt-qhttpengine-server.yaml index 285c0d9d5dd..8cd3281d3ab 100644 --- a/bin/configs/unmaintained/openapi3/cpp-qt5-qhttpengine-server.yaml +++ b/bin/configs/unmaintained/openapi3/cpp-qt-qhttpengine-server.yaml @@ -1,4 +1,4 @@ -generatorName: cpp-qt5-qhttpengine-server -outputDir: samples/client/petstore/cpp-qt5-qhttpengine-server +generatorName: cpp-qt-qhttpengine-server +outputDir: samples/client/petstore/cpp-qt-qhttpengine-server inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server +templateDir: modules/openapi-generator/src/main/resources/cpp-qt-qhttpengine-server diff --git a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClient.yaml b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClient.yaml deleted file mode 100644 index 24a5fd2b5b3..00000000000 --- a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClient.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: csharp -outputDir: samples/openapi3/client/petstore/csharp/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp -additionalProperties: - packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientNetStandard.yaml b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientNetStandard.yaml deleted file mode 100644 index e2dcfd8e9a2..00000000000 --- a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientNetStandard.yaml +++ /dev/null @@ -1,7 +0,0 @@ -generatorName: csharp -outputDir: samples/client/petstore/csharp/OpenAPIClientNetStandard -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp -additionalProperties: - targetFramework: netstandard1.3 - packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml b/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml deleted file mode 100644 index 03034797145..00000000000 --- a/bin/configs/unmaintained/openapi3/csharp-OpenAPIClientWithPropertyChanged.yaml +++ /dev/null @@ -1,8 +0,0 @@ -generatorName: csharp -outputDir: samples/client/petstore/csharp/OpenAPIClientWithPropertyChanged -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp -additionalProperties: - packageGuid: '{5CD900DE-8266-412F-A758-28E1F9C623D5}' - generatePropertyChanged: "true" - optionalEmitDefaultValues: "true" diff --git a/bin/configs/unmaintained/openapi3/csharp-dotnet2-OpenAPIClient.yaml b/bin/configs/unmaintained/openapi3/csharp-dotnet2-OpenAPIClient.yaml deleted file mode 100644 index 428ce87b8b9..00000000000 --- a/bin/configs/unmaintained/openapi3/csharp-dotnet2-OpenAPIClient.yaml +++ /dev/null @@ -1,6 +0,0 @@ -generatorName: csharp-dotnet2 -outputDir: samples/client/petstore/csharp-dotnet2/OpenAPIClientTest/Lib/OpenAPIClient -inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml -templateDir: modules/openapi-generator/src/main/resources/csharp-dotnet2 -additionalProperties: - hideGenerationTimestamp: "true" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java index 112861cbb8f..5ec99bafe61 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractEiffelCodegen.java @@ -278,9 +278,6 @@ public abstract class AbstractEiffelCodegen extends DefaultCodegen implements Co childrenByParent.put(model.parent, model); } } - if (StringUtils.isNotBlank(model.parentSchema)) { - model.parentSchema = model.parentSchema.toLowerCase(Locale.ROOT); - } } @Override diff --git a/samples/client/petstore/async-scala/.openapi-generator-ignore b/samples/client/petstore/async-scala/.openapi-generator-ignore deleted file mode 100644 index deed424f8a1..00000000000 --- a/samples/client/petstore/async-scala/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codegen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/async-scala/.openapi-generator/VERSION b/samples/client/petstore/async-scala/.openapi-generator/VERSION deleted file mode 100644 index 7fea99011a6..00000000000 --- a/samples/client/petstore/async-scala/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/async-scala/build.sbt b/samples/client/petstore/async-scala/build.sbt deleted file mode 100644 index e612d5937ea..00000000000 --- a/samples/client/petstore/async-scala/build.sbt +++ /dev/null @@ -1,12 +0,0 @@ -organization := "" - -name := "-client" - -libraryDependencies ++= Seq( - "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5", - "joda-time" % "joda-time" % "2.3", - "org.joda" % "joda-convert" % "1.3.1", - "ch.qos.logback" % "logback-classic" % "1.0.13" % "provided", - "org.scalatest" %% "scalatest" % "2.2.1" % "test", - "junit" % "junit" % "4.11" % "test" -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala deleted file mode 100644 index 7c4afb20e09..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala +++ /dev/null @@ -1,28 +0,0 @@ -package io.swagger.client - -import io.swagger.client.api._ - -import com.wordnik.swagger.client._ - -import java.io.Closeable - -class SwaggerClient(config: SwaggerConfig) extends Closeable { - val locator = config.locator - val name = config.name - - private[this] val client = transportClient - - protected def transportClient: TransportClient = new RestClient(config) - - val pet = new PetApi(client, config) - - val store = new StoreApi(client, config) - - val user = new UserApi(client, config) - - - def close() { - client.close() - } -} - diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/PetApi.scala deleted file mode 100644 index f11d2aaa1b5..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ /dev/null @@ -1,155 +0,0 @@ -package io.swagger.client.api - -import io.swagger.client.model.ApiResponse -import java.io.File -import io.swagger.client.model.Pet -import com.wordnik.swagger.client._ -import scala.concurrent.Future -import collection.mutable - -class PetApi(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - - def addPet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def deletePet(petId: Long, - apiKey: Option[String] = None - )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet/{petId}") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - apiKey match { - case Some(param) => headerParams += "api_key" -> param.toString - case _ => headerParams - } - - val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def findPetsByStatus(status: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { - // create path and map variables - val path = (addFmt("/pet/findByStatus")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") - queryParams += "status" -> status.toString - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def findPetsByTags(tags: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { - // create path and map variables - val path = (addFmt("/pet/findByTags")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") - queryParams += "tags" -> tags.toString - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getPetById(petId: Long)(implicit reader: ClientResponseReader[Pet]): Future[Pet] = { - // create path and map variables - val path = (addFmt("/pet/{petId}") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def updatePet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet") - - val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def updatePetWithForm(petId: Long, - name: Option[String] = None, - status: Option[String] = None - )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet/{petId}") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def uploadFile(petId: Long, - additionalMetadata: Option[String] = None, - file: Option[File] = None - )(implicit reader: ClientResponseReader[ApiResponse]): Future[ApiResponse] = { - // create path and map variables - val path = (addFmt("/pet/{petId}/uploadImage") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - -} diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/StoreApi.scala deleted file mode 100644 index 22fb3706712..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/StoreApi.scala +++ /dev/null @@ -1,76 +0,0 @@ -package io.swagger.client.api - -import io.swagger.client.model.Order -import com.wordnik.swagger.client._ -import scala.concurrent.Future -import collection.mutable - -class StoreApi(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - - def deleteOrder(orderId: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/store/order/{orderId}") - replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (orderId == null) throw new Exception("Missing required parameter 'orderId' when calling StoreApi->deleteOrder") - - - val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getInventory()(implicit reader: ClientResponseReader[Map[String, Integer]]): Future[Map[String, Integer]] = { - // create path and map variables - val path = (addFmt("/store/inventory")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getOrderById(orderId: Long)(implicit reader: ClientResponseReader[Order]): Future[Order] = { - // create path and map variables - val path = (addFmt("/store/order/{orderId}") - replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def placeOrder(body: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = { - // create path and map variables - val path = (addFmt("/store/order")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - -} diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/UserApi.scala deleted file mode 100644 index 025c9f26925..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/UserApi.scala +++ /dev/null @@ -1,152 +0,0 @@ -package io.swagger.client.api - -import io.swagger.client.model.User -import com.wordnik.swagger.client._ -import scala.concurrent.Future -import collection.mutable - -class UserApi(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - - def createUser(body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def createUsersWithArrayInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/createWithArray")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def createUsersWithListInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/createWithList")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def deleteUser(username: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/{username}") - replaceAll ("\\{" + "username" + "\\}",username.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->deleteUser") - - - val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getUserByName(username: String)(implicit reader: ClientResponseReader[User]): Future[User] = { - // create path and map variables - val path = (addFmt("/user/{username}") - replaceAll ("\\{" + "username" + "\\}",username.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->getUserByName") - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def loginUser(username: String, - password: String)(implicit reader: ClientResponseReader[String]): Future[String] = { - // create path and map variables - val path = (addFmt("/user/login")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->loginUser") - - if (password == null) throw new Exception("Missing required parameter 'password' when calling UserApi->loginUser") - - queryParams += "username" -> username.toString - queryParams += "password" -> password.toString - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def logoutUser()(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/logout")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def updateUser(username: String, - body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/{username}") - replaceAll ("\\{" + "username" + "\\}",username.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->updateUser") - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->updateUser") - - val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - -} diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala deleted file mode 100644 index d1d2c29d588..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala +++ /dev/null @@ -1,11 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class ApiResponse ( - code: Option[Integer], -_type: Option[String], -message: Option[String] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Category.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Category.scala deleted file mode 100644 index afd533df15e..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Category.scala +++ /dev/null @@ -1,10 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Category ( - id: Option[Long], -name: Option[String] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Order.scala deleted file mode 100644 index 42f4859e2e3..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Order.scala +++ /dev/null @@ -1,14 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Order ( - id: Option[Long], -petId: Option[Long], -quantity: Option[Integer], -shipDate: Option[DateTime], -status: Option[String], // Order Status -complete: Option[Boolean] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Pet.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Pet.scala deleted file mode 100644 index f296c7f7146..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Pet.scala +++ /dev/null @@ -1,14 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Pet ( - id: Option[Long], -category: Option[Category], -name: String, -photoUrls: List[String], -tags: Option[List[Tag]], -status: Option[String] // pet status in the store -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Tag.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Tag.scala deleted file mode 100644 index 3d7772c5659..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Tag.scala +++ /dev/null @@ -1,10 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Tag ( - id: Option[Long], -name: Option[String] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/User.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/User.scala deleted file mode 100644 index e016b7a88dd..00000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/User.scala +++ /dev/null @@ -1,16 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class User ( - id: Option[Long], -username: Option[String], -firstName: Option[String], -lastName: Option[String], -email: Option[String], -password: Option[String], -phone: Option[String], -userStatus: Option[Integer] // User Status -) diff --git a/samples/client/petstore/async-scala/src/test/scala/Test.scala b/samples/client/petstore/async-scala/src/test/scala/Test.scala deleted file mode 100644 index 796c96ca822..00000000000 --- a/samples/client/petstore/async-scala/src/test/scala/Test.scala +++ /dev/null @@ -1,36 +0,0 @@ -import java.net.URI - -import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ -import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ -import com.wordnik.swagger.client.SwaggerConfig -import io.swagger.client.SwaggerClient -import org.junit.runner.RunWith -import org.scalatest._ -import org.scalatest.junit.JUnitRunner - -import scala.concurrent.ExecutionContext.Implicits.global -import scala.concurrent._ -import scala.concurrent.duration._ -import scala.util.{Failure, Success} - -@RunWith(classOf[JUnitRunner]) -class SimpleTest extends FlatSpec with Matchers { - implicit val formats = org.json4s.DefaultFormats - implicit val reader = JsonFormatsReader - implicit val writer = JsonFormatsWriter - - it should "call the api" in { - val config = SwaggerConfig.forUrl(new URI("http://petstore.swagger.io/v2")) - val client = new SwaggerClient(config) - - val future = client.pet.getPetById(3) - val await = Await.ready(future, Duration.Inf) - - await onComplete { - case Success(pet) => { - println(pet) - } - case Failure(t) => println("failed " + t.getMessage) - } - } -} diff --git a/samples/client/petstore/spring-stubs/.openapi-generator-ignore b/samples/client/petstore/spring-stubs/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/client/petstore/spring-stubs/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/FILES b/samples/client/petstore/spring-stubs/.openapi-generator/FILES deleted file mode 100644 index 718ebc8e8c9..00000000000 --- a/samples/client/petstore/spring-stubs/.openapi-generator/FILES +++ /dev/null @@ -1,13 +0,0 @@ -.openapi-generator-ignore -README.md -pom.xml -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/User.java diff --git a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION b/samples/client/petstore/spring-stubs/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/client/petstore/spring-stubs/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/README.md b/samples/client/petstore/spring-stubs/README.md deleted file mode 100644 index d43a1de307d..00000000000 --- a/samples/client/petstore/spring-stubs/README.md +++ /dev/null @@ -1,27 +0,0 @@ - -# OpenAPI generated API stub - -Spring Framework stub - - -## Overview -This code was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate an API stub. -This is an example of building API stub interfaces in Java using the Spring framework. - -The stubs generated can be used in your existing Spring-MVC or Spring-Boot application to create controller endpoints -by adding ```@Controller``` classes that implement the interface. Eg: -```java -@Controller -public class PetController implements PetApi { -// implement all PetApi methods -} -``` - -You can also use the interface to create [Spring-Cloud Feign clients](http://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-feign-inheritance).Eg: -```java -@FeignClient(name="pet", url="http://petstore.swagger.io/v2") -public interface PetClient extends PetApi { - -} -``` diff --git a/samples/client/petstore/spring-stubs/pom.xml b/samples/client/petstore/spring-stubs/pom.xml deleted file mode 100644 index 1e88f315c06..00000000000 --- a/samples/client/petstore/spring-stubs/pom.xml +++ /dev/null @@ -1,83 +0,0 @@ - - 4.0.0 - org.openapitools - spring-stubs - jar - spring-stubs - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 2.9.2 - 4.10.3 - - - org.springframework.boot - spring-boot-starter-parent - 2.5.14 - - - - src/main/java - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.data - spring-data-commons - - - - io.springfox - springfox-swagger2 - ${springfox.version} - - - org.webjars - swagger-ui - ${swagger-ui.version} - - - org.webjars - webjars-locator-core - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.2.2 - - - - org.springframework.boot - spring-boot-starter-validation - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0cc..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index d41b6f67273..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,395 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "pet", description = "Everything about your Pets") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = "application/json" - ) - default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return Invalid pet value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid pet value") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = "application/json" - ) - default ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = "application/json" - ) - default ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @ApiOperation( - tags = { "pet" }, - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet.class, - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = "application/json" - ) - default ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 doggie aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = "application/json" - ) - default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = "application/x-www-form-urlencoded" - ) - default ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = "application/json", - consumes = "multipart/form-data" - ) - default ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - -} diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 2c8321118e9..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,195 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "store", description = "Access to Petstore orders") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{orderId} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Delete purchase order by ID", - nickname = "deleteOrder", - notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors" - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{orderId}" - ) - default ResponseEntity deleteOrder( - @ApiParam(value = "ID of the order that needs to be deleted", required = true) @PathVariable("orderId") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "store" }, - value = "Returns pet inventories by status", - nickname = "getInventory", - notes = "Returns a map of status codes to quantities", - response = Integer.class, - responseContainer = "Map", - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Map.class, responseContainer = "Map") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = "application/json" - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /store/order/{orderId} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @ApiOperation( - tags = { "store" }, - value = "Find purchase order by ID", - nickname = "getOrderById", - notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Order not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{orderId}", - produces = "application/json" - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @ApiOperation( - tags = { "store" }, - value = "Place an order for a pet", - nickname = "placeOrder", - notes = "", - response = Order.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Order.class), - @ApiResponse(code = 400, message = "Invalid Order") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = "application/json" - ) - default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - -} diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 7c5e816ce78..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "user", description = "Operations about user") -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = "application/json" - ) - default ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = "application/json" - ) - default ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - - } - -} diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 9f5ef4d9f1a..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A category for a pet - */ - -@ApiModel(description = "A category for a pet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 52fb11fd3cf..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,135 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Describes the result of uploading an image resource - */ - -@ApiModel(description = "Describes the result of uploading an image resource") -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @ApiModelProperty(value = "") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @ApiModelProperty(value = "") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 66d9df6dfd9..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,246 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * An order for a pets from the pet store - */ - -@ApiModel(description = "An order for a pets from the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @ApiModelProperty(value = "") - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 1962262aea9..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,262 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A pet for sale in the pet store - */ - -@ApiModel(description = "A pet for sale in the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private List photoUrls = new ArrayList<>(); - - @JsonProperty("tags") - @Valid - private List tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { - return photoUrls; - } - - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index b30aa3fd9a2..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A tag for a pet - */ - -@ApiModel(description = "A tag for a pet") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java b/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index 8d71f0fcc04..00000000000 --- a/samples/client/petstore/spring-stubs/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,253 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A User who is purchasing from the pet store - */ - -@ApiModel(description = "A User who is purchasing from the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/client/petstore/tiny/cpp/.gitignore b/samples/client/petstore/tiny/cpp/.gitignore deleted file mode 100644 index 89cc49cbd65..00000000000 --- a/samples/client/petstore/tiny/cpp/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.pio -.vscode/.browse.c_cpp.db* -.vscode/c_cpp_properties.json -.vscode/launch.json -.vscode/ipch diff --git a/samples/client/petstore/tiny/cpp/.openapi-generator-ignore b/samples/client/petstore/tiny/cpp/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/client/petstore/tiny/cpp/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/tiny/cpp/.openapi-generator/FILES b/samples/client/petstore/tiny/cpp/.openapi-generator/FILES deleted file mode 100644 index 1024d945064..00000000000 --- a/samples/client/petstore/tiny/cpp/.openapi-generator/FILES +++ /dev/null @@ -1,30 +0,0 @@ -README.md -README.md -lib/Models/ApiResponse.cpp -lib/Models/ApiResponse.h -lib/Models/Category.cpp -lib/Models/Category.h -lib/Models/Helpers.cpp -lib/Models/Helpers.h -lib/Models/Order.cpp -lib/Models/Order.h -lib/Models/Pet.cpp -lib/Models/Pet.h -lib/Models/Tag.cpp -lib/Models/Tag.h -lib/Models/User.cpp -lib/Models/User.h -lib/service/AbstractService.cpp -lib/service/AbstractService.h -lib/service/PetApi.cpp -lib/service/PetApi.h -lib/service/Response.h -lib/service/StoreApi.cpp -lib/service/StoreApi.h -lib/service/UserApi.cpp -lib/service/UserApi.h -platformio.ini -pre_compiling_bourne.py -root.cert -src/main.cpp -test/RunTests.cpp diff --git a/samples/client/petstore/tiny/cpp/.openapi-generator/VERSION b/samples/client/petstore/tiny/cpp/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc19..00000000000 --- a/samples/client/petstore/tiny/cpp/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/tiny/cpp/README.md b/samples/client/petstore/tiny/cpp/README.md deleted file mode 100644 index 87027780c24..00000000000 --- a/samples/client/petstore/tiny/cpp/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# Documentation for OpenAPI Petstore -This is a client generator for microcontrollers on the Espressif32 platform and the Arduino framework -After the client have been generated, you have to change these following variables: -- root.cert | Provide your service root certificate. -- src/main.cpp | Change wifi name -- src/main.cpp | Change wifi password -- lib/service/AbstractService.h | Change to your url - -# Documentation for OpenAPI Petstore 1.0.0 Tiny client cpp (Arduino) - -The project is structured like this: -``` -samples/client/petstore/tiny/cpp/ -├── lib -│ ├── Models -│ ├── service -│ └── TestFiles -├── platformio.ini -├── pre_compiling_bourne.py -├── README.md -├── root.cert -├── src -│ └── main.cpp -└── test - └── RunTests.cpp -``` - -All URIs are relative to http://petstore.swagger.iohttp://petstore.swagger.io/v2 - -### PetApi -|Method | HTTP request | Description| -|------------- | ------------- | -------------| -|*addPet* | *POST* /pet | Add a new pet to the store.| -|*deletePet* | *DELETE* /pet/{petId} | Deletes a pet.| -|*findPetsByStatus* | *GET* /pet/findByStatus | Finds Pets by status.| -|*findPetsByTags* | *GET* /pet/findByTags | Finds Pets by tags.| -|*getPetById* | *GET* /pet/{petId} | Find pet by ID.| -|*updatePet* | *PUT* /pet | Update an existing pet.| -|*updatePetWithForm* | *POST* /pet/{petId} | Updates a pet in the store with form data.| -|*uploadFile* | *POST* /pet/{petId}/uploadImage | uploads an image.| - -### StoreApi -|Method | HTTP request | Description| -|------------- | ------------- | -------------| -|*deleteOrder* | *DELETE* /store/order/{orderId} | Delete purchase order by ID.| -|*getInventory* | *GET* /store/inventory | Returns pet inventories by status.| -|*getOrderById* | *GET* /store/order/{orderId} | Find purchase order by ID.| -|*placeOrder* | *POST* /store/order | Place an order for a pet.| - -### UserApi -|Method | HTTP request | Description| -|------------- | ------------- | -------------| -|*createUser* | *POST* /user | Create user.| -|*createUsersWithArrayInput* | *POST* /user/createWithArray | Creates list of users with given input array.| -|*createUsersWithListInput* | *POST* /user/createWithList | Creates list of users with given input array.| -|*deleteUser* | *DELETE* /user/{username} | Delete user.| -|*getUserByName* | *GET* /user/{username} | Get user by user name.| -|*loginUser* | *GET* /user/login | Logs user into the system.| -|*logoutUser* | *GET* /user/logout | Logs out current logged in user session.| -|*updateUser* | *PUT* /user/{username} | Updated user.| - - -## What are the Model files for the data structures/objects? -|Class | Description| -|------------- | -------------| -|*ApiResponse* | Describes the result of uploading an image resource| -|*Category* | A category for a pet| -|*Order* | An order for a pets from the pet store| -|*Pet* | A pet for sale in the pet store| -|*Tag* | A tag for a pet| -|*User* | A User who is purchasing from the pet store| - - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/ApiResponse.cpp b/samples/client/petstore/tiny/cpp/lib/Models/ApiResponse.cpp deleted file mode 100644 index e9be9e2b618..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/ApiResponse.cpp +++ /dev/null @@ -1,139 +0,0 @@ - - -#include "ApiResponse.h" - -using namespace Tiny; - -ApiResponse::ApiResponse() -{ - code = int(0); - type = std::string(); - message = std::string(); -} - -ApiResponse::ApiResponse(std::string jsonString) -{ - this->fromJson(jsonString); -} - -ApiResponse::~ApiResponse() -{ - -} - -void -ApiResponse::fromJson(std::string jsonObj) -{ - bourne::json object = bourne::json::parse(jsonObj); - - const char *codeKey = "code"; - - if(object.has_key(codeKey)) - { - bourne::json value = object[codeKey]; - - - - jsonToValue(&code, value, "int"); - - - } - - const char *typeKey = "type"; - - if(object.has_key(typeKey)) - { - bourne::json value = object[typeKey]; - - - - jsonToValue(&type, value, "std::string"); - - - } - - const char *messageKey = "message"; - - if(object.has_key(messageKey)) - { - bourne::json value = object[messageKey]; - - - - jsonToValue(&message, value, "std::string"); - - - } - - -} - -bourne::json -ApiResponse::toJson() -{ - bourne::json object = bourne::json::object(); - - - - - - object["code"] = getCode(); - - - - - - - object["type"] = getType(); - - - - - - - object["message"] = getMessage(); - - - - return object; - -} - -int -ApiResponse::getCode() -{ - return code; -} - -void -ApiResponse::setCode(int code) -{ - this->code = code; -} - -std::string -ApiResponse::getType() -{ - return type; -} - -void -ApiResponse::setType(std::string type) -{ - this->type = type; -} - -std::string -ApiResponse::getMessage() -{ - return message; -} - -void -ApiResponse::setMessage(std::string message) -{ - this->message = message; -} - - - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/ApiResponse.h b/samples/client/petstore/tiny/cpp/lib/Models/ApiResponse.h deleted file mode 100644 index dbaf8abcaf3..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/ApiResponse.h +++ /dev/null @@ -1,78 +0,0 @@ - -/* - * ApiResponse.h - * - * Describes the result of uploading an image resource - */ - -#ifndef TINY_CPP_CLIENT_ApiResponse_H_ -#define TINY_CPP_CLIENT_ApiResponse_H_ - - -#include -#include "bourne/json.hpp" -#include "Helpers.h" - -namespace Tiny { - - -/*! \brief Describes the result of uploading an image resource - * - * \ingroup Models - * - */ - -class ApiResponse{ -public: - - /*! \brief Constructor. - */ - ApiResponse(); - ApiResponse(std::string jsonString); - - - /*! \brief Destructor. - */ - virtual ~ApiResponse(); - - - /*! \brief Retrieve a bourne JSON representation of this class. - */ - bourne::json toJson(); - - - /*! \brief Fills in members of this class from bourne JSON object representing it. - */ - void fromJson(std::string jsonObj); - - /*! \brief Get - */ - int getCode(); - - /*! \brief Set - */ - void setCode(int code); - /*! \brief Get - */ - std::string getType(); - - /*! \brief Set - */ - void setType(std::string type); - /*! \brief Get - */ - std::string getMessage(); - - /*! \brief Set - */ - void setMessage(std::string message); - - - private: - int code{}; - std::string type{}; - std::string message{}; -}; -} - -#endif /* TINY_CPP_CLIENT_ApiResponse_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Category.cpp b/samples/client/petstore/tiny/cpp/lib/Models/Category.cpp deleted file mode 100644 index 950b06ffd44..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Category.cpp +++ /dev/null @@ -1,106 +0,0 @@ - - -#include "Category.h" - -using namespace Tiny; - -Category::Category() -{ - id = long(0); - name = std::string(); -} - -Category::Category(std::string jsonString) -{ - this->fromJson(jsonString); -} - -Category::~Category() -{ - -} - -void -Category::fromJson(std::string jsonObj) -{ - bourne::json object = bourne::json::parse(jsonObj); - - const char *idKey = "id"; - - if(object.has_key(idKey)) - { - bourne::json value = object[idKey]; - - - - jsonToValue(&id, value, "long"); - - - } - - const char *nameKey = "name"; - - if(object.has_key(nameKey)) - { - bourne::json value = object[nameKey]; - - - - jsonToValue(&name, value, "std::string"); - - - } - - -} - -bourne::json -Category::toJson() -{ - bourne::json object = bourne::json::object(); - - - - - - object["id"] = getId(); - - - - - - - object["name"] = getName(); - - - - return object; - -} - -long -Category::getId() -{ - return id; -} - -void -Category::setId(long id) -{ - this->id = id; -} - -std::string -Category::getName() -{ - return name; -} - -void -Category::setName(std::string name) -{ - this->name = name; -} - - - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Category.h b/samples/client/petstore/tiny/cpp/lib/Models/Category.h deleted file mode 100644 index 9c90e3dd416..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Category.h +++ /dev/null @@ -1,70 +0,0 @@ - -/* - * Category.h - * - * A category for a pet - */ - -#ifndef TINY_CPP_CLIENT_Category_H_ -#define TINY_CPP_CLIENT_Category_H_ - - -#include -#include "bourne/json.hpp" -#include "Helpers.h" - -namespace Tiny { - - -/*! \brief A category for a pet - * - * \ingroup Models - * - */ - -class Category{ -public: - - /*! \brief Constructor. - */ - Category(); - Category(std::string jsonString); - - - /*! \brief Destructor. - */ - virtual ~Category(); - - - /*! \brief Retrieve a bourne JSON representation of this class. - */ - bourne::json toJson(); - - - /*! \brief Fills in members of this class from bourne JSON object representing it. - */ - void fromJson(std::string jsonObj); - - /*! \brief Get - */ - long getId(); - - /*! \brief Set - */ - void setId(long id); - /*! \brief Get - */ - std::string getName(); - - /*! \brief Set - */ - void setName(std::string name); - - - private: - long id{}; - std::string name{}; -}; -} - -#endif /* TINY_CPP_CLIENT_Category_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Helpers.cpp b/samples/client/petstore/tiny/cpp/lib/Models/Helpers.cpp deleted file mode 100644 index c3935b37cde..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Helpers.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "Helpers.h" -#include -#include - -bool isprimitive(std::string type){ - if(type == "std::string" || - type == "int" || - type == "float" || - type == "long" || - type == "double" || - type == "bool" || - type == "std::map" || - type == "std::list") - { - return true; - } - return false; -} - - -void -jsonToValue(void* target, bourne::json value, std::string type) -{ - if (target == NULL || value.is_null()) { - return; - } - - else if (type.compare("bool") == 0) - { - bool* val = static_cast (target); - *val = value.to_bool(); - } - - else if (type.compare("int") == 0) - { - int* val = static_cast (target); - *val = value.to_int(); - } - - else if (type.compare("float") == 0) - { - float* val = static_cast (target); - *val = (float)(value.to_float()); - } - - else if (type.compare("long") == 0) - { - long* val = static_cast (target); - *val = (long)(value.to_int()); - } - - else if (type.compare("double") == 0) - { - double* val = static_cast (target); - *val = value.to_float(); - } - - else if (type.compare("std::string") == 0) - { - std::string* val = static_cast (target); - *val = value.to_string(); - } - else { - return; - } -} - -std::string -stringify(long input){ - std::stringstream stream; - stream << input; - return stream.str(); - -}; - -std::string -stringify(int input){ - std::stringstream stream; - stream << input; - return stream.str(); -}; - -std::string -stringify(double input){ - std::stringstream stream; - stream << input; - return stream.str(); -}; - -std::string -stringify(float input){ - std::stringstream stream; - stream << input; - return stream.str(); -}; - -std::string -stringify(std::string input){ - std::stringstream stream; - stream << input; - return stream.str(); -}; diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Helpers.h b/samples/client/petstore/tiny/cpp/lib/Models/Helpers.h deleted file mode 100644 index 5ef7d9afdf7..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Helpers.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef TINY_CPP_CLIENT_HELPERS_H_ -#define TINY_CPP_CLIENT_HELPERS_H_ - -#include -#include "bourne/json.hpp" - -bool isprimitive(std::string type); - -void jsonToValue(void* target, bourne::json value, std::string type); - -std::string stringify(long input); - -std::string stringify(int input); - -std::string stringify(double input); - -std::string stringify(float input); - -std::string stringify(std::string input); - -#endif /* TINY_CPP_CLIENT_HELPERS_H_ */ - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Order.cpp b/samples/client/petstore/tiny/cpp/lib/Models/Order.cpp deleted file mode 100644 index b8b7e00d3fc..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Order.cpp +++ /dev/null @@ -1,238 +0,0 @@ - - -#include "Order.h" - -using namespace Tiny; - -Order::Order() -{ - id = long(0); - petId = long(0); - quantity = int(0); - shipDate = std::string(); - status = std::string(); - complete = bool(false); -} - -Order::Order(std::string jsonString) -{ - this->fromJson(jsonString); -} - -Order::~Order() -{ - -} - -void -Order::fromJson(std::string jsonObj) -{ - bourne::json object = bourne::json::parse(jsonObj); - - const char *idKey = "id"; - - if(object.has_key(idKey)) - { - bourne::json value = object[idKey]; - - - - jsonToValue(&id, value, "long"); - - - } - - const char *petIdKey = "petId"; - - if(object.has_key(petIdKey)) - { - bourne::json value = object[petIdKey]; - - - - jsonToValue(&petId, value, "long"); - - - } - - const char *quantityKey = "quantity"; - - if(object.has_key(quantityKey)) - { - bourne::json value = object[quantityKey]; - - - - jsonToValue(&quantity, value, "int"); - - - } - - const char *shipDateKey = "shipDate"; - - if(object.has_key(shipDateKey)) - { - bourne::json value = object[shipDateKey]; - - - - jsonToValue(&shipDate, value, "std::string"); - - - } - - const char *statusKey = "status"; - - if(object.has_key(statusKey)) - { - bourne::json value = object[statusKey]; - - - - jsonToValue(&status, value, "std::string"); - - - } - - const char *completeKey = "complete"; - - if(object.has_key(completeKey)) - { - bourne::json value = object[completeKey]; - - - - jsonToValue(&complete, value, "bool"); - - - } - - -} - -bourne::json -Order::toJson() -{ - bourne::json object = bourne::json::object(); - - - - - - object["id"] = getId(); - - - - - - - object["petId"] = getPetId(); - - - - - - - object["quantity"] = getQuantity(); - - - - - - - object["shipDate"] = getShipDate(); - - - - - - - object["status"] = getStatus(); - - - - - - - object["complete"] = isComplete(); - - - - return object; - -} - -long -Order::getId() -{ - return id; -} - -void -Order::setId(long id) -{ - this->id = id; -} - -long -Order::getPetId() -{ - return petId; -} - -void -Order::setPetId(long petId) -{ - this->petId = petId; -} - -int -Order::getQuantity() -{ - return quantity; -} - -void -Order::setQuantity(int quantity) -{ - this->quantity = quantity; -} - -std::string -Order::getShipDate() -{ - return shipDate; -} - -void -Order::setShipDate(std::string shipDate) -{ - this->shipDate = shipDate; -} - -std::string -Order::getStatus() -{ - return status; -} - -void -Order::setStatus(std::string status) -{ - this->status = status; -} - -bool -Order::isComplete() -{ - return complete; -} - -void -Order::setComplete(bool complete) -{ - this->complete = complete; -} - - - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Order.h b/samples/client/petstore/tiny/cpp/lib/Models/Order.h deleted file mode 100644 index 6f36404f959..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Order.h +++ /dev/null @@ -1,102 +0,0 @@ - -/* - * Order.h - * - * An order for a pets from the pet store - */ - -#ifndef TINY_CPP_CLIENT_Order_H_ -#define TINY_CPP_CLIENT_Order_H_ - - -#include -#include "bourne/json.hpp" -#include "Helpers.h" - -namespace Tiny { - - -/*! \brief An order for a pets from the pet store - * - * \ingroup Models - * - */ - -class Order{ -public: - - /*! \brief Constructor. - */ - Order(); - Order(std::string jsonString); - - - /*! \brief Destructor. - */ - virtual ~Order(); - - - /*! \brief Retrieve a bourne JSON representation of this class. - */ - bourne::json toJson(); - - - /*! \brief Fills in members of this class from bourne JSON object representing it. - */ - void fromJson(std::string jsonObj); - - /*! \brief Get - */ - long getId(); - - /*! \brief Set - */ - void setId(long id); - /*! \brief Get - */ - long getPetId(); - - /*! \brief Set - */ - void setPetId(long petId); - /*! \brief Get - */ - int getQuantity(); - - /*! \brief Set - */ - void setQuantity(int quantity); - /*! \brief Get - */ - std::string getShipDate(); - - /*! \brief Set - */ - void setShipDate(std::string shipDate); - /*! \brief Get Order Status - */ - std::string getStatus(); - - /*! \brief Set Order Status - */ - void setStatus(std::string status); - /*! \brief Get - */ - bool isComplete(); - - /*! \brief Set - */ - void setComplete(bool complete); - - - private: - long id{}; - long petId{}; - int quantity{}; - std::string shipDate{}; - std::string status{}; - bool complete{}; -}; -} - -#endif /* TINY_CPP_CLIENT_Order_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Pet.cpp b/samples/client/petstore/tiny/cpp/lib/Models/Pet.cpp deleted file mode 100644 index 57f7781aef2..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Pet.cpp +++ /dev/null @@ -1,274 +0,0 @@ - - -#include "Pet.h" - -using namespace Tiny; - -Pet::Pet() -{ - id = long(0); - category = Category(); - name = std::string(); - photoUrls = std::list(); - tags = std::list(); - status = std::string(); -} - -Pet::Pet(std::string jsonString) -{ - this->fromJson(jsonString); -} - -Pet::~Pet() -{ - -} - -void -Pet::fromJson(std::string jsonObj) -{ - bourne::json object = bourne::json::parse(jsonObj); - - const char *idKey = "id"; - - if(object.has_key(idKey)) - { - bourne::json value = object[idKey]; - - - - jsonToValue(&id, value, "long"); - - - } - - const char *categoryKey = "category"; - - if(object.has_key(categoryKey)) - { - bourne::json value = object[categoryKey]; - - - - - Category* obj = &category; - obj->fromJson(value.dump()); - - } - - const char *nameKey = "name"; - - if(object.has_key(nameKey)) - { - bourne::json value = object[nameKey]; - - - - jsonToValue(&name, value, "std::string"); - - - } - - const char *photoUrlsKey = "photoUrls"; - - if(object.has_key(photoUrlsKey)) - { - bourne::json value = object[photoUrlsKey]; - - - std::list photoUrls_list; - std::string element; - for(auto& var : value.array_range()) - { - - jsonToValue(&element, var, "std::string"); - - - photoUrls_list.push_back(element); - } - photoUrls = photoUrls_list; - - - } - - const char *tagsKey = "tags"; - - if(object.has_key(tagsKey)) - { - bourne::json value = object[tagsKey]; - - - std::list tags_list; - Tag element; - for(auto& var : value.array_range()) - { - - - element.fromJson(var.dump()); - - tags_list.push_back(element); - } - tags = tags_list; - - - } - - const char *statusKey = "status"; - - if(object.has_key(statusKey)) - { - bourne::json value = object[statusKey]; - - - - jsonToValue(&status, value, "std::string"); - - - } - - -} - -bourne::json -Pet::toJson() -{ - bourne::json object = bourne::json::object(); - - - - - - object["id"] = getId(); - - - - - - - - object["category"] = getCategory().toJson(); - - - - - - object["name"] = getName(); - - - - - - std::list photoUrls_list = getPhotoUrls(); - bourne::json photoUrls_arr = bourne::json::array(); - - for(auto& var : photoUrls_list) - { - photoUrls_arr.append(var); - } - object["photoUrls"] = photoUrls_arr; - - - - - - - - - std::list tags_list = getTags(); - bourne::json tags_arr = bourne::json::array(); - - for(auto& var : tags_list) - { - Tag obj = var; - tags_arr.append(obj.toJson()); - } - object["tags"] = tags_arr; - - - - - - - - object["status"] = getStatus(); - - - - return object; - -} - -long -Pet::getId() -{ - return id; -} - -void -Pet::setId(long id) -{ - this->id = id; -} - -Category -Pet::getCategory() -{ - return category; -} - -void -Pet::setCategory(Category category) -{ - this->category = category; -} - -std::string -Pet::getName() -{ - return name; -} - -void -Pet::setName(std::string name) -{ - this->name = name; -} - -std::list -Pet::getPhotoUrls() -{ - return photoUrls; -} - -void -Pet::setPhotoUrls(std::list photoUrls) -{ - this->photoUrls = photoUrls; -} - -std::list -Pet::getTags() -{ - return tags; -} - -void -Pet::setTags(std::list tags) -{ - this->tags = tags; -} - -std::string -Pet::getStatus() -{ - return status; -} - -void -Pet::setStatus(std::string status) -{ - this->status = status; -} - - - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Pet.h b/samples/client/petstore/tiny/cpp/lib/Models/Pet.h deleted file mode 100644 index 3329735f8a1..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Pet.h +++ /dev/null @@ -1,105 +0,0 @@ - -/* - * Pet.h - * - * A pet for sale in the pet store - */ - -#ifndef TINY_CPP_CLIENT_Pet_H_ -#define TINY_CPP_CLIENT_Pet_H_ - - -#include -#include "bourne/json.hpp" -#include "Helpers.h" -#include "Category.h" -#include "Tag.h" -#include - -namespace Tiny { - - -/*! \brief A pet for sale in the pet store - * - * \ingroup Models - * - */ - -class Pet{ -public: - - /*! \brief Constructor. - */ - Pet(); - Pet(std::string jsonString); - - - /*! \brief Destructor. - */ - virtual ~Pet(); - - - /*! \brief Retrieve a bourne JSON representation of this class. - */ - bourne::json toJson(); - - - /*! \brief Fills in members of this class from bourne JSON object representing it. - */ - void fromJson(std::string jsonObj); - - /*! \brief Get - */ - long getId(); - - /*! \brief Set - */ - void setId(long id); - /*! \brief Get - */ - Category getCategory(); - - /*! \brief Set - */ - void setCategory(Category category); - /*! \brief Get - */ - std::string getName(); - - /*! \brief Set - */ - void setName(std::string name); - /*! \brief Get - */ - std::list getPhotoUrls(); - - /*! \brief Set - */ - void setPhotoUrls(std::list photoUrls); - /*! \brief Get - */ - std::list getTags(); - - /*! \brief Set - */ - void setTags(std::list tags); - /*! \brief Get pet status in the store - */ - std::string getStatus(); - - /*! \brief Set pet status in the store - */ - void setStatus(std::string status); - - - private: - long id{}; - Category category; - std::string name{}; - std::list photoUrls; - std::list tags; - std::string status{}; -}; -} - -#endif /* TINY_CPP_CLIENT_Pet_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Tag.cpp b/samples/client/petstore/tiny/cpp/lib/Models/Tag.cpp deleted file mode 100644 index e46d94258a1..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Tag.cpp +++ /dev/null @@ -1,106 +0,0 @@ - - -#include "Tag.h" - -using namespace Tiny; - -Tag::Tag() -{ - id = long(0); - name = std::string(); -} - -Tag::Tag(std::string jsonString) -{ - this->fromJson(jsonString); -} - -Tag::~Tag() -{ - -} - -void -Tag::fromJson(std::string jsonObj) -{ - bourne::json object = bourne::json::parse(jsonObj); - - const char *idKey = "id"; - - if(object.has_key(idKey)) - { - bourne::json value = object[idKey]; - - - - jsonToValue(&id, value, "long"); - - - } - - const char *nameKey = "name"; - - if(object.has_key(nameKey)) - { - bourne::json value = object[nameKey]; - - - - jsonToValue(&name, value, "std::string"); - - - } - - -} - -bourne::json -Tag::toJson() -{ - bourne::json object = bourne::json::object(); - - - - - - object["id"] = getId(); - - - - - - - object["name"] = getName(); - - - - return object; - -} - -long -Tag::getId() -{ - return id; -} - -void -Tag::setId(long id) -{ - this->id = id; -} - -std::string -Tag::getName() -{ - return name; -} - -void -Tag::setName(std::string name) -{ - this->name = name; -} - - - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/Tag.h b/samples/client/petstore/tiny/cpp/lib/Models/Tag.h deleted file mode 100644 index e05bcdc9290..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/Tag.h +++ /dev/null @@ -1,70 +0,0 @@ - -/* - * Tag.h - * - * A tag for a pet - */ - -#ifndef TINY_CPP_CLIENT_Tag_H_ -#define TINY_CPP_CLIENT_Tag_H_ - - -#include -#include "bourne/json.hpp" -#include "Helpers.h" - -namespace Tiny { - - -/*! \brief A tag for a pet - * - * \ingroup Models - * - */ - -class Tag{ -public: - - /*! \brief Constructor. - */ - Tag(); - Tag(std::string jsonString); - - - /*! \brief Destructor. - */ - virtual ~Tag(); - - - /*! \brief Retrieve a bourne JSON representation of this class. - */ - bourne::json toJson(); - - - /*! \brief Fills in members of this class from bourne JSON object representing it. - */ - void fromJson(std::string jsonObj); - - /*! \brief Get - */ - long getId(); - - /*! \brief Set - */ - void setId(long id); - /*! \brief Get - */ - std::string getName(); - - /*! \brief Set - */ - void setName(std::string name); - - - private: - long id{}; - std::string name{}; -}; -} - -#endif /* TINY_CPP_CLIENT_Tag_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/Models/User.cpp b/samples/client/petstore/tiny/cpp/lib/Models/User.cpp deleted file mode 100644 index ac84c40205a..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/User.cpp +++ /dev/null @@ -1,304 +0,0 @@ - - -#include "User.h" - -using namespace Tiny; - -User::User() -{ - id = long(0); - username = std::string(); - firstName = std::string(); - lastName = std::string(); - email = std::string(); - password = std::string(); - phone = std::string(); - userStatus = int(0); -} - -User::User(std::string jsonString) -{ - this->fromJson(jsonString); -} - -User::~User() -{ - -} - -void -User::fromJson(std::string jsonObj) -{ - bourne::json object = bourne::json::parse(jsonObj); - - const char *idKey = "id"; - - if(object.has_key(idKey)) - { - bourne::json value = object[idKey]; - - - - jsonToValue(&id, value, "long"); - - - } - - const char *usernameKey = "username"; - - if(object.has_key(usernameKey)) - { - bourne::json value = object[usernameKey]; - - - - jsonToValue(&username, value, "std::string"); - - - } - - const char *firstNameKey = "firstName"; - - if(object.has_key(firstNameKey)) - { - bourne::json value = object[firstNameKey]; - - - - jsonToValue(&firstName, value, "std::string"); - - - } - - const char *lastNameKey = "lastName"; - - if(object.has_key(lastNameKey)) - { - bourne::json value = object[lastNameKey]; - - - - jsonToValue(&lastName, value, "std::string"); - - - } - - const char *emailKey = "email"; - - if(object.has_key(emailKey)) - { - bourne::json value = object[emailKey]; - - - - jsonToValue(&email, value, "std::string"); - - - } - - const char *passwordKey = "password"; - - if(object.has_key(passwordKey)) - { - bourne::json value = object[passwordKey]; - - - - jsonToValue(&password, value, "std::string"); - - - } - - const char *phoneKey = "phone"; - - if(object.has_key(phoneKey)) - { - bourne::json value = object[phoneKey]; - - - - jsonToValue(&phone, value, "std::string"); - - - } - - const char *userStatusKey = "userStatus"; - - if(object.has_key(userStatusKey)) - { - bourne::json value = object[userStatusKey]; - - - - jsonToValue(&userStatus, value, "int"); - - - } - - -} - -bourne::json -User::toJson() -{ - bourne::json object = bourne::json::object(); - - - - - - object["id"] = getId(); - - - - - - - object["username"] = getUsername(); - - - - - - - object["firstName"] = getFirstName(); - - - - - - - object["lastName"] = getLastName(); - - - - - - - object["email"] = getEmail(); - - - - - - - object["password"] = getPassword(); - - - - - - - object["phone"] = getPhone(); - - - - - - - object["userStatus"] = getUserStatus(); - - - - return object; - -} - -long -User::getId() -{ - return id; -} - -void -User::setId(long id) -{ - this->id = id; -} - -std::string -User::getUsername() -{ - return username; -} - -void -User::setUsername(std::string username) -{ - this->username = username; -} - -std::string -User::getFirstName() -{ - return firstName; -} - -void -User::setFirstName(std::string firstName) -{ - this->firstName = firstName; -} - -std::string -User::getLastName() -{ - return lastName; -} - -void -User::setLastName(std::string lastName) -{ - this->lastName = lastName; -} - -std::string -User::getEmail() -{ - return email; -} - -void -User::setEmail(std::string email) -{ - this->email = email; -} - -std::string -User::getPassword() -{ - return password; -} - -void -User::setPassword(std::string password) -{ - this->password = password; -} - -std::string -User::getPhone() -{ - return phone; -} - -void -User::setPhone(std::string phone) -{ - this->phone = phone; -} - -int -User::getUserStatus() -{ - return userStatus; -} - -void -User::setUserStatus(int userStatus) -{ - this->userStatus = userStatus; -} - - - diff --git a/samples/client/petstore/tiny/cpp/lib/Models/User.h b/samples/client/petstore/tiny/cpp/lib/Models/User.h deleted file mode 100644 index 84de5204ced..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/Models/User.h +++ /dev/null @@ -1,118 +0,0 @@ - -/* - * User.h - * - * A User who is purchasing from the pet store - */ - -#ifndef TINY_CPP_CLIENT_User_H_ -#define TINY_CPP_CLIENT_User_H_ - - -#include -#include "bourne/json.hpp" -#include "Helpers.h" - -namespace Tiny { - - -/*! \brief A User who is purchasing from the pet store - * - * \ingroup Models - * - */ - -class User{ -public: - - /*! \brief Constructor. - */ - User(); - User(std::string jsonString); - - - /*! \brief Destructor. - */ - virtual ~User(); - - - /*! \brief Retrieve a bourne JSON representation of this class. - */ - bourne::json toJson(); - - - /*! \brief Fills in members of this class from bourne JSON object representing it. - */ - void fromJson(std::string jsonObj); - - /*! \brief Get - */ - long getId(); - - /*! \brief Set - */ - void setId(long id); - /*! \brief Get - */ - std::string getUsername(); - - /*! \brief Set - */ - void setUsername(std::string username); - /*! \brief Get - */ - std::string getFirstName(); - - /*! \brief Set - */ - void setFirstName(std::string firstName); - /*! \brief Get - */ - std::string getLastName(); - - /*! \brief Set - */ - void setLastName(std::string lastName); - /*! \brief Get - */ - std::string getEmail(); - - /*! \brief Set - */ - void setEmail(std::string email); - /*! \brief Get - */ - std::string getPassword(); - - /*! \brief Set - */ - void setPassword(std::string password); - /*! \brief Get - */ - std::string getPhone(); - - /*! \brief Set - */ - void setPhone(std::string phone); - /*! \brief Get User Status - */ - int getUserStatus(); - - /*! \brief Set User Status - */ - void setUserStatus(int userStatus); - - - private: - long id{}; - std::string username{}; - std::string firstName{}; - std::string lastName{}; - std::string email{}; - std::string password{}; - std::string phone{}; - int userStatus{}; -}; -} - -#endif /* TINY_CPP_CLIENT_User_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/TestFiles/ApiResponseTest.cpp b/samples/client/petstore/tiny/cpp/lib/TestFiles/ApiResponseTest.cpp deleted file mode 100644 index 160f4217f5d..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/TestFiles/ApiResponseTest.cpp +++ /dev/null @@ -1,139 +0,0 @@ - -#include "ApiResponse.h" - -using namespace Tiny; - -#include -#include -#include -#include "bourne/json.hpp" - - - -void test_ApiResponse_code_is_assigned_from_json() -{ - bourne::json input = - { - "code", 1 - }; - - ApiResponse obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getCode()); - - - - - - - - -} - - -void test_ApiResponse_type_is_assigned_from_json() -{ - - - bourne::json input = - { - "type", "hello" - }; - - ApiResponse obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getType().c_str()); - - - - - - -} - - -void test_ApiResponse_message_is_assigned_from_json() -{ - - - bourne::json input = - { - "message", "hello" - }; - - ApiResponse obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getMessage().c_str()); - - - - - - -} - - - -void test_ApiResponse_code_is_converted_to_json() -{ - bourne::json input = - { - "code", 1 - }; - - ApiResponse obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["code"] == output["code"]); - - - - -} - - -void test_ApiResponse_type_is_converted_to_json() -{ - - bourne::json input = - { - "type", "hello" - }; - - ApiResponse obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["type"] == output["type"]); - - - -} - - -void test_ApiResponse_message_is_converted_to_json() -{ - - bourne::json input = - { - "message", "hello" - }; - - ApiResponse obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["message"] == output["message"]); - - - -} - - diff --git a/samples/client/petstore/tiny/cpp/lib/TestFiles/CategoryTest.cpp b/samples/client/petstore/tiny/cpp/lib/TestFiles/CategoryTest.cpp deleted file mode 100644 index 2951856e6a5..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/TestFiles/CategoryTest.cpp +++ /dev/null @@ -1,97 +0,0 @@ - -#include "Category.h" - -using namespace Tiny; - -#include -#include -#include -#include "bourne/json.hpp" - - - -void test_Category_id_is_assigned_from_json() -{ - - - - - - - bourne::json input = - { - "id", 1 - }; - - Category obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getId()); - - -} - - -void test_Category_name_is_assigned_from_json() -{ - - - bourne::json input = - { - "name", "hello" - }; - - Category obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getName().c_str()); - - - - - - -} - - - -void test_Category_id_is_converted_to_json() -{ - - - - bourne::json input = - { - "id", 1 - }; - - Category obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["id"] == output["id"]); - -} - - -void test_Category_name_is_converted_to_json() -{ - - bourne::json input = - { - "name", "hello" - }; - - Category obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["name"] == output["name"]); - - - -} - - diff --git a/samples/client/petstore/tiny/cpp/lib/TestFiles/OrderTest.cpp b/samples/client/petstore/tiny/cpp/lib/TestFiles/OrderTest.cpp deleted file mode 100644 index 13125fc8fc5..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/TestFiles/OrderTest.cpp +++ /dev/null @@ -1,245 +0,0 @@ - -#include "Order.h" - -using namespace Tiny; - -#include -#include -#include -#include "bourne/json.hpp" - - - -void test_Order_id_is_assigned_from_json() -{ - - - - - - - bourne::json input = - { - "id", 1 - }; - - Order obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getId()); - - -} - - -void test_Order_petId_is_assigned_from_json() -{ - - - - - - - bourne::json input = - { - "petId", 1 - }; - - Order obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getPetId()); - - -} - - -void test_Order_quantity_is_assigned_from_json() -{ - bourne::json input = - { - "quantity", 1 - }; - - Order obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getQuantity()); - - - - - - - - -} - - -void test_Order_shipDate_is_assigned_from_json() -{ - - - - - - - - -} - - -void test_Order_status_is_assigned_from_json() -{ - - - bourne::json input = - { - "status", "hello" - }; - - Order obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getStatus().c_str()); - - - - - - -} - - -void test_Order_complete_is_assigned_from_json() -{ - - - - - bourne::json input = - { - "complete", true - }; - - Order obj(input.dump()); - - TEST_ASSERT(true == obj.isComplete()); - - - - -} - - - -void test_Order_id_is_converted_to_json() -{ - - - - bourne::json input = - { - "id", 1 - }; - - Order obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["id"] == output["id"]); - -} - - -void test_Order_petId_is_converted_to_json() -{ - - - - bourne::json input = - { - "petId", 1 - }; - - Order obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["petId"] == output["petId"]); - -} - - -void test_Order_quantity_is_converted_to_json() -{ - bourne::json input = - { - "quantity", 1 - }; - - Order obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["quantity"] == output["quantity"]); - - - - -} - - -void test_Order_shipDate_is_converted_to_json() -{ - - - - -} - - -void test_Order_status_is_converted_to_json() -{ - - bourne::json input = - { - "status", "hello" - }; - - Order obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["status"] == output["status"]); - - - -} - - -void test_Order_complete_is_converted_to_json() -{ - - - bourne::json input = - { - "complete", true - }; - - Order obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["complete"] == output["complete"]); - - -} - - diff --git a/samples/client/petstore/tiny/cpp/lib/TestFiles/PetTest.cpp b/samples/client/petstore/tiny/cpp/lib/TestFiles/PetTest.cpp deleted file mode 100644 index 04dad464093..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/TestFiles/PetTest.cpp +++ /dev/null @@ -1,145 +0,0 @@ - -#include "Pet.h" - -using namespace Tiny; - -#include -#include -#include -#include "bourne/json.hpp" - - - -void test_Pet_id_is_assigned_from_json() -{ - - - - - - - bourne::json input = - { - "id", 1 - }; - - Pet obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getId()); - - -} - - - -void test_Pet_name_is_assigned_from_json() -{ - - - bourne::json input = - { - "name", "hello" - }; - - Pet obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getName().c_str()); - - - - - - -} - - - - -void test_Pet_status_is_assigned_from_json() -{ - - - bourne::json input = - { - "status", "hello" - }; - - Pet obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getStatus().c_str()); - - - - - - -} - - - -void test_Pet_id_is_converted_to_json() -{ - - - - bourne::json input = - { - "id", 1 - }; - - Pet obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["id"] == output["id"]); - -} - - - -void test_Pet_name_is_converted_to_json() -{ - - bourne::json input = - { - "name", "hello" - }; - - Pet obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["name"] == output["name"]); - - - -} - - - - -void test_Pet_status_is_converted_to_json() -{ - - bourne::json input = - { - "status", "hello" - }; - - Pet obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["status"] == output["status"]); - - - -} - - diff --git a/samples/client/petstore/tiny/cpp/lib/TestFiles/TagTest.cpp b/samples/client/petstore/tiny/cpp/lib/TestFiles/TagTest.cpp deleted file mode 100644 index 41ea1d0095d..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/TestFiles/TagTest.cpp +++ /dev/null @@ -1,97 +0,0 @@ - -#include "Tag.h" - -using namespace Tiny; - -#include -#include -#include -#include "bourne/json.hpp" - - - -void test_Tag_id_is_assigned_from_json() -{ - - - - - - - bourne::json input = - { - "id", 1 - }; - - Tag obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getId()); - - -} - - -void test_Tag_name_is_assigned_from_json() -{ - - - bourne::json input = - { - "name", "hello" - }; - - Tag obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getName().c_str()); - - - - - - -} - - - -void test_Tag_id_is_converted_to_json() -{ - - - - bourne::json input = - { - "id", 1 - }; - - Tag obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["id"] == output["id"]); - -} - - -void test_Tag_name_is_converted_to_json() -{ - - bourne::json input = - { - "name", "hello" - }; - - Tag obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["name"] == output["name"]); - - - -} - - diff --git a/samples/client/petstore/tiny/cpp/lib/TestFiles/UserTest.cpp b/samples/client/petstore/tiny/cpp/lib/TestFiles/UserTest.cpp deleted file mode 100644 index 689ee582bee..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/TestFiles/UserTest.cpp +++ /dev/null @@ -1,349 +0,0 @@ - -#include "User.h" - -using namespace Tiny; - -#include -#include -#include -#include "bourne/json.hpp" - - - -void test_User_id_is_assigned_from_json() -{ - - - - - - - bourne::json input = - { - "id", 1 - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getId()); - - -} - - -void test_User_username_is_assigned_from_json() -{ - - - bourne::json input = - { - "username", "hello" - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getUsername().c_str()); - - - - - - -} - - -void test_User_firstName_is_assigned_from_json() -{ - - - bourne::json input = - { - "firstName", "hello" - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getFirstName().c_str()); - - - - - - -} - - -void test_User_lastName_is_assigned_from_json() -{ - - - bourne::json input = - { - "lastName", "hello" - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getLastName().c_str()); - - - - - - -} - - -void test_User_email_is_assigned_from_json() -{ - - - bourne::json input = - { - "email", "hello" - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getEmail().c_str()); - - - - - - -} - - -void test_User_password_is_assigned_from_json() -{ - - - bourne::json input = - { - "password", "hello" - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getPassword().c_str()); - - - - - - -} - - -void test_User_phone_is_assigned_from_json() -{ - - - bourne::json input = - { - "phone", "hello" - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_STRING("hello", obj.getPhone().c_str()); - - - - - - -} - - -void test_User_userStatus_is_assigned_from_json() -{ - bourne::json input = - { - "userStatus", 1 - }; - - User obj(input.dump()); - - TEST_ASSERT_EQUAL_INT(1, obj.getUserStatus()); - - - - - - - - -} - - - -void test_User_id_is_converted_to_json() -{ - - - - bourne::json input = - { - "id", 1 - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["id"] == output["id"]); - -} - - -void test_User_username_is_converted_to_json() -{ - - bourne::json input = - { - "username", "hello" - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["username"] == output["username"]); - - - -} - - -void test_User_firstName_is_converted_to_json() -{ - - bourne::json input = - { - "firstName", "hello" - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["firstName"] == output["firstName"]); - - - -} - - -void test_User_lastName_is_converted_to_json() -{ - - bourne::json input = - { - "lastName", "hello" - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["lastName"] == output["lastName"]); - - - -} - - -void test_User_email_is_converted_to_json() -{ - - bourne::json input = - { - "email", "hello" - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["email"] == output["email"]); - - - -} - - -void test_User_password_is_converted_to_json() -{ - - bourne::json input = - { - "password", "hello" - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["password"] == output["password"]); - - - -} - - -void test_User_phone_is_converted_to_json() -{ - - bourne::json input = - { - "phone", "hello" - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["phone"] == output["phone"]); - - - -} - - -void test_User_userStatus_is_converted_to_json() -{ - bourne::json input = - { - "userStatus", 1 - }; - - User obj(input.dump()); - - bourne::json output = bourne::json::object(); - - output = obj.toJson(); - - TEST_ASSERT(input["userStatus"] == output["userStatus"]); - - - - -} - - diff --git a/samples/client/petstore/tiny/cpp/lib/service/AbstractService.cpp b/samples/client/petstore/tiny/cpp/lib/service/AbstractService.cpp deleted file mode 100644 index ac7e992cecc..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/AbstractService.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "AbstractService.h" -#include "Arduino.h" - - - -void Tiny::AbstractService::begin(std::string url){ - http.begin(String(url.c_str()), test_root_ca); //HTTPS connection -} diff --git a/samples/client/petstore/tiny/cpp/lib/service/AbstractService.h b/samples/client/petstore/tiny/cpp/lib/service/AbstractService.h deleted file mode 100644 index 07214896d7f..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/AbstractService.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ -#define TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ - -#include "HTTPClient.h" -#include "Response.h" -namespace Tiny { - -/** -* Class -* Generated with openapi::tiny-cpp-client -*/ -class AbstractService { -public: -HTTPClient http; -std::string basepath = "https://petstore3.swagger.io/api/v3"; // TODO: change to your url - -void begin(std::string url); - -// Go and comment out a certificate in root.cert, if you get an error here -// Certificate from file -const char* test_root_ca = -#include "../../root.cert" -; - -}; // end class -}// namespace Tinyclient - -#endif /* TINY_CPP_CLIENT_ABSTRACTSERVICE_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/service/PetApi.cpp b/samples/client/petstore/tiny/cpp/lib/service/PetApi.cpp deleted file mode 100644 index 1fa081a04b4..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/PetApi.cpp +++ /dev/null @@ -1,418 +0,0 @@ -#include "PetApi.h" - -using namespace Tiny; - - - - Response< - Pet - > - PetApi:: - addPet( - - Pet pet - - ) - { - std::string url = basepath + "/pet"; // - // Query | - // Headers | - // Form | - // Body | pet - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | POST - http.addHeader("Content-Type", "application/json"); - - - - payload = pet.toJson().dump(); - - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - - Pet obj(output_string); - - - Response response(obj, httpCode); - return response; - } - - Response< - String - > - PetApi:: - deletePet( - - long petId - , - - std::string apiKey - - ) - { - std::string url = basepath + "/pet/{petId}"; //petId - // Query | - // Headers | apiKey - // Form | - // Body | - - std::string s_petId("{"); - s_petId.append("petId"); - s_petId.append("}"); - - int pos = url.find(s_petId); - - url.erase(pos, s_petId.length()); - url.insert(pos, stringify(petId)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | DELETE - int httpCode = http.sendRequest("DELETE", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - std::list - > - PetApi:: - findPetsByStatus( - std::list status - - - ) - { - std::string url = basepath + "/pet/findByStatus"; // - // Query | status - // Headers | - // Form | - // Body | - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - std::list obj = std::list(); - bourne::json jsonPayload(output_string); - - - - - - - - - - for(auto& var : jsonPayload.array_range()) - { - Pet tmp(var.dump()); - obj.push_back(tmp); - } - - - - - - - - - Response> response(obj, httpCode); - return response; - } - - Response< - std::list - > - PetApi:: - findPetsByTags( - std::list tags - - - ) - { - std::string url = basepath + "/pet/findByTags"; // - // Query | tags - // Headers | - // Form | - // Body | - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - std::list obj = std::list(); - bourne::json jsonPayload(output_string); - - - - - - - - - - for(auto& var : jsonPayload.array_range()) - { - Pet tmp(var.dump()); - obj.push_back(tmp); - } - - - - - - - - - Response> response(obj, httpCode); - return response; - } - - Response< - Pet - > - PetApi:: - getPetById( - - long petId - - ) - { - std::string url = basepath + "/pet/{petId}"; //petId - // Query | - // Headers | - // Form | - // Body | - - std::string s_petId("{"); - s_petId.append("petId"); - s_petId.append("}"); - - int pos = url.find(s_petId); - - url.erase(pos, s_petId.length()); - url.insert(pos, stringify(petId)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - - Pet obj(output_string); - - - Response response(obj, httpCode); - return response; - } - - Response< - Pet - > - PetApi:: - updatePet( - - Pet pet - - ) - { - std::string url = basepath + "/pet"; // - // Query | - // Headers | - // Form | - // Body | pet - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | PUT - http.addHeader("Content-Type", "application/json"); - - - - payload = pet.toJson().dump(); - - int httpCode = http.sendRequest("PUT", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - - Pet obj(output_string); - - - Response response(obj, httpCode); - return response; - } - - Response< - String - > - PetApi:: - updatePetWithForm( - - long petId - , - - std::string name - , - - std::string status - - ) - { - std::string url = basepath + "/pet/{petId}"; //petId - // Query | - // Headers | - // Form | name status - // Body | - - std::string s_petId("{"); - s_petId.append("petId"); - s_petId.append("}"); - - int pos = url.find(s_petId); - - url.erase(pos, s_petId.length()); - url.insert(pos, stringify(petId)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | POST - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - ApiResponse - > - PetApi:: - uploadFile( - - long petId - , - - std::string additionalMetadata - , - - std::string file - - ) - { - std::string url = basepath + "/pet/{petId}/uploadImage"; //petId - // Query | - // Headers | - // Form | additionalMetadata file - // Body | - - std::string s_petId("{"); - s_petId.append("petId"); - s_petId.append("}"); - - int pos = url.find(s_petId); - - url.erase(pos, s_petId.length()); - url.insert(pos, stringify(petId)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | POST - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - - ApiResponse obj(output_string); - - - Response response(obj, httpCode); - return response; - } - - - - diff --git a/samples/client/petstore/tiny/cpp/lib/service/PetApi.h b/samples/client/petstore/tiny/cpp/lib/service/PetApi.h deleted file mode 100644 index abcb0af0de9..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/PetApi.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef TINY_CPP_CLIENT_PetApi_H_ -#define TINY_CPP_CLIENT_PetApi_H_ - - -#include "Response.h" -#include "Arduino.h" -#include "AbstractService.h" -#include "Helpers.h" -#include - -#include "ApiResponse.h" -#include "Pet.h" - -namespace Tiny { - -/** - * Class - * Generated with openapi::tiny-cpp-client - */ - -class PetApi : public AbstractService { -public: - PetApi() = default; - - virtual ~PetApi() = default; - - /** - * Add a new pet to the store. - * - * - * \param pet Pet object that needs to be added to the store *Required* - */ - Response< - Pet - > - addPet( - - Pet pet - - ); - /** - * Deletes a pet. - * - * - * \param petId Pet id to delete *Required* - * \param apiKey - */ - Response< - String - > - deletePet( - - long petId - , - - std::string apiKey - - ); - /** - * Finds Pets by status. - * - * Multiple status values can be provided with comma separated strings - * \param status Status values that need to be considered for filter *Required* - */ - Response< - std::list - > - findPetsByStatus( - std::list status - - - ); - /** - * Finds Pets by tags. - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * \param tags Tags to filter by *Required* - */ - Response< - std::list - > - findPetsByTags( - std::list tags - - - ); - /** - * Find pet by ID. - * - * Returns a single pet - * \param petId ID of pet to return *Required* - */ - Response< - Pet - > - getPetById( - - long petId - - ); - /** - * Update an existing pet. - * - * - * \param pet Pet object that needs to be added to the store *Required* - */ - Response< - Pet - > - updatePet( - - Pet pet - - ); - /** - * Updates a pet in the store with form data. - * - * - * \param petId ID of pet that needs to be updated *Required* - * \param name Updated name of the pet - * \param status Updated status of the pet - */ - Response< - String - > - updatePetWithForm( - - long petId - , - - std::string name - , - - std::string status - - ); - /** - * uploads an image. - * - * - * \param petId ID of pet to update *Required* - * \param additionalMetadata Additional data to pass to server - * \param file file to upload - */ - Response< - ApiResponse - > - uploadFile( - - long petId - , - - std::string additionalMetadata - , - - std::string file - - ); -}; - -} - -#endif /* TINY_CPP_CLIENT_PetApi_H_ */ \ No newline at end of file diff --git a/samples/client/petstore/tiny/cpp/lib/service/Response.h b/samples/client/petstore/tiny/cpp/lib/service/Response.h deleted file mode 100644 index 9b7b616b8f1..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/Response.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef TINY_CPP_CLIENT_RESPONSE_H_ -#define TINY_CPP_CLIENT_RESPONSE_H_ -#include - -namespace Tiny { - -/** -* Class -* Generated with openapi::tiny-cpp-client -*/ -template - class Response { - public: - - Response(T _obj, int _code){ - obj = _obj; - code = _code; - } - - int code; - T obj; - }; - } // namespace Tinyclient - -#endif /* TINY_CPP_CLIENT_RESPONSE_H_ */ diff --git a/samples/client/petstore/tiny/cpp/lib/service/StoreApi.cpp b/samples/client/petstore/tiny/cpp/lib/service/StoreApi.cpp deleted file mode 100644 index 210eb8277ac..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/StoreApi.cpp +++ /dev/null @@ -1,185 +0,0 @@ -#include "StoreApi.h" - -using namespace Tiny; - - - - Response< - String - > - StoreApi:: - deleteOrder( - - std::string orderId - - ) - { - std::string url = basepath + "/store/order/{orderId}"; //orderId - // Query | - // Headers | - // Form | - // Body | - - std::string s_orderId("{"); - s_orderId.append("orderId"); - s_orderId.append("}"); - - int pos = url.find(s_orderId); - - url.erase(pos, s_orderId.length()); - url.insert(pos, stringify(orderId)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | DELETE - int httpCode = http.sendRequest("DELETE", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - String - > - StoreApi:: - getInventory( - ) - { - std::string url = basepath + "/store/inventory"; // - // Query | - // Headers | - // Form | - // Body | - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - //TODO: Implement map logic here - - - - - //TODO: No support for maps. - Response response(output, httpCode); - return response; - } - - Response< - Order - > - StoreApi:: - getOrderById( - - long orderId - - ) - { - std::string url = basepath + "/store/order/{orderId}"; //orderId - // Query | - // Headers | - // Form | - // Body | - - std::string s_orderId("{"); - s_orderId.append("orderId"); - s_orderId.append("}"); - - int pos = url.find(s_orderId); - - url.erase(pos, s_orderId.length()); - url.insert(pos, stringify(orderId)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - - Order obj(output_string); - - - Response response(obj, httpCode); - return response; - } - - Response< - Order - > - StoreApi:: - placeOrder( - - Order order - - ) - { - std::string url = basepath + "/store/order"; // - // Query | - // Headers | - // Form | - // Body | order - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | POST - http.addHeader("Content-Type", "application/json"); - - - - payload = order.toJson().dump(); - - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - - Order obj(output_string); - - - Response response(obj, httpCode); - return response; - } - - - - diff --git a/samples/client/petstore/tiny/cpp/lib/service/StoreApi.h b/samples/client/petstore/tiny/cpp/lib/service/StoreApi.h deleted file mode 100644 index 3c347149c87..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/StoreApi.h +++ /dev/null @@ -1,83 +0,0 @@ -#ifndef TINY_CPP_CLIENT_StoreApi_H_ -#define TINY_CPP_CLIENT_StoreApi_H_ - - -#include "Response.h" -#include "Arduino.h" -#include "AbstractService.h" -#include "Helpers.h" -#include - -#include -#include "Order.h" - -namespace Tiny { - -/** - * Class - * Generated with openapi::tiny-cpp-client - */ - -class StoreApi : public AbstractService { -public: - StoreApi() = default; - - virtual ~StoreApi() = default; - - /** - * Delete purchase order by ID. - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * \param orderId ID of the order that needs to be deleted *Required* - */ - Response< - String - > - deleteOrder( - - std::string orderId - - ); - /** - * Returns pet inventories by status. - * - * Returns a map of status codes to quantities - */ - Response< - String - > - getInventory( - ); - /** - * Find purchase order by ID. - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * \param orderId ID of pet that needs to be fetched *Required* - */ - Response< - Order - > - getOrderById( - - long orderId - - ); - /** - * Place an order for a pet. - * - * - * \param order order placed for purchasing the pet *Required* - */ - Response< - Order - > - placeOrder( - - Order order - - ); -}; - -} - -#endif /* TINY_CPP_CLIENT_StoreApi_H_ */ \ No newline at end of file diff --git a/samples/client/petstore/tiny/cpp/lib/service/UserApi.cpp b/samples/client/petstore/tiny/cpp/lib/service/UserApi.cpp deleted file mode 100644 index d1cf12b80a9..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/UserApi.cpp +++ /dev/null @@ -1,366 +0,0 @@ -#include "UserApi.h" - -using namespace Tiny; - - - - Response< - String - > - UserApi:: - createUser( - - User user - - ) - { - std::string url = basepath + "/user"; // - // Query | - // Headers | - // Form | - // Body | user - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | POST - http.addHeader("Content-Type", "application/json"); - - - - payload = user.toJson().dump(); - - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - String - > - UserApi:: - createUsersWithArrayInput( - std::list user - - - ) - { - std::string url = basepath + "/user/createWithArray"; // - // Query | - // Headers | - // Form | - // Body | user - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | POST - http.addHeader("Content-Type", "application/json"); - - - bourne::json tmp_arr = bourne::json::array(); - for(auto& var : user) - { - auto tmp = var.toJson(); - tmp_arr.append(tmp); - - } - payload = tmp_arr.dump(); - - - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - String - > - UserApi:: - createUsersWithListInput( - std::list user - - - ) - { - std::string url = basepath + "/user/createWithList"; // - // Query | - // Headers | - // Form | - // Body | user - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | POST - http.addHeader("Content-Type", "application/json"); - - - bourne::json tmp_arr = bourne::json::array(); - for(auto& var : user) - { - auto tmp = var.toJson(); - tmp_arr.append(tmp); - - } - payload = tmp_arr.dump(); - - - int httpCode = http.sendRequest("POST", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - String - > - UserApi:: - deleteUser( - - std::string username - - ) - { - std::string url = basepath + "/user/{username}"; //username - // Query | - // Headers | - // Form | - // Body | - - std::string s_username("{"); - s_username.append("username"); - s_username.append("}"); - - int pos = url.find(s_username); - - url.erase(pos, s_username.length()); - url.insert(pos, stringify(username)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | DELETE - int httpCode = http.sendRequest("DELETE", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - User - > - UserApi:: - getUserByName( - - std::string username - - ) - { - std::string url = basepath + "/user/{username}"; //username - // Query | - // Headers | - // Form | - // Body | - - std::string s_username("{"); - s_username.append("username"); - s_username.append("}"); - - int pos = url.find(s_username); - - url.erase(pos, s_username.length()); - url.insert(pos, stringify(username)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - - User obj(output_string); - - - Response response(obj, httpCode); - return response; - } - - Response< - std::string - > - UserApi:: - loginUser( - - std::string username - , - - std::string password - - ) - { - std::string url = basepath + "/user/login"; // - // Query | username password - // Headers | - // Form | - // Body | - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - - bourne::json jsonPayload(output_string); - std::string obj; - jsonToValue(&obj, jsonPayload, "std::string"); - - - - Response response(obj, httpCode); - return response; - } - - Response< - String - > - UserApi:: - logoutUser( - ) - { - std::string url = basepath + "/user/logout"; // - // Query | - // Headers | - // Form | - // Body | - - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | GET - int httpCode = http.sendRequest("GET", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - Response< - String - > - UserApi:: - updateUser( - - std::string username - , - - User user - - ) - { - std::string url = basepath + "/user/{username}"; //username - // Query | - // Headers | - // Form | - // Body | user - - std::string s_username("{"); - s_username.append("username"); - s_username.append("}"); - - int pos = url.find(s_username); - - url.erase(pos, s_username.length()); - url.insert(pos, stringify(username)); - - begin(url); - - std::string payload = ""; - // Send Request - // METHOD | PUT - http.addHeader("Content-Type", "application/json"); - - - - payload = user.toJson().dump(); - - int httpCode = http.sendRequest("PUT", reinterpret_cast(&payload[0]), payload.length()); - - // Handle Request - String output = http.getString(); - std::string output_string = output.c_str(); - - http.end(); - - - Response response(output, httpCode); - return response; - } - - - - diff --git a/samples/client/petstore/tiny/cpp/lib/service/UserApi.h b/samples/client/petstore/tiny/cpp/lib/service/UserApi.h deleted file mode 100644 index afdaefa0f8c..00000000000 --- a/samples/client/petstore/tiny/cpp/lib/service/UserApi.h +++ /dev/null @@ -1,147 +0,0 @@ -#ifndef TINY_CPP_CLIENT_UserApi_H_ -#define TINY_CPP_CLIENT_UserApi_H_ - - -#include "Response.h" -#include "Arduino.h" -#include "AbstractService.h" -#include "Helpers.h" -#include - -#include "User.h" -#include - -namespace Tiny { - -/** - * Class - * Generated with openapi::tiny-cpp-client - */ - -class UserApi : public AbstractService { -public: - UserApi() = default; - - virtual ~UserApi() = default; - - /** - * Create user. - * - * This can only be done by the logged in user. - * \param user Created user object *Required* - */ - Response< - String - > - createUser( - - User user - - ); - /** - * Creates list of users with given input array. - * - * - * \param user List of user object *Required* - */ - Response< - String - > - createUsersWithArrayInput( - std::list user - - - ); - /** - * Creates list of users with given input array. - * - * - * \param user List of user object *Required* - */ - Response< - String - > - createUsersWithListInput( - std::list user - - - ); - /** - * Delete user. - * - * This can only be done by the logged in user. - * \param username The name that needs to be deleted *Required* - */ - Response< - String - > - deleteUser( - - std::string username - - ); - /** - * Get user by user name. - * - * - * \param username The name that needs to be fetched. Use user1 for testing. *Required* - */ - Response< - User - > - getUserByName( - - std::string username - - ); - /** - * Logs user into the system. - * - * - * \param username The user name for login *Required* - * \param password The password for login in clear text *Required* - */ - Response< - std::string - > - loginUser( - - std::string username - , - - std::string password - - ); - /** - * Logs out current logged in user session. - * - * - */ - Response< - String - > - logoutUser( - ); - /** - * Updated user. - * - * This can only be done by the logged in user. - * \param username name that need to be deleted *Required* - * \param user Updated user object *Required* - */ - Response< - String - > - updateUser( - - std::string username - , - - User user - - ); -}; - -} - -#endif /* TINY_CPP_CLIENT_UserApi_H_ */ \ No newline at end of file diff --git a/samples/client/petstore/tiny/cpp/platformio.ini b/samples/client/petstore/tiny/cpp/platformio.ini deleted file mode 100644 index 00781178d10..00000000000 --- a/samples/client/petstore/tiny/cpp/platformio.ini +++ /dev/null @@ -1,7 +0,0 @@ -[env:esp32] -platform = espressif32 -board = nodemcu-32s -framework = arduino -lib_deps = https://github.com/steinwurf/bourne.git -extra_scripts = pre_compiling_bourne.py - diff --git a/samples/client/petstore/tiny/cpp/pre_compiling_bourne.py b/samples/client/petstore/tiny/cpp/pre_compiling_bourne.py deleted file mode 100644 index 96356dcdf15..00000000000 --- a/samples/client/petstore/tiny/cpp/pre_compiling_bourne.py +++ /dev/null @@ -1,25 +0,0 @@ -Import("env") - -## Compatibility for bourne to work on microcontrollers -# We insert '#define _GLIBCXX_USE_C99' in files that use std::stoll or std::to_string -def insert_c99_into(file): - import fileinput - - path = env['PROJECT_LIBDEPS_DIR'] + "/" + env['PIOENV'] + "/bourne/src/bourne/" + file - value = '#define _GLIBCXX_USE_C99 1\n' - - for line in fileinput.FileInput(path,inplace=1): - if line.startswith('#define _GLIBCXX_USE_C99'): - continue - elif line.startswith('// D'): - line=line.replace(line,line+value) - print(line, end='') - -def fix_parser(): - insert_c99_into('detail/parser.cpp') - -def fix_json(): - insert_c99_into('json.cpp') - -fix_parser() -fix_json() \ No newline at end of file diff --git a/samples/client/petstore/tiny/cpp/root.cert b/samples/client/petstore/tiny/cpp/root.cert deleted file mode 100644 index bad9c08efad..00000000000 --- a/samples/client/petstore/tiny/cpp/root.cert +++ /dev/null @@ -1,53 +0,0 @@ -// TODO: Provide your service root certificate. -// Below is two examples of root certificates. - -// Let's encrypt root certificate -/** -"-----BEGIN CERTIFICATE-----\n" \ -"MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh\n" \ -"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\n" \ -"d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD\n" \ -"QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT\n" \ -"MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j\n" \ -"b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG\n" \ -"9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB\n" \ -"CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97\n" \ -"nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt\n" \ -"43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P\n" \ -"T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4\n" \ -"gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO\n" \ -"BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR\n" \ -"TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw\n" \ -"DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr\n" \ -"hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg\n" \ -"06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF\n" \ -"PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n" \ -"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk\n" \ -"CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n" \ -"-----END CERTIFICATE-----\n" -*/ - -// Amazon_Root_CA_1.pem -/** -"-----BEGIN CERTIFICATE-----\n" \ -"MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n" \ -"ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n" \ -"b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n" \ -"MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n" \ -"b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n" \ -"ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n" \ -"9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n" \ -"IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n" \ -"VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n" \ -"93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n" \ -"jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" \ -"AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n" \ -"A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n" \ -"U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n" \ -"N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n" \ -"o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n" \ -"5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n" \ -"rqXRfboQnoZsG4q5WTP468SQvvG5\n" \ -"-----END CERTIFICATE-----\n" \ -*/ - diff --git a/samples/client/petstore/tiny/cpp/src/main.cpp b/samples/client/petstore/tiny/cpp/src/main.cpp deleted file mode 100644 index 34ba455fbdd..00000000000 --- a/samples/client/petstore/tiny/cpp/src/main.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "PetApi.h" - -const char* ssid = "your wifi name"; // TODO Change wifi name -const char* password = "Your wifi password"; //TODO Change wifi password - - -void setup(){ - //Initialize serial and wait for port to open: - Serial.begin(9600); - delay(100); - - Serial.print("Attempting to connect to SSID: "); - Serial.println(ssid); - WiFi.begin(ssid, password); - - // attempt to connect to Wifi network: - while (WiFi.status() != WL_CONNECTED) { - Serial.print("."); - // wait 1 second for re-trying - delay(1000); - } - - Serial.print("Connected to "); - Serial.println(ssid); - - //Print LAN IP. - Serial.print("IP address set: "); - Serial.println(WiFi.localIP()); - - Tiny::PetApi petapi; - auto resp = petapi.getPetById(10); - Serial.println(resp.code); - Tiny::Pet pet = resp.obj; - Serial.println(pet.toJson().dump().c_str()); -} - -void loop(){} diff --git a/samples/client/petstore/tiny/cpp/test/RunTests.cpp b/samples/client/petstore/tiny/cpp/test/RunTests.cpp deleted file mode 100644 index 4caafb4ee44..00000000000 --- a/samples/client/petstore/tiny/cpp/test/RunTests.cpp +++ /dev/null @@ -1,204 +0,0 @@ - -#include "ApiResponseTest.cpp" - -#include "CategoryTest.cpp" - -#include "OrderTest.cpp" - -#include "PetTest.cpp" - -#include "TagTest.cpp" - -#include "UserTest.cpp" - - - -void setUp(){} - -void tearDown(){} - -void runTests(){ - - - RUN_TEST(test_ApiResponse_code_is_assigned_from_json); - - - RUN_TEST(test_ApiResponse_type_is_assigned_from_json); - - - RUN_TEST(test_ApiResponse_message_is_assigned_from_json); - - - - RUN_TEST(test_Category_id_is_assigned_from_json); - - - RUN_TEST(test_Category_name_is_assigned_from_json); - - - - RUN_TEST(test_Order_id_is_assigned_from_json); - - - RUN_TEST(test_Order_petId_is_assigned_from_json); - - - RUN_TEST(test_Order_quantity_is_assigned_from_json); - - - RUN_TEST(test_Order_shipDate_is_assigned_from_json); - - - RUN_TEST(test_Order_status_is_assigned_from_json); - - - RUN_TEST(test_Order_complete_is_assigned_from_json); - - - - RUN_TEST(test_Pet_id_is_assigned_from_json); - - - - RUN_TEST(test_Pet_name_is_assigned_from_json); - - - - - RUN_TEST(test_Pet_status_is_assigned_from_json); - - - - RUN_TEST(test_Tag_id_is_assigned_from_json); - - - RUN_TEST(test_Tag_name_is_assigned_from_json); - - - - RUN_TEST(test_User_id_is_assigned_from_json); - - - RUN_TEST(test_User_username_is_assigned_from_json); - - - RUN_TEST(test_User_firstName_is_assigned_from_json); - - - RUN_TEST(test_User_lastName_is_assigned_from_json); - - - RUN_TEST(test_User_email_is_assigned_from_json); - - - RUN_TEST(test_User_password_is_assigned_from_json); - - - RUN_TEST(test_User_phone_is_assigned_from_json); - - - RUN_TEST(test_User_userStatus_is_assigned_from_json); - - - - - - RUN_TEST(test_ApiResponse_code_is_converted_to_json); - - - RUN_TEST(test_ApiResponse_type_is_converted_to_json); - - - RUN_TEST(test_ApiResponse_message_is_converted_to_json); - - - - RUN_TEST(test_Category_id_is_converted_to_json); - - - RUN_TEST(test_Category_name_is_converted_to_json); - - - - RUN_TEST(test_Order_id_is_converted_to_json); - - - RUN_TEST(test_Order_petId_is_converted_to_json); - - - RUN_TEST(test_Order_quantity_is_converted_to_json); - - - RUN_TEST(test_Order_shipDate_is_converted_to_json); - - - RUN_TEST(test_Order_status_is_converted_to_json); - - - RUN_TEST(test_Order_complete_is_converted_to_json); - - - - RUN_TEST(test_Pet_id_is_converted_to_json); - - - - RUN_TEST(test_Pet_name_is_converted_to_json); - - - - - RUN_TEST(test_Pet_status_is_converted_to_json); - - - - RUN_TEST(test_Tag_id_is_converted_to_json); - - - RUN_TEST(test_Tag_name_is_converted_to_json); - - - - RUN_TEST(test_User_id_is_converted_to_json); - - - RUN_TEST(test_User_username_is_converted_to_json); - - - RUN_TEST(test_User_firstName_is_converted_to_json); - - - RUN_TEST(test_User_lastName_is_converted_to_json); - - - RUN_TEST(test_User_email_is_converted_to_json); - - - RUN_TEST(test_User_password_is_converted_to_json); - - - RUN_TEST(test_User_phone_is_converted_to_json); - - - RUN_TEST(test_User_userStatus_is_converted_to_json); - - - - -} - -int main(void) { - UNITY_BEGIN(); - runTests(); - return UNITY_END(); -} - -void setup() { - UNITY_BEGIN(); - runTests(); - UNITY_END(); -} - -void loop() { - -} diff --git a/samples/config/petstore/k6/.openapi-generator-ignore b/samples/config/petstore/k6/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/config/petstore/k6/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/config/petstore/k6/.openapi-generator/VERSION b/samples/config/petstore/k6/.openapi-generator/VERSION deleted file mode 100644 index bfbf77eb7fa..00000000000 --- a/samples/config/petstore/k6/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.0-SNAPSHOT \ No newline at end of file diff --git a/samples/config/petstore/k6/README.md b/samples/config/petstore/k6/README.md deleted file mode 100644 index c76d4a6de34..00000000000 --- a/samples/config/petstore/k6/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Generated k6 script - -The `script.js` file contains most of the Swagger/OpenAPI specification and you can customize it to your needs. - -Global header variables are defined at the top of the file, like `api_key`. Each path in the specification is converted into a [group](https://docs.k6.io/docs/tags-and-groups) in k6 and each group contains all the request methods related to that path. Path and query parameters are extracted from the specification and put at the start of the group. The URL is constructed from the base URL plus path and query. - -k6 specific parameters are in the [`params`](https://docs.k6.io/docs/params-k6http) object, and `body` contains the [request](https://docs.k6.io/docs/http-requests) body which is in the form of `identifier: type`, which the `type` should be substituted by a proper value. Then goes the request and the check. - -[Check](https://docs.k6.io/docs/checks) are like asserts but differ in that they don't halt execution, instead they just store the result of the check, pass or fail, and let the script execution continue. - -Each request is always followed by a 0.1 second [sleep](https://docs.k6.io/docs/sleep-t-1) to prevent the script execution from flooding the system with too many requests simultaneously. - -Note that the default iteration count and VU count is 1. So each request in each group will be executed once. For more information, see the [k6 options](https://docs.k6.io/docs/options). diff --git a/samples/config/petstore/k6/script.js b/samples/config/petstore/k6/script.js deleted file mode 100644 index efb3797eeb7..00000000000 --- a/samples/config/petstore/k6/script.js +++ /dev/null @@ -1,204 +0,0 @@ -/* - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/OpenAPITools/openapi-generator - * - * OpenAPI generator version: 4.3.0-SNAPSHOT - */ - - -import http from "k6/http"; -import { group, check, sleep } from "k6"; - -const BASE_URL = "http://petstore.swagger.io/v2"; -// Sleep duration between successive requests. -// You might want to edit the value of this variable or remove calls to the sleep function on the script. -const SLEEP_DURATION = 0.1; -// Global variables should be initialized. -let api_key = "TODO_EDIT_THE_API_KEY"; - -export default function() { - group("/pet", () => { - let url = BASE_URL + `/pet`; - // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "list", "tags": [{"id": "long", "name": "string"}], "status": "string"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.put(url, body, params); - sleep(SLEEP_DURATION); - - // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"id": "long", "category": {"id": "long", "name": "string"}, "name": "string", "photoUrls": "list", "tags": [{"id": "long", "name": "string"}], "status": "string"}; - params = {headers: {"Content-Type": "application/json"}}; - request = http.post(url, body, params); - sleep(SLEEP_DURATION); - }); - group("/pet/findByStatus", () => { - let status = "TODO_EDIT_THE_STATUS"; - let url = BASE_URL + `/pet/findByStatus?status=${status}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/pet/findByTags", () => { - let tags = "TODO_EDIT_THE_TAGS"; - let url = BASE_URL + `/pet/findByTags?tags=${tags}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/pet/{petId}", () => { - let petId = "TODO_EDIT_THE_PETID"; - let url = BASE_URL + `/pet/${petId}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - - // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"name": "string", "status": "string"}; - params = {headers: {"Content-Type": "application/x-www-form-urlencoded"}}; - request = http.post(url, body, params); - sleep(SLEEP_DURATION); - - // Request No. 3 - params = {headers: {"api_key": `${api_key}`}}; - request = http.delete(url, params); - sleep(SLEEP_DURATION); - }); - group("/pet/{petId}/uploadImage", () => { - let petId = "TODO_EDIT_THE_PETID"; - let url = BASE_URL + `/pet/${petId}/uploadImage`; - // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"additionalMetadata": "string", "file": http.file(open("/path/to/file.bin", "b"), "test.bin")}; - let params = {headers: {"Content-Type": "multipart/form-data", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/inventory", () => { - let url = BASE_URL + `/store/inventory`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/order", () => { - let url = BASE_URL + `/store/order`; - // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "petId": "long", "quantity": "integer", "shipDate": "date", "status": "string", "complete": "boolean"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/store/order/{orderId}", () => { - let orderId = "TODO_EDIT_THE_ORDERID"; - let url = BASE_URL + `/store/order/${orderId}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - - // Request No. 2 - request = http.delete(url); - sleep(SLEEP_DURATION); - }); - group("/user", () => { - let url = BASE_URL + `/user`; - // Request No. 1 - // TODO: edit the parameters of the request body. - let body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, body, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/user/createWithArray", () => { - let url = BASE_URL + `/user/createWithArray`; - // Request No. 1 - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/user/createWithList", () => { - let url = BASE_URL + `/user/createWithList`; - // Request No. 1 - let params = {headers: {"Content-Type": "application/json", "Accept": "application/json"}}; - let request = http.post(url, params); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/user/login", () => { - let password = "TODO_EDIT_THE_PASSWORD"; - let username = "TODO_EDIT_THE_USERNAME"; - let url = BASE_URL + `/user/login?username=${username}&password=${password}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/user/logout", () => { - let url = BASE_URL + `/user/logout`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - }); - group("/user/{username}", () => { - let username = "TODO_EDIT_THE_USERNAME"; - let url = BASE_URL + `/user/${username}`; - // Request No. 1 - let request = http.get(url); - check(request, { - "successful operation": (r) => r.status === 200 - }); - sleep(SLEEP_DURATION); - - // Request No. 2 - // TODO: edit the parameters of the request body. - body = {"id": "long", "username": "string", "firstName": "string", "lastName": "string", "email": "string", "password": "string", "phone": "string", "userStatus": "integer"}; - params = {headers: {"Content-Type": "application/json"}}; - request = http.put(url, body, params); - sleep(SLEEP_DURATION); - - // Request No. 3 - request = http.delete(url); - sleep(SLEEP_DURATION); - }); -} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.gitignore b/samples/openapi3/client/features/mulitple-data-in-forms/.gitignore deleted file mode 100644 index daf913b1b34..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator-ignore b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/FILES b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/FILES deleted file mode 100644 index c55836136d0..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/FILES +++ /dev/null @@ -1,16 +0,0 @@ -.gitignore -.openapi-generator-ignore -.travis.yml -README.md -api/openapi.yaml -api_default.go -client.go -configuration.go -docs/ApiResponse.md -docs/DefaultApi.md -git_push.sh -go.mod -go.sum -model_api_response.go -response.go -utils.go diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/VERSION b/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/VERSION deleted file mode 100644 index 4077803655c..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/.travis.yml b/samples/openapi3/client/features/mulitple-data-in-forms/.travis.yml deleted file mode 100644 index f5cb2ce9a5a..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: go - -install: - - go get -d -v . - -script: - - go build -v ./ - diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/README.md b/samples/openapi3/client/features/mulitple-data-in-forms/README.md deleted file mode 100644 index 76cfee5b404..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/README.md +++ /dev/null @@ -1,113 +0,0 @@ -# Go API client for openapi - -This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: 1.0.0 -- Build package: org.openapitools.codegen.languages.GoClientCodegen - -## Installation - -Install the following dependencies: - -```shell -go get github.com/stretchr/testify/assert -go get golang.org/x/oauth2 -go get golang.org/x/net/context -``` - -Put the package under your project folder and add the following in import: - -```golang -import sw "./openapi" -``` - -To use a proxy, set the environment variable `HTTP_PROXY`: - -```golang -os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") -``` - -## Configuration of Server URL - -Default configuration comes with `Servers` field that contains server objects as defined in the OpenAPI specification. - -### Select Server Configuration - -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerIndex, 1) -``` - -### Templated Server URL - -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. - -```golang -ctx := context.WithValue(context.Background(), sw.ContextServerVariables, map[string]string{ - "basePath": "v2", -}) -``` - -Note, enum values are always validated and all unused variables are silently ignored. - -### URLs Configuration per Operation - -Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. -An operation is uniquely identified by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. - -``` -ctx := context.WithValue(context.Background(), sw.ContextOperationServerIndices, map[string]int{ - "{classname}Service.{nickname}": 2, -}) -ctx = context.WithValue(context.Background(), sw.ContextOperationServerVariables, map[string]map[string]string{ - "{classname}Service.{nickname}": { - "port": "8443", - }, -}) -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://example.com* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*DefaultApi* | [**UploadFiles**](docs/DefaultApi.md#uploadfiles) | **Post** /uploadFiles | uploads two files - - -## Documentation For Models - - - [ApiResponse](docs/ApiResponse.md) - - -## Documentation For Authorization - - Endpoints do not require authorization. - - -## Documentation for Utility Methods - -Due to the fact that model structure members are all pointers, this package contains -a number of utility functions to easily obtain pointers to values of basic types. -Each of these functions takes a value of the given basic type and returns a pointer to it: - -* `PtrBool` -* `PtrInt` -* `PtrInt32` -* `PtrInt64` -* `PtrFloat` -* `PtrFloat32` -* `PtrFloat64` -* `PtrString` -* `PtrTime` - -## Author - - - diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/api/openapi.yaml b/samples/openapi3/client/features/mulitple-data-in-forms/api/openapi.yaml deleted file mode 100644 index b849a15b658..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/api/openapi.yaml +++ /dev/null @@ -1,73 +0,0 @@ -openapi: 3.0.0 -info: - description: This is a sample server with a single endpoint that accepts two files - via a multipart/form-data POST request. - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: Multiple Files via form-data - version: 1.0.0 -servers: -- url: http://example.com -paths: - /uploadFiles: - post: - operationId: uploadFiles - requestBody: - $ref: '#/components/requestBodies/inline_object' - content: - multipart/form-data: - schema: - properties: - file: - description: file to upload - format: binary - type: string - secondFile: - description: another file to upload - format: binary - type: string - type: object - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - summary: uploads two files -components: - requestBodies: - inline_object: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object' - schemas: - ApiResponse: - description: Describes the result of uploading files - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - title: An uploaded response - type: object - inline_object: - properties: - file: - description: file to upload - format: binary - type: string - secondFile: - description: another file to upload - format: binary - type: string - type: object diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/api_default.go b/samples/openapi3/client/features/mulitple-data-in-forms/api_default.go deleted file mode 100644 index 81c36eb8bb9..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/api_default.go +++ /dev/null @@ -1,172 +0,0 @@ -/* -Multiple Files via form-data - -This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "bytes" - _context "context" - _ioutil "io/ioutil" - _nethttp "net/http" - _neturl "net/url" - "os" -) - -// Linger please -var ( - _ _context.Context -) - -// DefaultApiService DefaultApi service -type DefaultApiService service - -type ApiUploadFilesRequest struct { - ctx _context.Context - ApiService *DefaultApiService - file **os.File - secondFile **os.File -} - -// file to upload -func (r ApiUploadFilesRequest) File(file *os.File) ApiUploadFilesRequest { - r.file = &file - return r -} -// another file to upload -func (r ApiUploadFilesRequest) SecondFile(secondFile *os.File) ApiUploadFilesRequest { - r.secondFile = &secondFile - return r -} - -func (r ApiUploadFilesRequest) Execute() (ApiResponse, *_nethttp.Response, error) { - return r.ApiService.UploadFilesExecute(r) -} - -/* -UploadFiles uploads two files - - @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiUploadFilesRequest -*/ -func (a *DefaultApiService) UploadFiles(ctx _context.Context) ApiUploadFilesRequest { - return ApiUploadFilesRequest{ - ApiService: a, - ctx: ctx, - } -} - -// Execute executes the request -// @return ApiResponse -func (a *DefaultApiService) UploadFilesExecute(r ApiUploadFilesRequest) (ApiResponse, *_nethttp.Response, error) { - var ( - localVarHTTPMethod = _nethttp.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue ApiResponse - ) - - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UploadFiles") - if err != nil { - return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} - } - - localVarPath := localBasePath + "/uploadFiles" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := _neturl.Values{} - localVarFormParams := _neturl.Values{} - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"multipart/form-data"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - var fileLocalVarFormFileName string - var fileLocalVarFileName string - var fileLocalVarFileBytes []byte - - fileLocalVarFormFileName = "file" - - var fileLocalVarFile *os.File - if r.file != nil { - fileLocalVarFile = *r.file - } - if fileLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(fileLocalVarFile) - fileLocalVarFileBytes = fbs - fileLocalVarFileName = fileLocalVarFile.Name() - fileLocalVarFile.Close() - } - formFiles = append(formFiles, formFile{fileBytes: fileLocalVarFileBytes, fileName: fileLocalVarFileName, formFileName: fileLocalVarFormFileName}) - var secondFileLocalVarFormFileName string - var secondFileLocalVarFileName string - var secondFileLocalVarFileBytes []byte - - secondFileLocalVarFormFileName = "secondFile" - - var secondFileLocalVarFile *os.File - if r.secondFile != nil { - secondFileLocalVarFile = *r.secondFile - } - if secondFileLocalVarFile != nil { - fbs, _ := _ioutil.ReadAll(secondFileLocalVarFile) - secondFileLocalVarFileBytes = fbs - secondFileLocalVarFileName = secondFileLocalVarFile.Name() - secondFileLocalVarFile.Close() - } - formFiles = append(formFiles, formFile{fileBytes: secondFileLocalVarFileBytes, fileName: secondFileLocalVarFileName, formFileName: secondFileLocalVarFormFileName}) - req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, nil, err - } - - localVarHTTPResponse, err := a.client.callAPI(req) - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = _ioutil.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, localVarHTTPResponse, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: localVarHTTPResponse.Status, - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr := GenericOpenAPIError{ - body: localVarBody, - error: err.Error(), - } - return localVarReturnValue, localVarHTTPResponse, newErr - } - - return localVarReturnValue, localVarHTTPResponse, nil -} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/client.go b/samples/openapi3/client/features/mulitple-data-in-forms/client.go deleted file mode 100644 index 3d2f9db38b6..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/client.go +++ /dev/null @@ -1,553 +0,0 @@ -/* -Multiple Files via form-data - -This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "errors" - "fmt" - "io" - "io/ioutil" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "golang.org/x/oauth2" -) - -var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) -) - -// APIClient manages communication with the Multiple Files via form-data API v1.0.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - - DefaultApi *DefaultApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.DefaultApi = (*DefaultApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } else if t, ok := obj.(time.Time); ok { - return t.Format(time.RFC3339) - } - - return fmt.Sprintf("%v", obj) -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -func (c *APIClient) GetConfig() *Configuration { - return c.cfg -} - -type formFile struct { - fileBytes []byte - fileName string - formFileName string -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFiles []formFile) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - for _, formFile := range formFiles { - if len(formFile.fileBytes) > 0 && formFile.fileName != "" { - w.Boundary() - part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(formFile.fileBytes) - if err != nil { - return nil, err - } - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer "+auth) - } - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if f, ok := v.(**os.File); ok { - *f, err = ioutil.TempFile("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - if err != nil { - return - } - _, err = (*f).Seek(0, io.SeekStart) - return - } - if xmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return errors.New("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) error { - return fmt.Errorf(format, a...) -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(**os.File); ok { - _, err = bodyBuf.ReadFrom(*fp) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} - -// GenericOpenAPIError Provides access to the body, error and model on returned errors. -type GenericOpenAPIError struct { - body []byte - error string - model interface{} -} - -// Error returns non-empty string if there was an error. -func (e GenericOpenAPIError) Error() string { - return e.error -} - -// Body returns the raw bytes of the response -func (e GenericOpenAPIError) Body() []byte { - return e.body -} - -// Model returns the unpacked model of the error -func (e GenericOpenAPIError) Model() interface{} { - return e.model -} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/configuration.go b/samples/openapi3/client/features/mulitple-data-in-forms/configuration.go deleted file mode 100644 index b37e37f59eb..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/configuration.go +++ /dev/null @@ -1,230 +0,0 @@ -/* -Multiple Files via form-data - -This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "context" - "fmt" - "net/http" - "strings" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKeys takes a string apikey as authentication for the request - ContextAPIKeys = contextKey("apiKeys") - - // ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request. - ContextHttpSignatureAuth = contextKey("httpsignature") - - // ContextServerIndex uses a server configuration from the index. - ContextServerIndex = contextKey("serverIndex") - - // ContextOperationServerIndices uses a server configuration from the index mapping. - ContextOperationServerIndices = contextKey("serverOperationIndices") - - // ContextServerVariables overrides a server configuration variables. - ContextServerVariables = contextKey("serverVariables") - - // ContextOperationServerVariables overrides a server configuration variables using operation specific values. - ContextOperationServerVariables = contextKey("serverOperationVariables") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -// ServerVariable stores the information about a server variable -type ServerVariable struct { - Description string - DefaultValue string - EnumValues []string -} - -// ServerConfiguration stores the information about a server -type ServerConfiguration struct { - URL string - Description string - Variables map[string]ServerVariable -} - -// ServerConfigurations stores multiple ServerConfiguration items -type ServerConfigurations []ServerConfiguration - -// Configuration stores the configuration of the API client -type Configuration struct { - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - Debug bool `json:"debug,omitempty"` - Servers ServerConfigurations - OperationServers map[string]ServerConfigurations - HTTPClient *http.Client -} - -// NewConfiguration returns a new Configuration object -func NewConfiguration() *Configuration { - cfg := &Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Servers: ServerConfigurations{ - { - URL: "http://example.com", - Description: "No description provided", - }, - }, - OperationServers: map[string]ServerConfigurations{ - }, - } - return cfg -} - -// AddDefaultHeader adds a new HTTP header to the default header in the request -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} - -// URL formats template on a index using given variables -func (sc ServerConfigurations) URL(index int, variables map[string]string) (string, error) { - if index < 0 || len(sc) <= index { - return "", fmt.Errorf("Index %v out of range %v", index, len(sc)-1) - } - server := sc[index] - url := server.URL - - // go through variables and replace placeholders - for name, variable := range server.Variables { - if value, ok := variables[name]; ok { - found := bool(len(variable.EnumValues) == 0) - for _, enumValue := range variable.EnumValues { - if value == enumValue { - found = true - } - } - if !found { - return "", fmt.Errorf("The variable %s in the server URL has invalid value %v. Must be %v", name, value, variable.EnumValues) - } - url = strings.Replace(url, "{"+name+"}", value, -1) - } else { - url = strings.Replace(url, "{"+name+"}", variable.DefaultValue, -1) - } - } - return url, nil -} - -// ServerURL returns URL based on server settings -func (c *Configuration) ServerURL(index int, variables map[string]string) (string, error) { - return c.Servers.URL(index, variables) -} - -func getServerIndex(ctx context.Context) (int, error) { - si := ctx.Value(ContextServerIndex) - if si != nil { - if index, ok := si.(int); ok { - return index, nil - } - return 0, reportError("Invalid type %T should be int", si) - } - return 0, nil -} - -func getServerOperationIndex(ctx context.Context, endpoint string) (int, error) { - osi := ctx.Value(ContextOperationServerIndices) - if osi != nil { - if operationIndices, ok := osi.(map[string]int); !ok { - return 0, reportError("Invalid type %T should be map[string]int", osi) - } else { - index, ok := operationIndices[endpoint] - if ok { - return index, nil - } - } - } - return getServerIndex(ctx) -} - -func getServerVariables(ctx context.Context) (map[string]string, error) { - sv := ctx.Value(ContextServerVariables) - if sv != nil { - if variables, ok := sv.(map[string]string); ok { - return variables, nil - } - return nil, reportError("ctx value of ContextServerVariables has invalid type %T should be map[string]string", sv) - } - return nil, nil -} - -func getServerOperationVariables(ctx context.Context, endpoint string) (map[string]string, error) { - osv := ctx.Value(ContextOperationServerVariables) - if osv != nil { - if operationVariables, ok := osv.(map[string]map[string]string); !ok { - return nil, reportError("ctx value of ContextOperationServerVariables has invalid type %T should be map[string]map[string]string", osv) - } else { - variables, ok := operationVariables[endpoint] - if ok { - return variables, nil - } - } - } - return getServerVariables(ctx) -} - -// ServerURLWithContext returns a new server URL given an endpoint -func (c *Configuration) ServerURLWithContext(ctx context.Context, endpoint string) (string, error) { - sc, ok := c.OperationServers[endpoint] - if !ok { - sc = c.Servers - } - - if ctx == nil { - return sc.URL(0, nil) - } - - index, err := getServerOperationIndex(ctx, endpoint) - if err != nil { - return "", err - } - - variables, err := getServerOperationVariables(ctx, endpoint) - if err != nil { - return "", err - } - - return sc.URL(index, variables) -} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/docs/ApiResponse.md b/samples/openapi3/client/features/mulitple-data-in-forms/docs/ApiResponse.md deleted file mode 100644 index 877dacb4293..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/docs/ApiResponse.md +++ /dev/null @@ -1,108 +0,0 @@ -# ApiResponse - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | Pointer to **int32** | | [optional] -**Type** | Pointer to **string** | | [optional] -**Message** | Pointer to **string** | | [optional] - -## Methods - -### NewApiResponse - -`func NewApiResponse() *ApiResponse` - -NewApiResponse instantiates a new ApiResponse object -This constructor will assign default values to properties that have it defined, -and makes sure properties required by API are set, but the set of arguments -will change when the set of required properties is changed - -### NewApiResponseWithDefaults - -`func NewApiResponseWithDefaults() *ApiResponse` - -NewApiResponseWithDefaults instantiates a new ApiResponse object -This constructor will only assign default values to properties that have it defined, -but it doesn't guarantee that properties required by API are set - -### GetCode - -`func (o *ApiResponse) GetCode() int32` - -GetCode returns the Code field if non-nil, zero value otherwise. - -### GetCodeOk - -`func (o *ApiResponse) GetCodeOk() (*int32, bool)` - -GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetCode - -`func (o *ApiResponse) SetCode(v int32)` - -SetCode sets Code field to given value. - -### HasCode - -`func (o *ApiResponse) HasCode() bool` - -HasCode returns a boolean if a field has been set. - -### GetType - -`func (o *ApiResponse) GetType() string` - -GetType returns the Type field if non-nil, zero value otherwise. - -### GetTypeOk - -`func (o *ApiResponse) GetTypeOk() (*string, bool)` - -GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetType - -`func (o *ApiResponse) SetType(v string)` - -SetType sets Type field to given value. - -### HasType - -`func (o *ApiResponse) HasType() bool` - -HasType returns a boolean if a field has been set. - -### GetMessage - -`func (o *ApiResponse) GetMessage() string` - -GetMessage returns the Message field if non-nil, zero value otherwise. - -### GetMessageOk - -`func (o *ApiResponse) GetMessageOk() (*string, bool)` - -GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise -and a boolean to check if the value has been set. - -### SetMessage - -`func (o *ApiResponse) SetMessage(v string)` - -SetMessage sets Message field to given value. - -### HasMessage - -`func (o *ApiResponse) HasMessage() bool` - -HasMessage returns a boolean if a field has been set. - - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/docs/DefaultApi.md b/samples/openapi3/client/features/mulitple-data-in-forms/docs/DefaultApi.md deleted file mode 100644 index fc5678d9345..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/docs/DefaultApi.md +++ /dev/null @@ -1,75 +0,0 @@ -# \DefaultApi - -All URIs are relative to *http://example.com* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**UploadFiles**](DefaultApi.md#UploadFiles) | **Post** /uploadFiles | uploads two files - - - -## UploadFiles - -> ApiResponse UploadFiles(ctx).File(file).SecondFile(secondFile).Execute() - -uploads two files - -### Example - -```go -package main - -import ( - "context" - "fmt" - "os" - openapiclient "./openapi" -) - -func main() { - file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) - secondFile := os.NewFile(1234, "some_file") // *os.File | another file to upload (optional) - - configuration := openapiclient.NewConfiguration() - api_client := openapiclient.NewAPIClient(configuration) - resp, r, err := api_client.DefaultApi.UploadFiles(context.Background()).File(file).SecondFile(secondFile).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultApi.UploadFiles``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFiles`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultApi.UploadFiles`: %v\n", resp) -} -``` - -### Path Parameters - - - -### Other Parameters - -Other parameters are passed through a pointer to a apiUploadFilesRequest struct via the builder pattern - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **file** | ***os.File** | file to upload | - **secondFile** | ***os.File** | another file to upload | - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: multipart/form-data -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../README.md#documentation-for-models) -[[Back to README]](../README.md) - diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/git_push.sh b/samples/openapi3/client/features/mulitple-data-in-forms/git_push.sh deleted file mode 100644 index f53a75d4fab..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/go.mod b/samples/openapi3/client/features/mulitple-data-in-forms/go.mod deleted file mode 100644 index 0f43de9ebb2..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/go.mod +++ /dev/null @@ -1,7 +0,0 @@ -module github.com/GIT_USER_ID/GIT_REPO_ID - -go 1.13 - -require ( - golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99 -) diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/go.sum b/samples/openapi3/client/features/mulitple-data-in-forms/go.sum deleted file mode 100644 index 734252e6815..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/go.sum +++ /dev/null @@ -1,13 +0,0 @@ -cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= -golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/model_api_response.go b/samples/openapi3/client/features/mulitple-data-in-forms/model_api_response.go deleted file mode 100644 index d1fee6092d1..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/model_api_response.go +++ /dev/null @@ -1,187 +0,0 @@ -/* -Multiple Files via form-data - -This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "encoding/json" -) - -// ApiResponse Describes the result of uploading files -type ApiResponse struct { - Code *int32 `json:"code,omitempty"` - Type *string `json:"type,omitempty"` - Message *string `json:"message,omitempty"` -} - -// NewApiResponse instantiates a new ApiResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewApiResponse() *ApiResponse { - this := ApiResponse{} - return &this -} - -// NewApiResponseWithDefaults instantiates a new ApiResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewApiResponseWithDefaults() *ApiResponse { - this := ApiResponse{} - return &this -} - -// GetCode returns the Code field value if set, zero value otherwise. -func (o *ApiResponse) GetCode() int32 { - if o == nil || o.Code == nil { - var ret int32 - return ret - } - return *o.Code -} - -// GetCodeOk returns a tuple with the Code field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetCodeOk() (*int32, bool) { - if o == nil || o.Code == nil { - return nil, false - } - return o.Code, true -} - -// HasCode returns a boolean if a field has been set. -func (o *ApiResponse) HasCode() bool { - if o != nil && o.Code != nil { - return true - } - - return false -} - -// SetCode gets a reference to the given int32 and assigns it to the Code field. -func (o *ApiResponse) SetCode(v int32) { - o.Code = &v -} - -// GetType returns the Type field value if set, zero value otherwise. -func (o *ApiResponse) GetType() string { - if o == nil || o.Type == nil { - var ret string - return ret - } - return *o.Type -} - -// GetTypeOk returns a tuple with the Type field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetTypeOk() (*string, bool) { - if o == nil || o.Type == nil { - return nil, false - } - return o.Type, true -} - -// HasType returns a boolean if a field has been set. -func (o *ApiResponse) HasType() bool { - if o != nil && o.Type != nil { - return true - } - - return false -} - -// SetType gets a reference to the given string and assigns it to the Type field. -func (o *ApiResponse) SetType(v string) { - o.Type = &v -} - -// GetMessage returns the Message field value if set, zero value otherwise. -func (o *ApiResponse) GetMessage() string { - if o == nil || o.Message == nil { - var ret string - return ret - } - return *o.Message -} - -// GetMessageOk returns a tuple with the Message field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *ApiResponse) GetMessageOk() (*string, bool) { - if o == nil || o.Message == nil { - return nil, false - } - return o.Message, true -} - -// HasMessage returns a boolean if a field has been set. -func (o *ApiResponse) HasMessage() bool { - if o != nil && o.Message != nil { - return true - } - - return false -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -func (o *ApiResponse) SetMessage(v string) { - o.Message = &v -} - -func (o ApiResponse) MarshalJSON() ([]byte, error) { - toSerialize := map[string]interface{}{} - if o.Code != nil { - toSerialize["code"] = o.Code - } - if o.Type != nil { - toSerialize["type"] = o.Type - } - if o.Message != nil { - toSerialize["message"] = o.Message - } - return json.Marshal(toSerialize) -} - -type NullableApiResponse struct { - value *ApiResponse - isSet bool -} - -func (v NullableApiResponse) Get() *ApiResponse { - return v.value -} - -func (v *NullableApiResponse) Set(val *ApiResponse) { - v.value = val - v.isSet = true -} - -func (v NullableApiResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableApiResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableApiResponse(val *ApiResponse) *NullableApiResponse { - return &NullableApiResponse{value: val, isSet: true} -} - -func (v NullableApiResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableApiResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - - diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/multiple-files-forms.yaml b/samples/openapi3/client/features/mulitple-data-in-forms/multiple-files-forms.yaml deleted file mode 100644 index fd522ba72c4..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/multiple-files-forms.yaml +++ /dev/null @@ -1,52 +0,0 @@ -openapi: 3.0.0 -servers: - - url: "http://example.com" -info: - description: >- - This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - version: 1.0.0 - title: Multiple Files via form-data - license: - name: Apache-2.0 - url: "https://www.apache.org/licenses/LICENSE-2.0.html" -paths: - "/uploadFiles": - post: - summary: uploads two files - description: "" - operationId: uploadFiles - responses: - "200": - description: successful operation - content: - application/json: - schema: - $ref: "#/components/schemas/ApiResponse" - requestBody: - content: - multipart/form-data: - schema: - type: object - properties: - file: - description: file to upload - type: string - format: binary - secondFile: - description: another file to upload - type: string - format: binary -components: - schemas: - ApiResponse: - title: An uploaded response - description: Describes the result of uploading files - type: object - properties: - code: - type: integer - format: int32 - type: - type: string - message: - type: string diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/response.go b/samples/openapi3/client/features/mulitple-data-in-forms/response.go deleted file mode 100644 index f6fa23e6e01..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/response.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Multiple Files via form-data - -This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "net/http" -) - -// APIResponse stores the API response returned by the server. -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the OpenAPI operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -// NewAPIResponse returns a new APIResponse object. -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -// NewAPIResponseWithError returns a new APIResponse object with the provided error message. -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/samples/openapi3/client/features/mulitple-data-in-forms/utils.go b/samples/openapi3/client/features/mulitple-data-in-forms/utils.go deleted file mode 100644 index b687a2ee01c..00000000000 --- a/samples/openapi3/client/features/mulitple-data-in-forms/utils.go +++ /dev/null @@ -1,328 +0,0 @@ -/* -Multiple Files via form-data - -This is a sample server with a single endpoint that accepts two files via a multipart/form-data POST request. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package openapi - -import ( - "encoding/json" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -func PtrTime(v time.Time) *time.Time { return &v } - -type NullableBool struct { - value *bool - isSet bool -} - -func (v NullableBool) Get() *bool { - return v.value -} - -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -func (v NullableBool) IsSet() bool { - return v.isSet -} - -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt struct { - value *int - isSet bool -} - -func (v NullableInt) Get() *int { - return v.value -} - -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -func (v NullableInt) IsSet() bool { - return v.isSet -} - -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt32 struct { - value *int32 - isSet bool -} - -func (v NullableInt32) Get() *int32 { - return v.value -} - -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableInt64 struct { - value *int64 - isSet bool -} - -func (v NullableInt64) Get() *int64 { - return v.value -} - -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat32 struct { - value *float32 - isSet bool -} - -func (v NullableFloat32) Get() *float32 { - return v.value -} - -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableFloat64 struct { - value *float64 - isSet bool -} - -func (v NullableFloat64) Get() *float64 { - return v.value -} - -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableString struct { - value *string - isSet bool -} - -func (v NullableString) Get() *string { - return v.value -} - -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -func (v NullableString) IsSet() bool { - return v.isSet -} - -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -type NullableTime struct { - value *time.Time - isSet bool -} - -func (v NullableTime) Get() *time.Time { - return v.value -} - -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -func (v NullableTime) IsSet() bool { - return v.isSet -} - -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -func (v NullableTime) MarshalJSON() ([]byte, error) { - return v.value.MarshalJSON() -} - -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/.openapi-generator-ignore b/samples/openapi3/client/petstore/kotlin-deprecated/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/.openapi-generator/VERSION b/samples/openapi3/client/petstore/kotlin-deprecated/.openapi-generator/VERSION deleted file mode 100644 index d99e7162d01..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -5.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/README.md b/samples/openapi3/client/petstore/kotlin-deprecated/README.md deleted file mode 100644 index 1c48fa23c18..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/README.md +++ /dev/null @@ -1,99 +0,0 @@ -# org.openapitools.client - Kotlin client library for OpenAPI Petstore - -## Requires - -* Kotlin 1.3.41 -* Gradle 4.9 - -## Build - -First, create the gradle wrapper script: - -``` -gradle wrapper -``` - -Then, run: - -``` -./gradlew check assemble -``` - -This runs all tests and packages the library. - -## Features/Implementation Notes - -* Supports JSON inputs/outputs, File inputs, and Form inputs. -* Supports collection formats for query parameters: csv, tsv, ssv, pipes. -* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions. -* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. - - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - - -## Documentation for Models - - - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md) - - [org.openapitools.client.models.Category](docs/Category.md) - - [org.openapitools.client.models.InlineObject](docs/InlineObject.md) - - [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md) - - [org.openapitools.client.models.Order](docs/Order.md) - - [org.openapitools.client.models.Pet](docs/Pet.md) - - [org.openapitools.client.models.Tag](docs/Tag.md) - - [org.openapitools.client.models.User](docs/User.md) - - - -## Documentation for Authorization - - -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - - -### auth_cookie - -- **Type**: API key -- **API key parameter name**: AUTH_KEY -- **Location**: - - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - write:pets: modify pets in your account - - read:pets: read your pets - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/build.gradle b/samples/openapi3/client/petstore/kotlin-deprecated/build.gradle deleted file mode 100644 index 56be0bd0dd8..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -group 'org.openapitools' -version '1.0.0' - -wrapper { - gradleVersion = '4.9' - distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip" -} - -buildscript { - ext.kotlin_version = '1.3.61' - - repositories { - maven { url "https://repo1.maven.org/maven2" } - } - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -apply plugin: 'kotlin' - -repositories { - maven { url "https://repo1.maven.org/maven2" } -} - -test { - useJUnitPlatform() -} - -dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - compile "com.squareup.moshi:moshi-kotlin:1.9.2" - compile "com.squareup.moshi:moshi-adapters:1.9.2" - compile "com.squareup.okhttp3:okhttp:4.2.2" - testCompile "io.kotlintest:kotlintest-runner-junit5:3.1.0" -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/ApiResponse.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/ApiResponse.md deleted file mode 100644 index 6b4c6bf2779..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **kotlin.Int** | | [optional] -**type** | **kotlin.String** | | [optional] -**message** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Category.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/Category.md deleted file mode 100644 index 2c28a670fc7..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/InlineObject.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/InlineObject.md deleted file mode 100644 index 2156c70addf..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/InlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ - -# InlineObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | Updated name of the pet | [optional] -**status** | **kotlin.String** | Updated status of the pet | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/InlineObject1.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/InlineObject1.md deleted file mode 100644 index 2a77eecba2b..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/InlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ - -# InlineObject1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional] -**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Order.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/Order.md deleted file mode 100644 index 5112f08958d..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Order.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**petId** | **kotlin.Long** | | [optional] -**quantity** | **kotlin.Int** | | [optional] -**shipDate** | [**java.time.OffsetDateTime**](java.time.OffsetDateTime.md) | | [optional] -**status** | [**inline**](#StatusEnum) | Order Status | [optional] -**complete** | **kotlin.Boolean** | | [optional] - - - -## Enum: status -Name | Value ----- | ----- -status | placed, approved, delivered - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Pet.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/Pet.md deleted file mode 100644 index 70c340005d1..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Pet.md +++ /dev/null @@ -1,22 +0,0 @@ - -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **kotlin.String** | | -**photoUrls** | **kotlin.Array<kotlin.String>** | | -**id** | **kotlin.Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional] -**status** | [**inline**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: status -Name | Value ----- | ----- -status | available, pending, sold - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/PetApi.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/PetApi.md deleted file mode 100644 index ec25ae044f3..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/PetApi.md +++ /dev/null @@ -1,405 +0,0 @@ -# PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **addPet** -> addPet(pet) - -Add a new pet to the store - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val pet : Pet = // Pet | Pet object that needs to be added to the store -try { - apiInstance.addPet(pet) -} catch (e: ClientException) { - println("4xx response calling PetApi#addPet") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#addPet") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - - -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete -val apiKey : kotlin.String = apiKey_example // kotlin.String | -try { - apiInstance.deletePet(petId, apiKey) -} catch (e: ClientException) { - println("4xx response calling PetApi#deletePet") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#deletePet") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| Pet id to delete | - **apiKey** | **kotlin.String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - - -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **findPetsByStatus** -> kotlin.Array<Pet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val status : kotlin.Array = // kotlin.Array | Status values that need to be considered for filter -try { - val result : kotlin.Array = apiInstance.findPetsByStatus(status) - println(result) -} catch (e: ClientException) { - println("4xx response calling PetApi#findPetsByStatus") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#findPetsByStatus") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] - -### Return type - -[**kotlin.Array<Pet>**](Pet.md) - -### Authorization - - -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> kotlin.Array<Pet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val tags : kotlin.Array = // kotlin.Array | Tags to filter by -try { - val result : kotlin.Array = apiInstance.findPetsByTags(tags) - println(result) -} catch (e: ClientException) { - println("4xx response calling PetApi#findPetsByTags") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#findPetsByTags") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | - -### Return type - -[**kotlin.Array<Pet>**](Pet.md) - -### Authorization - - -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return -try { - val result : Pet = apiInstance.getPetById(petId) - println(result) -} catch (e: ClientException) { - println("4xx response calling PetApi#getPetById") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#getPetById") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - - -Configure api_key: - ApiClient.apiKey["api_key"] = "" - ApiClient.apiKeyPrefix["api_key"] = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(pet) - -Update an existing pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val pet : Pet = // Pet | Pet object that needs to be added to the store -try { - apiInstance.updatePet(pet) -} catch (e: ClientException) { - println("4xx response calling PetApi#updatePet") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#updatePet") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - - -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated -val name : kotlin.String = name_example // kotlin.String | Updated name of the pet -val status : kotlin.String = status_example // kotlin.String | Updated status of the pet -try { - apiInstance.updatePetWithForm(petId, name, status) -} catch (e: ClientException) { - println("4xx response calling PetApi#updatePetWithForm") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#updatePetWithForm") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet that needs to be updated | - **name** | **kotlin.String**| Updated name of the pet | [optional] - **status** | **kotlin.String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - - -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = PetApi() -val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update -val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server -val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload -try { - val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) - println(result) -} catch (e: ClientException) { - println("4xx response calling PetApi#uploadFile") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling PetApi#uploadFile") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **kotlin.Long**| ID of pet to update | - **additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] - **file** | **java.io.File**| file to upload | [optional] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - - -Configure petstore_auth: - ApiClient.accessToken = "" - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/StoreApi.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/StoreApi.md deleted file mode 100644 index d2c01ffc5f4..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/StoreApi.md +++ /dev/null @@ -1,196 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = StoreApi() -val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted -try { - apiInstance.deleteOrder(orderId) -} catch (e: ClientException) { - println("4xx response calling StoreApi#deleteOrder") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling StoreApi#deleteOrder") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getInventory** -> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = StoreApi() -try { - val result : kotlin.collections.Map = apiInstance.getInventory() - println(result) -} catch (e: ClientException) { - println("4xx response calling StoreApi#getInventory") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling StoreApi#getInventory") - e.printStackTrace() -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**kotlin.collections.Map<kotlin.String, kotlin.Int>** - -### Authorization - - -Configure api_key: - ApiClient.apiKey["api_key"] = "" - ApiClient.apiKeyPrefix["api_key"] = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = StoreApi() -val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched -try { - val result : Order = apiInstance.getOrderById(orderId) - println(result) -} catch (e: ClientException) { - println("4xx response calling StoreApi#getOrderById") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling StoreApi#getOrderById") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **kotlin.Long**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> Order placeOrder(order) - -Place an order for a pet - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = StoreApi() -val order : Order = // Order | order placed for purchasing the pet -try { - val result : Order = apiInstance.placeOrder(order) - println(result) -} catch (e: ClientException) { - println("4xx response calling StoreApi#placeOrder") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling StoreApi#placeOrder") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/xml, application/json - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Tag.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/Tag.md deleted file mode 100644 index 60ce1bcdbad..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**name** | **kotlin.String** | | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/User.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/User.md deleted file mode 100644 index e801729b5ed..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ - -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **kotlin.Long** | | [optional] -**username** | **kotlin.String** | | [optional] -**firstName** | **kotlin.String** | | [optional] -**lastName** | **kotlin.String** | | [optional] -**email** | **kotlin.String** | | [optional] -**password** | **kotlin.String** | | [optional] -**phone** | **kotlin.String** | | [optional] -**userStatus** | **kotlin.Int** | User Status | [optional] - - - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/docs/UserApi.md b/samples/openapi3/client/petstore/kotlin-deprecated/docs/UserApi.md deleted file mode 100644 index 89fef1a3658..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/docs/UserApi.md +++ /dev/null @@ -1,394 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(user) - -Create user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -val user : User = // User | Created user object -try { - apiInstance.createUser(user) -} catch (e: ClientException) { - println("4xx response calling UserApi#createUser") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#createUser") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - - -Configure auth_cookie: - ApiClient.apiKey["AUTH_KEY"] = "" - ApiClient.apiKeyPrefix["AUTH_KEY"] = "" - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) - -Creates list of users with given input array - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object -try { - apiInstance.createUsersWithArrayInput(user) -} catch (e: ClientException) { - println("4xx response calling UserApi#createUsersWithArrayInput") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#createUsersWithArrayInput") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - - -Configure auth_cookie: - ApiClient.apiKey["AUTH_KEY"] = "" - ApiClient.apiKeyPrefix["AUTH_KEY"] = "" - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **createUsersWithListInput** -> createUsersWithListInput(user) - -Creates list of users with given input array - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -val user : kotlin.Array = // kotlin.Array | List of user object -try { - apiInstance.createUsersWithListInput(user) -} catch (e: ClientException) { - println("4xx response calling UserApi#createUsersWithListInput") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#createUsersWithListInput") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**kotlin.Array<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - - -Configure auth_cookie: - ApiClient.apiKey["AUTH_KEY"] = "" - ApiClient.apiKeyPrefix["AUTH_KEY"] = "" - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted -try { - apiInstance.deleteUser(username) -} catch (e: ClientException) { - println("4xx response calling UserApi#deleteUser") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#deleteUser") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - - -Configure auth_cookie: - ApiClient.apiKey["AUTH_KEY"] = "" - ApiClient.apiKeyPrefix["AUTH_KEY"] = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. -try { - val result : User = apiInstance.getUserByName(username) - println(result) -} catch (e: ClientException) { - println("4xx response calling UserApi#getUserByName") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#getUserByName") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> kotlin.String loginUser(username, password) - -Logs user into the system - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -val username : kotlin.String = username_example // kotlin.String | The user name for login -val password : kotlin.String = password_example // kotlin.String | The password for login in clear text -try { - val result : kotlin.String = apiInstance.loginUser(username, password) - println(result) -} catch (e: ClientException) { - println("4xx response calling UserApi#loginUser") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#loginUser") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| The user name for login | - **password** | **kotlin.String**| The password for login in clear text | - -### Return type - -**kotlin.String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -try { - apiInstance.logoutUser() -} catch (e: ClientException) { - println("4xx response calling UserApi#logoutUser") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#logoutUser") - e.printStackTrace() -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - - -Configure auth_cookie: - ApiClient.apiKey["AUTH_KEY"] = "" - ApiClient.apiKeyPrefix["AUTH_KEY"] = "" - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **updateUser** -> updateUser(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example -```kotlin -// Import classes: -//import org.openapitools.client.infrastructure.* -//import org.openapitools.client.models.* - -val apiInstance = UserApi() -val username : kotlin.String = username_example // kotlin.String | name that need to be deleted -val user : User = // User | Updated user object -try { - apiInstance.updateUser(username, user) -} catch (e: ClientException) { - println("4xx response calling UserApi#updateUser") - e.printStackTrace() -} catch (e: ServerException) { - println("5xx response calling UserApi#updateUser") - e.printStackTrace() -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **kotlin.String**| name that need to be deleted | - **user** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - - -Configure auth_cookie: - ApiClient.apiKey["AUTH_KEY"] = "" - ApiClient.apiKeyPrefix["AUTH_KEY"] = "" - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/settings.gradle b/samples/openapi3/client/petstore/kotlin-deprecated/settings.gradle deleted file mode 100644 index a80d8fb00e2..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ - -rootProject.name = 'kotlin-petstore-deprecated' \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/PetApi.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/PetApi.kt deleted file mode 100644 index 76d108d1342..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/PetApi.kt +++ /dev/null @@ -1,373 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.ApiResponse -import org.openapitools.client.models.Pet - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun addPet(pet: Pet) : Unit { - val localVariableBody: kotlin.Any? = pet - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deletePet(petId: kotlin.Long, apiKey: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("api_key" to apiKey.toString()) - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return kotlin.Array - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun findPetsByStatus(status: kotlin.Array) : kotlin.Array { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("status", toMultiValue(status.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByStatus", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return kotlin.Array - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - @Deprecated(message = "This operation is deprecated.") - fun findPetsByTags(tags: kotlin.Array) : kotlin.Array { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("tags", toMultiValue(tags.toList(), "csv")) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/findByTags", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.Array - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getPetById(petId: kotlin.Long) : Pet { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Pet - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Update an existing pet - * - * @param pet Pet object that needs to be added to the store - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePet(pet: Pet) : Unit { - val localVariableBody: kotlin.Any? = pet - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/pet", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String?, status: kotlin.String?) : Unit { - val localVariableBody: kotlin.Any? = mapOf("name" to name, "status" to status) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String?, file: java.io.File?) : ApiResponse { - val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to additionalMetadata, "file" to file) - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf("Content-Type" to "multipart/form-data") - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as ApiResponse - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt deleted file mode 100644 index ac0e2c7d003..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt +++ /dev/null @@ -1,198 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.Order - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class StoreApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteOrder(orderId: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return kotlin.collections.Map - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getInventory() : kotlin.collections.Map { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/inventory", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request>( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.collections.Map - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getOrderById(orderId: kotlin.Long) : Order { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Place an order for a pet - * - * @param order order placed for purchasing the pet - * @return Order - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun placeOrder(order: Order) : Order { - val localVariableBody: kotlin.Any? = order - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/store/order", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as Order - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/UserApi.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/UserApi.kt deleted file mode 100644 index 4c23e5d5c33..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/apis/UserApi.kt +++ /dev/null @@ -1,363 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.apis - -import org.openapitools.client.models.User - -import org.openapitools.client.infrastructure.ApiClient -import org.openapitools.client.infrastructure.ClientException -import org.openapitools.client.infrastructure.ClientError -import org.openapitools.client.infrastructure.ServerException -import org.openapitools.client.infrastructure.ServerError -import org.openapitools.client.infrastructure.MultiValueMap -import org.openapitools.client.infrastructure.RequestConfig -import org.openapitools.client.infrastructure.RequestMethod -import org.openapitools.client.infrastructure.ResponseType -import org.openapitools.client.infrastructure.Success -import org.openapitools.client.infrastructure.toMultiValue - -class UserApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) { - companion object { - @JvmStatic - val defaultBasePath: String by lazy { - System.getProperties().getProperty("org.openapitools.client.baseUrl", "http://petstore.swagger.io/v2") - } - } - - /** - * Create user - * This can only be done by the logged in user. - * @param user Created user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUser(user: User) : Unit { - val localVariableBody: kotlin.Any? = user - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Creates list of users with given input array - * - * @param user List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithArrayInput(user: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = user - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithArray", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Creates list of users with given input array - * - * @param user List of user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun createUsersWithListInput(user: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = user - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.POST, - "/user/createWithList", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun deleteUser(username: kotlin.String) : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.DELETE, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun getUserByName(username: kotlin.String) : User { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as User - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return kotlin.String - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Suppress("UNCHECKED_CAST") - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf>() - .apply { - put("username", listOf(username.toString())) - put("password", listOf(password.toString())) - } - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/login", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> (localVarResponse as Success<*>).data as kotlin.String - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Logs out current logged in user session - * - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun logoutUser() : Unit { - val localVariableBody: kotlin.Any? = null - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.GET, - "/user/logout", - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param user Updated user object - * @return void - * @throws UnsupportedOperationException If the API returns an informational or redirection response - * @throws ClientException If the API returns a client error response - * @throws ServerException If the API returns a server error response - */ - @Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class) - fun updateUser(username: kotlin.String, user: User) : Unit { - val localVariableBody: kotlin.Any? = user - val localVariableQuery: MultiValueMap = mutableMapOf() - val localVariableHeaders: MutableMap = mutableMapOf() - val localVariableConfig = RequestConfig( - RequestMethod.PUT, - "/user/{username}".replace("{"+"username"+"}", "$username"), - query = localVariableQuery, - headers = localVariableHeaders - ) - val localVarResponse = request( - localVariableConfig, - localVariableBody - ) - - return when (localVarResponse.responseType) { - ResponseType.Success -> Unit - ResponseType.Informational -> throw UnsupportedOperationException("Client does not support Informational responses.") - ResponseType.Redirection -> throw UnsupportedOperationException("Client does not support Redirection responses.") - ResponseType.ClientError -> { - val localVarError = localVarResponse as ClientError<*> - throw ClientException("Client error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - ResponseType.ServerError -> { - val localVarError = localVarResponse as ServerError<*> - throw ServerException("Server error : ${localVarError.statusCode} ${localVarError.message.orEmpty()}", localVarError.statusCode, localVarResponse) - } - } - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt deleted file mode 100644 index ef7a8f1e1a6..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiAbstractions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -typealias MultiValueMap = MutableMap> - -fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) { - "csv" -> "," - "tsv" -> "\t" - "pipe" -> "|" - "space" -> " " - else -> "" -} - -val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" } - -fun toMultiValue(items: Array, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter) - = toMultiValue(items.asIterable(), collectionFormat, map) - -fun toMultiValue(items: Iterable, collectionFormat: String, map: (item: T) -> String = defaultMultiValueConverter): List { - return when(collectionFormat) { - "multi" -> items.map(map) - else -> listOf(items.joinToString(separator = collectionDelimiter(collectionFormat), transform = map)) - } -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt deleted file mode 100644 index 08a44c8c6cd..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt +++ /dev/null @@ -1,257 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Credentials -import okhttp3.OkHttpClient -import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.FormBody -import okhttp3.HttpUrl.Companion.toHttpUrlOrNull -import okhttp3.ResponseBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.Headers -import okhttp3.MultipartBody -import java.io.File -import java.net.URLConnection -import java.util.Date -import java.time.LocalDate -import java.time.LocalDateTime -import java.time.LocalTime -import java.time.OffsetDateTime -import java.time.OffsetTime - -open class ApiClient(val baseUrl: String) { - companion object { - protected const val ContentType = "Content-Type" - protected const val Accept = "Accept" - protected const val Authorization = "Authorization" - protected const val JsonMediaType = "application/json" - protected const val FormDataMediaType = "multipart/form-data" - protected const val FormUrlEncMediaType = "application/x-www-form-urlencoded" - protected const val XmlMediaType = "application/xml" - - val apiKey: MutableMap = mutableMapOf() - val apiKeyPrefix: MutableMap = mutableMapOf() - var username: String? = null - var password: String? = null - var accessToken: String? = null - - @JvmStatic - val client: OkHttpClient by lazy { - builder.build() - } - - @JvmStatic - val builder: OkHttpClient.Builder = OkHttpClient.Builder() - } - - /** - * Guess Content-Type header from the given file (defaults to "application/octet-stream"). - * - * @param file The given file - * @return The guessed Content-Type - */ - protected fun guessContentTypeFromFile(file: File): String { - val contentType = URLConnection.guessContentTypeFromName(file.name) - return contentType ?: "application/octet-stream" - } - - protected inline fun requestBody(content: T, mediaType: String = JsonMediaType): RequestBody = - when { - content is File -> content.asRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == FormDataMediaType -> { - MultipartBody.Builder() - .setType(MultipartBody.FORM) - .apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - if (value is File) { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"; filename=\"${value.name}\"" - ) - val fileMediaType = guessContentTypeFromFile(value).toMediaTypeOrNull() - addPart(partHeaders, value.asRequestBody(fileMediaType)) - } else { - val partHeaders = Headers.headersOf( - "Content-Disposition", - "form-data; name=\"$key\"" - ) - addPart( - partHeaders, - parameterToString(value).toRequestBody(null) - ) - } - } - }.build() - } - mediaType == FormUrlEncMediaType -> { - FormBody.Builder().apply { - // content's type *must* be Map - @Suppress("UNCHECKED_CAST") - (content as Map).forEach { (key, value) -> - add(key, parameterToString(value)) - } - }.build() - } - mediaType == JsonMediaType -> Serializer.moshi.adapter(T::class.java).toJson(content).toRequestBody( - mediaType.toMediaTypeOrNull() - ) - mediaType == XmlMediaType -> throw UnsupportedOperationException("xml not currently supported.") - // TODO: this should be extended with other serializers - else -> throw UnsupportedOperationException("requestBody currently only supports JSON body and File body.") - } - - protected inline fun responseBody(body: ResponseBody?, mediaType: String? = JsonMediaType): T? { - if(body == null) { - return null - } - val bodyContent = body.string() - if (bodyContent.isEmpty()) { - return null - } - return when(mediaType) { - JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(bodyContent) - else -> throw UnsupportedOperationException("responseBody currently only supports JSON body.") - } - } - - protected fun updateAuthParams(requestConfig: RequestConfig) { - if (requestConfig.headers["api_key"].isNullOrEmpty()) { - if (apiKey["api_key"] != null) { - if (apiKeyPrefix["api_key"] != null) { - requestConfig.headers["api_key"] = apiKeyPrefix["api_key"]!! + " " + apiKey["api_key"]!! - } else { - requestConfig.headers["api_key"] = apiKey["api_key"]!! - } - } - } - if (apiKey["AUTH_KEY"] != null) { - if (apiKeyPrefix["AUTH_KEY"] != null) { - } else { - } - } - } - if (requestConfig.headers[Authorization].isNullOrEmpty()) { - accessToken?.let { accessToken -> - requestConfig.headers[Authorization] = "Bearer $accessToken " - } - } - } - - protected inline fun request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse { - val httpUrl = baseUrl.toHttpUrlOrNull() ?: throw IllegalStateException("baseUrl is invalid.") - - // take authMethod from operation - updateAuthParams(requestConfig) - - val url = httpUrl.newBuilder() - .addPathSegments(requestConfig.path.trimStart('/')) - .apply { - requestConfig.query.forEach { query -> - query.value.forEach { queryValue -> - addQueryParameter(query.key, queryValue) - } - } - }.build() - - // take content-type/accept from spec or set to default (application/json) if not defined - if (requestConfig.headers[ContentType].isNullOrEmpty()) { - requestConfig.headers[ContentType] = JsonMediaType - } - if (requestConfig.headers[Accept].isNullOrEmpty()) { - requestConfig.headers[Accept] = JsonMediaType - } - val headers = requestConfig.headers - - if(headers[ContentType] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Content-Type header. This is required.") - } - - if(headers[Accept] ?: "" == "") { - throw kotlin.IllegalStateException("Missing Accept header. This is required.") - } - - // TODO: support multiple contentType options here. - val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase() - - val request = when (requestConfig.method) { - RequestMethod.DELETE -> Request.Builder().url(url).delete(requestBody(body, contentType)) - RequestMethod.GET -> Request.Builder().url(url) - RequestMethod.HEAD -> Request.Builder().url(url).head() - RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType)) - RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType)) - RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType)) - RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null) - }.apply { - headers.forEach { header -> addHeader(header.key, header.value) } - }.build() - - val response = client.newCall(request).execute() - val accept = response.header(ContentType)?.substringBefore(";")?.toLowerCase() - - // TODO: handle specific mapping types. e.g. Map> - when { - response.isRedirect -> return Redirection( - response.code, - response.headers.toMultimap() - ) - response.isInformational -> return Informational( - response.message, - response.code, - response.headers.toMultimap() - ) - response.isSuccessful -> return Success( - responseBody(response.body, accept), - response.code, - response.headers.toMultimap() - ) - response.isClientError -> return ClientError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - else -> return ServerError( - response.message, - response.body?.string(), - response.code, - response.headers.toMultimap() - ) - } - } - - protected fun parameterToString(value: Any?): String { - when (value) { - null -> { - return "" - } - is Array<*> -> { - return toMultiValue(value, "csv").toString() - } - is Iterable<*> -> { - return toMultiValue(value, "csv").toString() - } - is OffsetDateTime, is OffsetTime, is LocalDateTime, is LocalDate, is LocalTime, is Date -> { - return parseDateToQueryString(value) - } - else -> { - return value.toString() - } - } - } - - protected inline fun parseDateToQueryString(value : T): String { - /* - .replace("\"", "") converts the json object string to an actual string for the query parameter. - The moshi or gson adapter allows a more generic solution instead of trying to use a native - formatter. It also easily allows to provide a simple way to define a custom date format pattern - inside a gson/moshi adapter. - */ - return Serializer.moshi.adapter(T::class.java).toJson(value).replace("\"", "") - } -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt deleted file mode 100644 index 9dc8d8dbbfa..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApiInfrastructureResponse.kt +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.client.infrastructure - -enum class ResponseType { - Success, Informational, Redirection, ClientError, ServerError -} - -interface Response - -abstract class ApiInfrastructureResponse(val responseType: ResponseType): Response { - abstract val statusCode: Int - abstract val headers: Map> -} - -class Success( - val data: T, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -): ApiInfrastructureResponse(ResponseType.Success) - -class Informational( - val statusText: String, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Informational) - -class Redirection( - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.Redirection) - -class ClientError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> = mapOf() -) : ApiInfrastructureResponse(ResponseType.ClientError) - -class ServerError( - val message: String? = null, - val body: Any? = null, - override val statusCode: Int = -1, - override val headers: Map> -): ApiInfrastructureResponse(ResponseType.ServerError) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt deleted file mode 100644 index dd34bd48b2c..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ApplicationDelegates.kt +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.client.infrastructure - -import kotlin.properties.ReadWriteProperty -import kotlin.reflect.KProperty - -object ApplicationDelegates { - /** - * Provides a property delegate, allowing the property to be set once and only once. - * - * If unset (no default value), a get on the property will throw [IllegalStateException]. - */ - fun setOnce(defaultValue: T? = null) : ReadWriteProperty = SetOnce(defaultValue) - - private class SetOnce(defaultValue: T? = null) : ReadWriteProperty { - private var isSet = false - private var value: T? = defaultValue - - override fun getValue(thisRef: Any?, property: KProperty<*>): T { - return value ?: throw IllegalStateException("${property.name} not initialized") - } - - override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) { - if (!isSet) { - this.value = value - isSet = true - } - } - } -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt deleted file mode 100644 index ff5e2a81ee8..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ByteArrayAdapter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson - -class ByteArrayAdapter { - @ToJson - fun toJson(data: ByteArray): String = String(data) - - @FromJson - fun fromJson(data: String): ByteArray = data.toByteArray() -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt deleted file mode 100644 index b5310e71f13..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/Errors.kt +++ /dev/null @@ -1,18 +0,0 @@ -@file:Suppress("unused") -package org.openapitools.client.infrastructure - -import java.lang.RuntimeException - -open class ClientException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 123L - } -} - -open class ServerException(message: kotlin.String? = null, val statusCode: Int = -1, val response: Response? = null) : RuntimeException(message) { - - companion object { - private const val serialVersionUID: Long = 456L - } -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt deleted file mode 100644 index b2e1654479a..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDate -import java.time.format.DateTimeFormatter - -class LocalDateAdapter { - @ToJson - fun toJson(value: LocalDate): String { - return DateTimeFormatter.ISO_LOCAL_DATE.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDate { - return LocalDate.parse(value, DateTimeFormatter.ISO_LOCAL_DATE) - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt deleted file mode 100644 index e082db94811..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/LocalDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.LocalDateTime -import java.time.format.DateTimeFormatter - -class LocalDateTimeAdapter { - @ToJson - fun toJson(value: LocalDateTime): String { - return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): LocalDateTime { - return LocalDateTime.parse(value, DateTimeFormatter.ISO_LOCAL_DATE_TIME) - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt deleted file mode 100644 index 87437871a31..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/OffsetDateTimeAdapter.kt +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.time.OffsetDateTime -import java.time.format.DateTimeFormatter - -class OffsetDateTimeAdapter { - @ToJson - fun toJson(value: OffsetDateTime): String { - return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(value) - } - - @FromJson - fun fromJson(value: String): OffsetDateTime { - return OffsetDateTime.parse(value, DateTimeFormatter.ISO_OFFSET_DATE_TIME) - } - -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt deleted file mode 100644 index 9c22257e223..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt +++ /dev/null @@ -1,16 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Defines a config object for a given request. - * NOTE: This object doesn't include 'body' because it - * allows for caching of the constructed object - * for many request definitions. - * NOTE: Headers is a Map because rfc2616 defines - * multi-valued headers as csv-only. - */ -data class RequestConfig( - val method: RequestMethod, - val path: String, - val headers: MutableMap = mutableMapOf(), - val query: MutableMap> = mutableMapOf() -) \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt deleted file mode 100644 index 931b12b8bd7..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt +++ /dev/null @@ -1,8 +0,0 @@ -package org.openapitools.client.infrastructure - -/** - * Provides enumerated HTTP verbs - */ -enum class RequestMethod { - GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT -} \ No newline at end of file diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt deleted file mode 100644 index 69b562becb0..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/ResponseExtensions.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import okhttp3.Response - -/** - * Provides an extension to evaluation whether the response is a 1xx code - */ -val Response.isInformational : Boolean get() = this.code in 100..199 - -/** - * Provides an extension to evaluation whether the response is a 3xx code - */ -val Response.isRedirect : Boolean get() = this.code in 300..399 - -/** - * Provides an extension to evaluation whether the response is a 4xx code - */ -val Response.isClientError : Boolean get() = this.code in 400..499 - -/** - * Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code - */ -val Response.isServerError : Boolean get() = this.code in 500..999 diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt deleted file mode 100644 index 697559b2ec1..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/Serializer.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.Moshi -import com.squareup.moshi.adapters.Rfc3339DateJsonAdapter -import com.squareup.moshi.kotlin.reflect.KotlinJsonAdapterFactory -import java.util.Date - -object Serializer { - @JvmStatic - val moshiBuilder: Moshi.Builder = Moshi.Builder() - .add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe()) - .add(OffsetDateTimeAdapter()) - .add(LocalDateTimeAdapter()) - .add(LocalDateAdapter()) - .add(UUIDAdapter()) - .add(ByteArrayAdapter()) - .add(KotlinJsonAdapterFactory()) - - @JvmStatic - val moshi: Moshi by lazy { - moshiBuilder.build() - } -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt deleted file mode 100644 index a4a44cc18b7..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/infrastructure/UUIDAdapter.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools.client.infrastructure - -import com.squareup.moshi.FromJson -import com.squareup.moshi.ToJson -import java.util.UUID - -class UUIDAdapter { - @ToJson - fun toJson(uuid: UUID) = uuid.toString() - - @FromJson - fun fromJson(s: String) = UUID.fromString(s) -} diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt deleted file mode 100644 index ada15fee7a1..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/ApiResponse.kt +++ /dev/null @@ -1,31 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * Describes the result of uploading an image resource - * @param code - * @param type - * @param message - */ - -data class ApiResponse ( - @Json(name = "code") - val code: kotlin.Int? = null, - @Json(name = "type") - val type: kotlin.String? = null, - @Json(name = "message") - val message: kotlin.String? = null -) - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Category.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Category.kt deleted file mode 100644 index 426a0e51592..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Category.kt +++ /dev/null @@ -1,28 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * A category for a pet - * @param id - * @param name - */ - -data class Category ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/InlineObject.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/InlineObject.kt deleted file mode 100644 index 73dcb58e3f2..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/InlineObject.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - -data class InlineObject ( - /* Updated name of the pet */ - @Json(name = "name") - val name: kotlin.String? = null, - /* Updated status of the pet */ - @Json(name = "status") - val status: kotlin.String? = null -) - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt deleted file mode 100644 index 46a53dfc3d1..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/InlineObject1.kt +++ /dev/null @@ -1,30 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - */ - -data class InlineObject1 ( - /* Additional data to pass to server */ - @Json(name = "additionalMetadata") - val additionalMetadata: kotlin.String? = null, - /* file to upload */ - @Json(name = "file") - val file: java.io.File? = null -) - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Order.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Order.kt deleted file mode 100644 index a3579905fe6..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Order.kt +++ /dev/null @@ -1,54 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * An order for a pets from the pet store - * @param id - * @param petId - * @param quantity - * @param shipDate - * @param status Order Status - * @param complete - */ - -@Deprecated(message = "This schema is deprecated.") -data class Order ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "petId") - val petId: kotlin.Long? = null, - @Json(name = "quantity") - val quantity: kotlin.Int? = null, - @Json(name = "shipDate") - val shipDate: java.time.OffsetDateTime? = null, - /* Order Status */ - @Json(name = "status") - val status: Order.Status? = null, - @Json(name = "complete") - val complete: kotlin.Boolean? = null -) { - - /** - * Order Status - * Values: placed,approved,delivered - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "placed") placed("placed"), - @Json(name = "approved") approved("approved"), - @Json(name = "delivered") delivered("delivered"); - } -} - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Pet.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Pet.kt deleted file mode 100644 index 21385e1f877..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Pet.kt +++ /dev/null @@ -1,56 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - -import org.openapitools.client.models.Category -import org.openapitools.client.models.Tag - -import com.squareup.moshi.Json -/** - * A pet for sale in the pet store - * @param name - * @param photoUrls - * @param id - * @param category - * @param tags - * @param status pet status in the store - */ - -data class Pet ( - @Json(name = "name") - val name: kotlin.String?, - @Json(name = "photoUrls") - @Deprecated(message = "This property is deprecated.") - val photoUrls: kotlin.Array, - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "category") - val category: Category? = null, - @Json(name = "tags") - val tags: kotlin.Array? = null, - /* pet status in the store */ - @Json(name = "status") - val status: Pet.Status? = null -) { - - /** - * pet status in the store - * Values: available,pending,sold - */ - - enum class Status(val value: kotlin.String){ - @Json(name = "available") available("available"), - @Json(name = "pending") pending("pending"), - @Json(name = "sold") sold("sold"); - } -} - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Tag.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Tag.kt deleted file mode 100644 index f9ef87e13fb..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/Tag.kt +++ /dev/null @@ -1,28 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * A tag for a pet - * @param id - * @param name - */ - -data class Tag ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "name") - val name: kotlin.String? = null -) - diff --git a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/User.kt b/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/User.kt deleted file mode 100644 index dfd63806da9..00000000000 --- a/samples/openapi3/client/petstore/kotlin-deprecated/src/main/kotlin/org/openapitools/client/models/User.kt +++ /dev/null @@ -1,47 +0,0 @@ -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -package org.openapitools.client.models - - -import com.squareup.moshi.Json -/** - * A User who is purchasing from the pet store - * @param id - * @param username - * @param firstName - * @param lastName - * @param email - * @param password - * @param phone - * @param userStatus User Status - */ - -data class User ( - @Json(name = "id") - val id: kotlin.Long? = null, - @Json(name = "username") - val username: kotlin.String? = null, - @Json(name = "firstName") - val firstName: kotlin.String? = null, - @Json(name = "lastName") - val lastName: kotlin.String? = null, - @Json(name = "email") - val email: kotlin.String? = null, - @Json(name = "password") - val password: kotlin.String? = null, - @Json(name = "phone") - val phone: kotlin.String? = null, - /* User Status */ - @Json(name = "userStatus") - val userStatus: kotlin.Int? = null -) - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index 35ea30e5650..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "$another-fake?", description = "the $another-fake? API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "call123testSpecialTags", - summary = "To test special tags", - description = "To test special tags and operation ID starting with number", - tags = { "$another-fake?" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 3dd9767a5b1..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,588 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createXmlItem", - summary = "creates an XmlItem", - description = "this route creates an XmlItem", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/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" } - ) - default ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @Operation( - operationId = "fakeOuterBooleanSerialize", - description = "Test serialization of outer boolean types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @Operation( - operationId = "fakeOuterCompositeSerialize", - description = "Test serialization of object with outer number type", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @Operation( - operationId = "fakeOuterNumberSerialize", - description = "Test serialization of outer number types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @Operation( - operationId = "fakeOuterStringSerialize", - description = "Test serialization of outer string types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithFileSchema", - description = "For this test, the body for this request much reference a schema named `File`.", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithQueryParams", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClientModel", - summary = "To test \"client\" model", - description = "To test \"client\" model", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "testEndpointParameters", - summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - }, - security = { - @SecurityRequirement(name = "http_basic_test") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestParam(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestParam(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestParam(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestParam(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestParam(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @Operation( - operationId = "testEnumParameters", - summary = "To test enum parameters", - description = "To test enum parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid request"), - @ApiResponse(responseCode = "404", description = "Not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - */ - @Operation( - operationId = "testGroupParameters", - summary = "Fake endpoint to test group parameters (optional)", - description = "Fake endpoint to test group parameters (optional)", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Something wrong") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testInlineAdditionalProperties", - summary = "test inline additionalProperties", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testJsonFormData", - summary = "test json serialization of form data", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testQueryParameterCollectionFormat", - description = "To test the collection format in query parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFileWithRequiredFile", - summary = "uploads an image (required)", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index edd955ebd4b..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClassname", - summary = "To test class name in snake case", - description = "To test class name in snake case", - tags = { "fake_classname_tags 123#$%^" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key_query") - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index c3af0a00f6e..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,383 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "pet", description = "Everything about your Pets") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @Operation( - operationId = "addPet", - summary = "Add a new pet to the store", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @Operation( - operationId = "deletePet", - summary = "Deletes a pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid pet value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @Operation( - operationId = "findPetsByStatus", - summary = "Finds Pets by status", - description = "Multiple status values can be provided with comma separated strings", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid status value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @Operation( - operationId = "findPetsByTags", - summary = "Finds Pets by tags", - description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid tag value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @Operation( - operationId = "getPetById", - summary = "Find pet by ID", - description = "Returns a single pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @Operation( - operationId = "updatePet", - summary = "Update an existing pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @Operation( - operationId = "updatePetWithForm", - summary = "Updates a pet in the store with form data", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFile", - summary = "uploads an image", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 287e254e09b..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "store", description = "Access to Petstore orders") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @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", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getInventory", - summary = "Returns pet inventories by status", - description = "Returns a map of status codes to quantities", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @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", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @Operation( - operationId = "placeOrder", - summary = "Place an order for a pet", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid Order") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 6210f9fdc5a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "user", description = "Operations about user") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUser", - summary = "Create user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithArrayInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithListInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "deleteUser", - summary = "Delete user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "getUserByName", - summary = "Get user by user name", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @Operation( - operationId = "loginUser", - summary = "Logs user into the system", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "logoutUser", - summary = "Logs out current logged in user session", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "updateUser", - summary = "Updated user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 38c62f8a00e..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = ; - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("ArrayArrayNumber") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index fb6a073750a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = ; - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("ArrayNumber") - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index 54c8c21ef28..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @Valid - private List arrayOfString = null; - - @Valid - private List> arrayArrayOfInteger = null; - - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = ; - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("array_of_string") - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = ; - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("array_array_of_integer") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = ; - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("array_array_of_model") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 88a67562412..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("just_symbol") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = ; - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("array_enum") - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 2562c3ab08f..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List<@Valid File> files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List<@Valid File> files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = ; - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid File> getFiles() { - return files; - } - - public void setFiles(List<@Valid File> files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index abae02f7f68..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,283 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List<@Valid Tag> tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - /** - * Default constructor - * @deprecated Use {@link Pet#Pet(String, Set)} - */ - @Deprecated - public Pet() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Pet(String name, Set photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - if (this.photoUrls == null) { - this.photoUrls = new LinkedHashSet<>(); - } - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List<@Valid Tag> tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = ; - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid Tag> getTags() { - return tags; - } - - public void setTags(List<@Valid Tag> tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index bed4f577bd2..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,838 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - private String attributeString; - - private BigDecimal attributeNumber; - - private Integer attributeInteger; - - private Boolean attributeBoolean; - - @Valid - private List wrappedArray = null; - - private String nameString; - - private BigDecimal nameNumber; - - private Integer nameInteger; - - private Boolean nameBoolean; - - @Valid - private List nameArray = null; - - @Valid - private List nameWrappedArray = null; - - private String prefixString; - - private BigDecimal prefixNumber; - - private Integer prefixInteger; - - private Boolean prefixBoolean; - - @Valid - private List prefixArray = null; - - @Valid - private List prefixWrappedArray = null; - - private String namespaceString; - - private BigDecimal namespaceNumber; - - private Integer namespaceInteger; - - private Boolean namespaceBoolean; - - @Valid - private List namespaceArray = null; - - @Valid - private List namespaceWrappedArray = null; - - private String prefixNsString; - - private BigDecimal prefixNsNumber; - - private Integer prefixNsInteger; - - private Boolean prefixNsBoolean; - - @Valid - private List prefixNsArray = null; - - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("attribute_string") - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("attribute_number") - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("attribute_integer") - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("attribute_boolean") - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = ; - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("wrapped_array") - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name_string") - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name_number") - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name_integer") - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name_boolean") - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = ; - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name_array") - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = ; - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("name_wrapped_array") - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_string") - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_number") - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_integer") - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_boolean") - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = ; - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_array") - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = ; - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_wrapped_array") - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("namespace_string") - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("namespace_number") - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("namespace_integer") - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("namespace_boolean") - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = ; - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("namespace_array") - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = ; - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("namespace_wrapped_array") - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_ns_string") - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_ns_number") - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_ns_integer") - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_ns_boolean") - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = ; - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_ns_array") - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = ; - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - @JsonProperty("prefix_ns_wrapped_array") - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index 1c09d4049bc..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "$another-fake?", description = "the $another-fake? API") -public interface AnotherFakeApi { - - default AnotherFakeApiDelegate getDelegate() { - return new AnotherFakeApiDelegate() {}; - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "call123testSpecialTags", - summary = "To test special tags", - description = "To test special tags and operation ID starting with number", - tags = { "$another-fake?" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default Mono> call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().call123testSpecialTags(body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 98e2d279bf4..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,561 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake", description = "the fake API") -public interface FakeApi { - - default FakeApiDelegate getDelegate() { - return new FakeApiDelegate() {}; - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createXmlItem", - summary = "creates an XmlItem", - description = "this route creates an XmlItem", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/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" } - ) - default Mono> createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createXmlItem(xmlItem, exchange); - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @Operation( - operationId = "fakeOuterBooleanSerialize", - description = "Test serialization of outer boolean types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default Mono> fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterBooleanSerialize(body, exchange); - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @Operation( - operationId = "fakeOuterCompositeSerialize", - description = "Test serialization of object with outer number type", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default Mono> fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterCompositeSerialize(body, exchange); - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @Operation( - operationId = "fakeOuterNumberSerialize", - description = "Test serialization of outer number types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default Mono> fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterNumberSerialize(body, exchange); - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @Operation( - operationId = "fakeOuterStringSerialize", - description = "Test serialization of outer string types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default Mono> fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterStringSerialize(body, exchange); - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithFileSchema", - description = "For this test, the body for this request much reference a schema named `File`.", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default Mono> testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testBodyWithFileSchema(body, exchange); - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithQueryParams", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default Mono> testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testBodyWithQueryParams(query, body, exchange); - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClientModel", - summary = "To test \"client\" model", - description = "To test \"client\" model", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default Mono> testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testClientModel(body, exchange); - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "testEndpointParameters", - summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - }, - security = { - @SecurityRequirement(name = "http_basic_test") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestParam(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestParam(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestParam(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestParam(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) Flux binary, - @Parameter(name = "date", description = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestParam(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @Operation( - operationId = "testEnumParameters", - summary = "To test enum parameters", - description = "To test enum parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid request"), - @ApiResponse(responseCode = "404", description = "Not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - */ - @Operation( - operationId = "testGroupParameters", - summary = "Fake endpoint to test group parameters (optional)", - description = "Fake endpoint to test group parameters (optional)", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Something wrong") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default Mono> testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testInlineAdditionalProperties", - summary = "test inline additionalProperties", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default Mono> testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Mono> param, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testInlineAdditionalProperties(param, exchange); - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testJsonFormData", - summary = "test json serialization of form data", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testJsonFormData(param, param2, exchange); - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testQueryParameterCollectionFormat", - description = "To test the collection format in query parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default Mono> testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFileWithRequiredFile", - summary = "uploads an image (required)", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default Mono> uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index fff595c7a16..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") -public interface FakeClassnameTestApi { - - default FakeClassnameTestApiDelegate getDelegate() { - return new FakeClassnameTestApiDelegate() {}; - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClassname", - summary = "To test class name in snake case", - description = "To test class name in snake case", - tags = { "fake_classname_tags 123#$%^" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key_query") - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default Mono> testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testClassname(body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index cc181539908..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,332 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "pet", description = "Everything about your Pets") -public interface PetApi { - - default PetApiDelegate getDelegate() { - return new PetApiDelegate() {}; - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @Operation( - operationId = "addPet", - summary = "Add a new pet to the store", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default Mono> addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().addPet(body, exchange); - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @Operation( - operationId = "deletePet", - summary = "Deletes a pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid pet value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default Mono> deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().deletePet(petId, apiKey, exchange); - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @Operation( - operationId = "findPetsByStatus", - summary = "Finds Pets by status", - description = "Multiple status values can be provided with comma separated strings", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid status value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default Mono>> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().findPetsByStatus(status, exchange); - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @Operation( - operationId = "findPetsByTags", - summary = "Finds Pets by tags", - description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid tag value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default Mono>> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().findPetsByTags(tags, exchange); - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @Operation( - operationId = "getPetById", - summary = "Find pet by ID", - description = "Returns a single pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default Mono> getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getPetById(petId, exchange); - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @Operation( - operationId = "updatePet", - summary = "Update an existing pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default Mono> updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().updatePet(body, exchange); - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @Operation( - operationId = "updatePetWithForm", - summary = "Updates a pet in the store with form data", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().updatePetWithForm(petId, name, status, exchange); - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFile", - summary = "uploads an image", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default Mono> uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) Flux file, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 8830f58acaa..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "store", description = "Access to Petstore orders") -public interface StoreApi { - - default StoreApiDelegate getDelegate() { - return new StoreApiDelegate() {}; - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @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", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default Mono> deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().deleteOrder(orderId, exchange); - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getInventory", - summary = "Returns pet inventories by status", - description = "Returns a map of status codes to quantities", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default Mono>> getInventory( - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getInventory(exchange); - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @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", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default Mono> getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getOrderById(orderId, exchange); - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @Operation( - operationId = "placeOrder", - summary = "Place an order for a pet", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid Order") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default Mono> placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().placeOrder(body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 63aa74751a2..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,279 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "user", description = "Operations about user") -public interface UserApi { - - default UserApiDelegate getDelegate() { - return new UserApiDelegate() {}; - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUser", - summary = "Create user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default Mono> createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createUser(body, exchange); - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithArrayInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default Mono> createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody Flux body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createUsersWithArrayInput(body, exchange); - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithListInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default Mono> createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody Flux body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createUsersWithListInput(body, exchange); - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "deleteUser", - summary = "Delete user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default Mono> deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().deleteUser(username, exchange); - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "getUserByName", - summary = "Get user by user name", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default Mono> getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getUserByName(username, exchange); - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @Operation( - operationId = "loginUser", - summary = "Logs user into the system", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default Mono> loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().loginUser(username, password, exchange); - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "logoutUser", - summary = "Logs out current logged in user session", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default Mono> logoutUser( - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().logoutUser(exchange); - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "updateUser", - summary = "Updated user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default Mono> updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().updateUser(username, body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index 35ea30e5650..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "$another-fake?", description = "the $another-fake? API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "call123testSpecialTags", - summary = "To test special tags", - description = "To test special tags and operation ID starting with number", - tags = { "$another-fake?" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index df4af8812f3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,588 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createXmlItem", - summary = "creates an XmlItem", - description = "this route creates an XmlItem", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/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" } - ) - default ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @Operation( - operationId = "fakeOuterBooleanSerialize", - description = "Test serialization of outer boolean types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @Operation( - operationId = "fakeOuterCompositeSerialize", - description = "Test serialization of object with outer number type", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @Operation( - operationId = "fakeOuterNumberSerialize", - description = "Test serialization of outer number types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @Operation( - operationId = "fakeOuterStringSerialize", - description = "Test serialization of outer string types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithFileSchema", - description = "For this test, the body for this request much reference a schema named `File`.", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithQueryParams", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClientModel", - summary = "To test \"client\" model", - description = "To test \"client\" model", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "testEndpointParameters", - summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - }, - security = { - @SecurityRequirement(name = "http_basic_test") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestParam(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestParam(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestParam(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestParam(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestParam(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @Operation( - operationId = "testEnumParameters", - summary = "To test enum parameters", - description = "To test enum parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid request"), - @ApiResponse(responseCode = "404", description = "Not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - */ - @Operation( - operationId = "testGroupParameters", - summary = "Fake endpoint to test group parameters (optional)", - description = "Fake endpoint to test group parameters (optional)", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Something wrong") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testInlineAdditionalProperties", - summary = "test inline additionalProperties", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testJsonFormData", - summary = "test json serialization of form data", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testQueryParameterCollectionFormat", - description = "To test the collection format in query parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFileWithRequiredFile", - summary = "uploads an image (required)", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index edd955ebd4b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClassname", - summary = "To test class name in snake case", - description = "To test class name in snake case", - tags = { "fake_classname_tags 123#$%^" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key_query") - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index 271d7b7533b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,383 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "pet", description = "Everything about your Pets") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @Operation( - operationId = "addPet", - summary = "Add a new pet to the store", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @Operation( - operationId = "deletePet", - summary = "Deletes a pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid pet value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) Optional apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @Operation( - operationId = "findPetsByStatus", - summary = "Finds Pets by status", - description = "Multiple status values can be provided with comma separated strings", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid status value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @Operation( - operationId = "findPetsByTags", - summary = "Finds Pets by tags", - description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid tag value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @Operation( - operationId = "getPetById", - summary = "Find pet by ID", - description = "Returns a single pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @Operation( - operationId = "updatePet", - summary = "Update an existing pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @Operation( - operationId = "updatePetWithForm", - summary = "Updates a pet in the store with form data", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFile", - summary = "uploads an image", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 287e254e09b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "store", description = "Access to Petstore orders") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @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", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getInventory", - summary = "Returns pet inventories by status", - description = "Returns a map of status codes to quantities", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @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", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @Operation( - operationId = "placeOrder", - summary = "Place an order for a pet", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid Order") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 6210f9fdc5a..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "user", description = "Operations about user") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUser", - summary = "Create user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithArrayInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithListInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "deleteUser", - summary = "Delete user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "getUserByName", - summary = "Get user by user name", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @Operation( - operationId = "loginUser", - summary = "Logs user into the system", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "logoutUser", - summary = "Logs out current logged in user session", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "updateUser", - summary = "Updated user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java deleted file mode 100644 index 0f6ef89155f..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for AdditionalPropertiesClass - */ -public class AdditionalPropertiesClassTest { - private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); - - /** - * Model tests for AdditionalPropertiesClass - */ - @Test - public void testAdditionalPropertiesClass() { - // TODO: test AdditionalPropertiesClass - } - - /** - * Test the property 'mapProperty' - */ - @Test - public void mapPropertyTest() { - // TODO: test mapProperty - } - - /** - * Test the property 'mapOfMapProperty' - */ - @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java deleted file mode 100644 index d67cac0b059..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ArrayOfArrayOfNumberOnly - */ -public class ArrayOfArrayOfNumberOnlyTest { - private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); - - /** - * Model tests for ArrayOfArrayOfNumberOnly - */ - @Test - public void testArrayOfArrayOfNumberOnly() { - // TODO: test ArrayOfArrayOfNumberOnly - } - - /** - * Test the property 'arrayArrayNumber' - */ - @Test - public void arrayArrayNumberTest() { - // TODO: test arrayArrayNumber - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ArrayTestTest.java deleted file mode 100644 index a2d4f750e1c..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ArrayTestTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.ReadOnlyFirst; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ArrayTest - */ -public class ArrayTestTest { - private final ArrayTest model = new ArrayTest(); - - /** - * Model tests for ArrayTest - */ - @Test - public void testArrayTest() { - // TODO: test ArrayTest - } - - /** - * Test the property 'arrayOfString' - */ - @Test - public void arrayOfStringTest() { - // TODO: test arrayOfString - } - - /** - * Test the property 'arrayArrayOfInteger' - */ - @Test - public void arrayArrayOfIntegerTest() { - // TODO: test arrayArrayOfInteger - } - - /** - * Test the property 'arrayArrayOfModel' - */ - @Test - public void arrayArrayOfModelTest() { - // TODO: test arrayArrayOfModel - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CapitalizationTest.java deleted file mode 100644 index 084a2885fc8..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CapitalizationTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Capitalization - */ -public class CapitalizationTest { - private final Capitalization model = new Capitalization(); - - /** - * Model tests for Capitalization - */ - @Test - public void testCapitalization() { - // TODO: test Capitalization - } - - /** - * Test the property 'smallCamel' - */ - @Test - public void smallCamelTest() { - // TODO: test smallCamel - } - - /** - * Test the property 'capitalCamel' - */ - @Test - public void capitalCamelTest() { - // TODO: test capitalCamel - } - - /** - * Test the property 'smallSnake' - */ - @Test - public void smallSnakeTest() { - // TODO: test smallSnake - } - - /** - * Test the property 'capitalSnake' - */ - @Test - public void capitalSnakeTest() { - // TODO: test capitalSnake - } - - /** - * Test the property 'scAETHFlowPoints' - */ - @Test - public void scAETHFlowPointsTest() { - // TODO: test scAETHFlowPoints - } - - /** - * Test the property 'ATT_NAME' - */ - @Test - public void ATT_NAMETest() { - // TODO: test ATT_NAME - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CatTest.java deleted file mode 100644 index 9ca42bb5996..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CatTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Animal; -import org.openapitools.server.model.CatAllOf; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Cat - */ -public class CatTest { - private final Cat model = new Cat(); - - /** - * Model tests for Cat - */ - @Test - public void testCat() { - // TODO: test Cat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CategoryTest.java deleted file mode 100644 index 2618c8fd934..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/CategoryTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Category - */ -public class CategoryTest { - private final Category model = new Category(); - - /** - * Model tests for Category - */ - @Test - public void testCategory() { - // TODO: test Category - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ClientTest.java deleted file mode 100644 index a9f4c21ebf8..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ClientTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Client - */ -public class ClientTest { - private final Client model = new Client(); - - /** - * Model tests for Client - */ - @Test - public void testClient() { - // TODO: test Client - } - - /** - * Test the property 'client' - */ - @Test - public void clientTest() { - // TODO: test client - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java deleted file mode 100644 index 9ad380437ce..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for DeprecatedObject - */ -public class DeprecatedObjectTest { - private final DeprecatedObject model = new DeprecatedObject(); - - /** - * Model tests for DeprecatedObject - */ - @Test - public void testDeprecatedObject() { - // TODO: test DeprecatedObject - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/DogTest.java deleted file mode 100644 index 11fad95bc99..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/DogTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Animal; -import org.openapitools.server.model.DogAllOf; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Dog - */ -public class DogTest { - private final Dog model = new Dog(); - - /** - * Model tests for Dog - */ - @Test - public void testDog() { - // TODO: test Dog - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'breed' - */ - @Test - public void breedTest() { - // TODO: test breed - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/EnumClassTest.java deleted file mode 100644 index 9c02e17dac0..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/EnumClassTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for EnumClass - */ -public class EnumClassTest { - /** - * Model tests for EnumClass - */ - @Test - public void testEnumClass() { - // TODO: test EnumClass - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/EnumTestTest.java deleted file mode 100644 index 7c95fed8bb8..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/EnumTestTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import org.openapitools.server.model.OuterEnum; -import org.openapitools.server.model.OuterEnumDefaultValue; -import org.openapitools.server.model.OuterEnumInteger; -import org.openapitools.server.model.OuterEnumIntegerDefaultValue; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for EnumTest - */ -public class EnumTestTest { - private final EnumTest model = new EnumTest(); - - /** - * Model tests for EnumTest - */ - @Test - public void testEnumTest() { - // TODO: test EnumTest - } - - /** - * Test the property 'enumString' - */ - @Test - public void enumStringTest() { - // TODO: test enumString - } - - /** - * Test the property 'enumStringRequired' - */ - @Test - public void enumStringRequiredTest() { - // TODO: test enumStringRequired - } - - /** - * Test the property 'enumInteger' - */ - @Test - public void enumIntegerTest() { - // TODO: test enumInteger - } - - /** - * Test the property 'enumNumber' - */ - @Test - public void enumNumberTest() { - // TODO: test enumNumber - } - - /** - * Test the property 'outerEnum' - */ - @Test - public void outerEnumTest() { - // TODO: test outerEnum - } - - /** - * Test the property 'outerEnumInteger' - */ - @Test - public void outerEnumIntegerTest() { - // TODO: test outerEnumInteger - } - - /** - * Test the property 'outerEnumDefaultValue' - */ - @Test - public void outerEnumDefaultValueTest() { - // TODO: test outerEnumDefaultValue - } - - /** - * Test the property 'outerEnumIntegerDefaultValue' - */ - @Test - public void outerEnumIntegerDefaultValueTest() { - // TODO: test outerEnumIntegerDefaultValue - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java deleted file mode 100644 index fbabc01db3c..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.ModelFile; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for FileSchemaTestClass - */ -public class FileSchemaTestClassTest { - private final FileSchemaTestClass model = new FileSchemaTestClass(); - - /** - * Model tests for FileSchemaTestClass - */ - @Test - public void testFileSchemaTestClass() { - // TODO: test FileSchemaTestClass - } - - /** - * Test the property '_file' - */ - @Test - public void _fileTest() { - // TODO: test _file - } - - /** - * Test the property 'files' - */ - @Test - public void filesTest() { - // TODO: test files - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java deleted file mode 100644 index d0dc33cef52..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.server.model.Foo; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for FooGetDefaultResponse - */ -public class FooGetDefaultResponseTest { - private final FooGetDefaultResponse model = new FooGetDefaultResponse(); - - /** - * Model tests for FooGetDefaultResponse - */ - @Test - public void testFooGetDefaultResponse() { - // TODO: test FooGetDefaultResponse - } - - /** - * Test the property 'string' - */ - @Test - public void stringTest() { - // TODO: test string - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FooTest.java deleted file mode 100644 index 39abe05aad6..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/FooTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Foo - */ -public class FooTest { - private final Foo model = new Foo(); - - /** - * Model tests for Foo - */ - @Test - public void testFoo() { - // TODO: test Foo - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java deleted file mode 100644 index 5a56ddcc24d..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for HasOnlyReadOnly - */ -public class HasOnlyReadOnlyTest { - private final HasOnlyReadOnly model = new HasOnlyReadOnly(); - - /** - * Model tests for HasOnlyReadOnly - */ - @Test - public void testHasOnlyReadOnly() { - // TODO: test HasOnlyReadOnly - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'foo' - */ - @Test - public void fooTest() { - // TODO: test foo - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java deleted file mode 100644 index be4be735e57..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for HealthCheckResult - */ -public class HealthCheckResultTest { - private final HealthCheckResult model = new HealthCheckResult(); - - /** - * Model tests for HealthCheckResult - */ - @Test - public void testHealthCheckResult() { - // TODO: test HealthCheckResult - } - - /** - * Test the property 'nullableMessage' - */ - @Test - public void nullableMessageTest() { - // TODO: test nullableMessage - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java deleted file mode 100644 index 70ba5b36b5c..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.server.model.Animal; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { - private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); - - /** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ - @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { - // TODO: test MixedPropertiesAndAdditionalPropertiesClass - } - - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } - - /** - * Test the property 'dateTime' - */ - @Test - public void dateTimeTest() { - // TODO: test dateTime - } - - /** - * Test the property 'map' - */ - @Test - public void mapTest() { - // TODO: test map - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/Model200ResponseTest.java deleted file mode 100644 index 33b6d47572d..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/Model200ResponseTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Model200Response - */ -public class Model200ResponseTest { - private final Model200Response model = new Model200Response(); - - /** - * Model tests for Model200Response - */ - @Test - public void testModel200Response() { - // TODO: test Model200Response - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'propertyClass' - */ - @Test - public void propertyClassTest() { - // TODO: test propertyClass - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/NullableClassTest.java deleted file mode 100644 index e2f2dd91bf7..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/NullableClassTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for NullableClass - */ -public class NullableClassTest { - private final NullableClass model = new NullableClass(); - - /** - * Model tests for NullableClass - */ - @Test - public void testNullableClass() { - // TODO: test NullableClass - } - - /** - * Test the property 'integerProp' - */ - @Test - public void integerPropTest() { - // TODO: test integerProp - } - - /** - * Test the property 'numberProp' - */ - @Test - public void numberPropTest() { - // TODO: test numberProp - } - - /** - * Test the property 'booleanProp' - */ - @Test - public void booleanPropTest() { - // TODO: test booleanProp - } - - /** - * Test the property 'stringProp' - */ - @Test - public void stringPropTest() { - // TODO: test stringProp - } - - /** - * Test the property 'dateProp' - */ - @Test - public void datePropTest() { - // TODO: test dateProp - } - - /** - * Test the property 'datetimeProp' - */ - @Test - public void datetimePropTest() { - // TODO: test datetimeProp - } - - /** - * Test the property 'arrayNullableProp' - */ - @Test - public void arrayNullablePropTest() { - // TODO: test arrayNullableProp - } - - /** - * Test the property 'arrayAndItemsNullableProp' - */ - @Test - public void arrayAndItemsNullablePropTest() { - // TODO: test arrayAndItemsNullableProp - } - - /** - * Test the property 'arrayItemsNullable' - */ - @Test - public void arrayItemsNullableTest() { - // TODO: test arrayItemsNullable - } - - /** - * Test the property 'objectNullableProp' - */ - @Test - public void objectNullablePropTest() { - // TODO: test objectNullableProp - } - - /** - * Test the property 'objectAndItemsNullableProp' - */ - @Test - public void objectAndItemsNullablePropTest() { - // TODO: test objectAndItemsNullableProp - } - - /** - * Test the property 'objectItemsNullable' - */ - @Test - public void objectItemsNullableTest() { - // TODO: test objectItemsNullable - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/NumberOnlyTest.java deleted file mode 100644 index dede232a8fa..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/NumberOnlyTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for NumberOnly - */ -public class NumberOnlyTest { - private final NumberOnly model = new NumberOnly(); - - /** - * Model tests for NumberOnly - */ - @Test - public void testNumberOnly() { - // TODO: test NumberOnly - } - - /** - * Test the property 'justNumber' - */ - @Test - public void justNumberTest() { - // TODO: test justNumber - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/OrderTest.java deleted file mode 100644 index 90607655525..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/OrderTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Order - */ -public class OrderTest { - private final Order model = new Order(); - - /** - * Model tests for Order - */ - @Test - public void testOrder() { - // TODO: test Order - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'petId' - */ - @Test - public void petIdTest() { - // TODO: test petId - } - - /** - * Test the property 'quantity' - */ - @Test - public void quantityTest() { - // TODO: test quantity - } - - /** - * Test the property 'shipDate' - */ - @Test - public void shipDateTest() { - // TODO: test shipDate - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } - - /** - * Test the property 'complete' - */ - @Test - public void completeTest() { - // TODO: test complete - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java deleted file mode 100644 index 55d00b4918c..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OuterEnumDefaultValue - */ -public class OuterEnumDefaultValueTest { - /** - * Model tests for OuterEnumDefaultValue - */ - @Test - public void testOuterEnumDefaultValue() { - // TODO: test OuterEnumDefaultValue - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java deleted file mode 100644 index 2fe4c7fc6b7..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ReadOnlyFirst - */ -public class ReadOnlyFirstTest { - private final ReadOnlyFirst model = new ReadOnlyFirst(); - - /** - * Model tests for ReadOnlyFirst - */ - @Test - public void testReadOnlyFirst() { - // TODO: test ReadOnlyFirst - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'baz' - */ - @Test - public void bazTest() { - // TODO: test baz - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java deleted file mode 100644 index 4ae2c23f4cb..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SingleRefType - */ -public class SingleRefTypeTest { - /** - * Model tests for SingleRefType - */ - @Test - public void testSingleRefType() { - // TODO: test SingleRefType - } - -} diff --git a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/UserTest.java deleted file mode 100644 index ba936a20805..00000000000 --- a/samples/server/helidon/se/petstore-default/src/test/java/org/openapitools/server/model/UserTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for User - */ -public class UserTest { - private final User model = new User(); - - /** - * Model tests for User - */ - @Test - public void testUser() { - // TODO: test User - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'username' - */ - @Test - public void usernameTest() { - // TODO: test username - } - - /** - * Test the property 'firstName' - */ - @Test - public void firstNameTest() { - // TODO: test firstName - } - - /** - * Test the property 'lastName' - */ - @Test - public void lastNameTest() { - // TODO: test lastName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'password' - */ - @Test - public void passwordTest() { - // TODO: test password - } - - /** - * Test the property 'phone' - */ - @Test - public void phoneTest() { - // TODO: test phone - } - - /** - * Test the property 'userStatus' - */ - @Test - public void userStatusTest() { - // TODO: test userStatus - } - -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator-ignore b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator/FILES b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator/FILES deleted file mode 100644 index 2d78823754e..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator/FILES +++ /dev/null @@ -1,37 +0,0 @@ -Org.OpenAPITools.sln -README.md -build.bat -build.sh -src/Org.OpenAPITools/.gitignore -src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs -src/Org.OpenAPITools/Authentication/ApiAuthentication.cs -src/Org.OpenAPITools/Controllers/FakeApi.cs -src/Org.OpenAPITools/Controllers/PetApi.cs -src/Org.OpenAPITools/Controllers/StoreApi.cs -src/Org.OpenAPITools/Controllers/UserApi.cs -src/Org.OpenAPITools/Converters/CustomEnumConverter.cs -src/Org.OpenAPITools/Dockerfile -src/Org.OpenAPITools/Filters/BasePathFilter.cs -src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs -src/Org.OpenAPITools/Formatters/InputFormatterStream.cs -src/Org.OpenAPITools/Models/Animal.cs -src/Org.OpenAPITools/Models/ApiResponse.cs -src/Org.OpenAPITools/Models/Cat.cs -src/Org.OpenAPITools/Models/CatAllOf.cs -src/Org.OpenAPITools/Models/Category.cs -src/Org.OpenAPITools/Models/Dog.cs -src/Org.OpenAPITools/Models/DogAllOf.cs -src/Org.OpenAPITools/Models/Order.cs -src/Org.OpenAPITools/Models/Pet.cs -src/Org.OpenAPITools/Models/Tag.cs -src/Org.OpenAPITools/Models/User.cs -src/Org.OpenAPITools/OpenApi/TypeExtensions.cs -src/Org.OpenAPITools/Org.OpenAPITools.csproj -src/Org.OpenAPITools/Program.cs -src/Org.OpenAPITools/Properties/launchSettings.json -src/Org.OpenAPITools/Startup.cs -src/Org.OpenAPITools/appsettings.Development.json -src/Org.OpenAPITools/appsettings.json -src/Org.OpenAPITools/wwwroot/README.md -src/Org.OpenAPITools/wwwroot/index.html -src/Org.OpenAPITools/wwwroot/openapi-original.json diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/Org.OpenAPITools.sln deleted file mode 100644 index c2bc3876420..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/Org.OpenAPITools.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2043 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/README.md b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/README.md deleted file mode 100644 index 34e589967c7..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Org.OpenAPITools - ASP.NET Core 6.0 Server - -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -## Upgrade NuGet Packages - -NuGet packages get frequently updated. - -To upgrade this solution to the latest version of all NuGet packages, use the dotnet-outdated tool. - - -Install dotnet-outdated tool: - -``` -dotnet tool install --global dotnet-outdated-tool -``` - -Upgrade only to new minor versions of packages - -``` -dotnet outdated --upgrade --version-lock Major -``` - -Upgrade to all new versions of packages (more likely to include breaking API changes) - -``` -dotnet outdated --upgrade -``` - - -## Run - -Linux/OS X: - -``` -sh build.sh -``` - -Windows: - -``` -build.bat -``` -## Run in Docker - -``` -cd src/Org.OpenAPITools -docker build -t org.openapitools . -docker run -p 5000:8080 org.openapitools -``` diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/build.bat b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/build.bat deleted file mode 100644 index cd65518e428..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/build.bat +++ /dev/null @@ -1,9 +0,0 @@ -:: Generated by: https://openapi-generator.tech -:: - -@echo off - -dotnet restore src\Org.OpenAPITools -dotnet build src\Org.OpenAPITools -echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. -echo. diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/build.sh b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/build.sh deleted file mode 100644 index afbeddb8378..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# -# Generated by: https://openapi-generator.tech -# - -dotnet restore src/Org.OpenAPITools/ && \ - dotnet build src/Org.OpenAPITools/ && \ - echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/.gitignore deleted file mode 100644 index 1ee53850b84..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/.gitignore +++ /dev/null @@ -1,362 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs deleted file mode 100644 index 23ad6fd6c06..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Reflection; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Controllers; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.Mvc.ModelBinding; - -namespace Org.OpenAPITools.Attributes -{ - /// - /// Model state validation attribute - /// - public class ValidateModelStateAttribute : ActionFilterAttribute - { - /// - /// Called before the action method is invoked - /// - /// - public override void OnActionExecuting(ActionExecutingContext context) - { - // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ - if (context.ActionDescriptor is ControllerActionDescriptor descriptor) - { - foreach (var parameter in descriptor.MethodInfo.GetParameters()) - { - object args = null; - if (context.ActionArguments.ContainsKey(parameter.Name)) - { - args = context.ActionArguments[parameter.Name]; - } - - ValidateAttributes(parameter, args, context.ModelState); - } - } - - if (!context.ModelState.IsValid) - { - context.Result = new BadRequestObjectResult(context.ModelState); - } - } - - private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) - { - foreach (var attributeData in parameter.CustomAttributes) - { - var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); - - if (attributeInstance is ValidationAttribute validationAttribute) - { - var isValid = validationAttribute.IsValid(args); - if (!isValid) - { - modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); - } - } - } - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs deleted file mode 100644 index 85be8593fce..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc.Filters; - -namespace Org.OpenAPITools.Authentication -{ - /// - /// A requirement that an ApiKey must be present. - /// - public class ApiKeyRequirement : IAuthorizationRequirement - { - /// - /// Get the list of api keys - /// - public IReadOnlyList ApiKeys { get; } - - /// - /// Get the policy name, - /// - public string PolicyName { get; } - - /// - /// Create a new instance of the class. - /// - /// - /// - public ApiKeyRequirement(IEnumerable apiKeys, string policyName) - { - ApiKeys = apiKeys?.ToList() ?? new List(); - PolicyName = policyName; - } - } - - /// - /// Enforce that an api key is present. - /// - public class ApiKeyRequirementHandler : AuthorizationHandler - { - /// - protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) - { - SucceedRequirementIfApiKeyPresentAndValid(context, requirement); - return Task.CompletedTask; - } - - private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) - { - - if (context.Resource is AuthorizationFilterContext authorizationFilterContext) - { - var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); - if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) - { - context.Succeed(requirement); - } - } - - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/FakeApi.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/FakeApi.cs deleted file mode 100644 index 155edd3e86f..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/FakeApi.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Http; -using Swashbuckle.AspNetCore.Annotations; -using Swashbuckle.AspNetCore.SwaggerGen; -using System.Text.Json; -using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; - -namespace Org.OpenAPITools.Controllers -{ - /// - /// - /// - [ApiController] - public class FakeApiController : ControllerBase - { - /// - /// fake endpoint to test parameter example (object) - /// - /// - /// successful operation - [HttpGet] - [Route("/v2/fake/parameter_example_test")] - [ValidateModelState] - [SwaggerOperation("FakeParameterExampleTest")] - public virtual IActionResult FakeParameterExampleTest([FromQuery (Name = "data")][Required()]Pet data) - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/PetApi.cs deleted file mode 100644 index 775c265eb5d..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/PetApi.cs +++ /dev/null @@ -1,260 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Http; -using Swashbuckle.AspNetCore.Annotations; -using Swashbuckle.AspNetCore.SwaggerGen; -using System.Text.Json; -using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; - -namespace Org.OpenAPITools.Controllers -{ - /// - /// - /// - [ApiController] - public class PetApiController : ControllerBase - { - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// successful operation - /// Invalid input - [HttpPost] - [Route("/v2/pet")] - [Consumes("application/json", "application/xml")] - [ValidateModelState] - [SwaggerOperation("AddPet")] - [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] - public virtual IActionResult AddPet([FromBody]Pet pet) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Pet)); - //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(405); - string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; - exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(Pet); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// Invalid pet value - [HttpDelete] - [Route("/v2/pet/{petId}")] - [ValidateModelState] - [SwaggerOperation("DeletePet")] - public virtual IActionResult DeletePet([FromRoute (Name = "petId")][Required]long petId, [FromHeader]string apiKey) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - - throw new NotImplementedException(); - } - - /// - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - /// Status values that need to be considered for filter (deprecated) - /// successful operation - /// Invalid status value - [HttpGet] - [Route("/v2/pet/findByStatus")] - [ValidateModelState] - [SwaggerOperation("FindPetsByStatus")] - [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] - public virtual IActionResult FindPetsByStatus([FromQuery (Name = "status")][Required()]List status) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(List)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; - exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize>(exampleJson) - : default(List); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// Tags to filter by - /// successful operation - /// Invalid tag value - [HttpGet] - [Route("/v2/pet/findByTags")] - [ValidateModelState] - [SwaggerOperation("FindPetsByTags")] - [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] - [Obsolete] - public virtual IActionResult FindPetsByTags([FromQuery (Name = "tags")][Required()]List tags) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(List)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - exampleJson = "[ {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}, {\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n} ]"; - exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize>(exampleJson) - : default(List); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Find pet by ID - /// - /// Returns a single pet - /// ID of pet to return - /// successful operation - /// Invalid ID supplied - /// Pet not found - [HttpGet] - [Route("/v2/pet/{petId}")] - [Authorize(Policy = "api_key")] - [ValidateModelState] - [SwaggerOperation("GetPetById")] - [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] - public virtual IActionResult GetPetById([FromRoute (Name = "petId")][Required]long petId) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Pet)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; - exampleJson = "\n 123456789\n \n 123456789\n aeiou\n \n doggie\n \n aeiou\n \n \n \n 123456789\n aeiou\n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(Pet); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// successful operation - /// Invalid ID supplied - /// Pet not found - /// Validation exception - [HttpPut] - [Route("/v2/pet")] - [Consumes("application/json", "application/xml")] - [ValidateModelState] - [SwaggerOperation("UpdatePet")] - [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] - public virtual IActionResult UpdatePet([FromBody]Pet pet) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Pet)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(405); - string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; - exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(Pet); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// Invalid input - [HttpPost] - [Route("/v2/pet/{petId}")] - [Consumes("application/x-www-form-urlencoded")] - [ValidateModelState] - [SwaggerOperation("UpdatePetWithForm")] - public virtual IActionResult UpdatePetWithForm([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "name")]string name, [FromForm (Name = "status")]string status) - { - - //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(405); - - throw new NotImplementedException(); - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// successful operation - [HttpPost] - [Route("/v2/pet/{petId}/uploadImage")] - [Consumes("multipart/form-data")] - [ValidateModelState] - [SwaggerOperation("UploadFile")] - [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] - public virtual IActionResult UploadFile([FromRoute (Name = "petId")][Required]long petId, [FromForm (Name = "additionalMetadata")]string additionalMetadata, IFormFile file) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(ApiResponse)); - string exampleJson = null; - exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(ApiResponse); - //TODO: Change the data returned - return new ObjectResult(example); - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/StoreApi.cs deleted file mode 100644 index 2c52f026791..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Http; -using Swashbuckle.AspNetCore.Annotations; -using Swashbuckle.AspNetCore.SwaggerGen; -using System.Text.Json; -using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; - -namespace Org.OpenAPITools.Controllers -{ - /// - /// - /// - [ApiController] - public class StoreApiController : ControllerBase - { - /// - /// Delete purchase order by ID - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// ID of the order that needs to be deleted - /// Invalid ID supplied - /// Order not found - [HttpDelete] - [Route("/v2/store/order/{orderId}")] - [ValidateModelState] - [SwaggerOperation("DeleteOrder")] - public virtual IActionResult DeleteOrder([FromRoute (Name = "orderId")][Required]string orderId) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - - throw new NotImplementedException(); - } - - /// - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - /// successful operation - [HttpGet] - [Route("/v2/store/inventory")] - [Authorize(Policy = "api_key")] - [ValidateModelState] - [SwaggerOperation("GetInventory")] - [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] - public virtual IActionResult GetInventory() - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Dictionary)); - string exampleJson = null; - - var example = exampleJson != null - ? JsonSerializer.Deserialize>(exampleJson) - : new Dictionary(); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Find purchase order by ID - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// ID of pet that needs to be fetched - /// successful operation - /// Invalid ID supplied - /// Order not found - [HttpGet] - [Route("/v2/store/order/{orderId}")] - [ValidateModelState] - [SwaggerOperation("GetOrderById")] - [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] - public virtual IActionResult GetOrderById([FromRoute (Name = "orderId")][Required][Range(1, 5)]long orderId) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Order)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - string exampleJson = null; - exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; - exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(Order); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// successful operation - /// Invalid Order - [HttpPost] - [Route("/v2/store/order")] - [Consumes("application/json")] - [ValidateModelState] - [SwaggerOperation("PlaceOrder")] - [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] - public virtual IActionResult PlaceOrder([FromBody]Order order) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Order)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; - exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(Order); - //TODO: Change the data returned - return new ObjectResult(example); - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/UserApi.cs deleted file mode 100644 index 5a0951513f3..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Controllers/UserApi.cs +++ /dev/null @@ -1,218 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Http; -using Swashbuckle.AspNetCore.Annotations; -using Swashbuckle.AspNetCore.SwaggerGen; -using System.Text.Json; -using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; - -namespace Org.OpenAPITools.Controllers -{ - /// - /// - /// - [ApiController] - public class UserApiController : ControllerBase - { - /// - /// Create user - /// - /// This can only be done by the logged in user. - /// Created user object - /// successful operation - [HttpPost] - [Route("/v2/user")] - [Authorize(Policy = "api_key")] - [Consumes("application/json")] - [ValidateModelState] - [SwaggerOperation("CreateUser")] - public virtual IActionResult CreateUser([FromBody]User user) - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - [HttpPost] - [Route("/v2/user/createWithArray")] - [Authorize(Policy = "api_key")] - [Consumes("application/json")] - [ValidateModelState] - [SwaggerOperation("CreateUsersWithArrayInput")] - public virtual IActionResult CreateUsersWithArrayInput([FromBody]List user) - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - [HttpPost] - [Route("/v2/user/createWithList")] - [Authorize(Policy = "api_key")] - [Consumes("application/json")] - [ValidateModelState] - [SwaggerOperation("CreateUsersWithListInput")] - public virtual IActionResult CreateUsersWithListInput([FromBody]List user) - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Delete user - /// - /// This can only be done by the logged in user. - /// The name that needs to be deleted - /// Invalid username supplied - /// User not found - [HttpDelete] - [Route("/v2/user/{username}")] - [Authorize(Policy = "api_key")] - [ValidateModelState] - [SwaggerOperation("DeleteUser")] - public virtual IActionResult DeleteUser([FromRoute (Name = "username")][Required]string username) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - - throw new NotImplementedException(); - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// successful operation - /// Invalid username supplied - /// User not found - [HttpGet] - [Route("/v2/user/{username}")] - [ValidateModelState] - [SwaggerOperation("GetUserByName")] - [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] - public virtual IActionResult GetUserByName([FromRoute (Name = "username")][Required]string username) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(User)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - string exampleJson = null; - exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; - exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(User); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// successful operation - /// Invalid username/password supplied - [HttpGet] - [Route("/v2/user/login")] - [ValidateModelState] - [SwaggerOperation("LoginUser")] - [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] - public virtual IActionResult LoginUser([FromQuery (Name = "username")][Required()][RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")]string username, [FromQuery (Name = "password")][Required()]string password) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(string)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - - var example = exampleJson != null - ? JsonSerializer.Deserialize(exampleJson) - : default(string); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Logs out current logged in user session - /// - /// successful operation - [HttpGet] - [Route("/v2/user/logout")] - [Authorize(Policy = "api_key")] - [ValidateModelState] - [SwaggerOperation("LogoutUser")] - public virtual IActionResult LogoutUser() - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Updated user - /// - /// This can only be done by the logged in user. - /// name that need to be deleted - /// Updated user object - /// Invalid user supplied - /// User not found - [HttpPut] - [Route("/v2/user/{username}")] - [Authorize(Policy = "api_key")] - [Consumes("application/json")] - [ValidateModelState] - [SwaggerOperation("UpdateUser")] - public virtual IActionResult UpdateUser([FromRoute (Name = "username")][Required]string username, [FromBody]User user) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - - throw new NotImplementedException(); - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs deleted file mode 100644 index 5fc6c72fb6c..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.ComponentModel; -using System.Globalization; -using System.Text.Json; - -namespace Org.OpenAPITools.Converters -{ - /// - /// Custom string to enum converter - /// - public class CustomEnumConverter : TypeConverter - { - /// - /// Determine if we can convert a type to an enum - /// - /// - /// - /// - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); - } - - /// - /// Convert from a type value to an enum - /// - /// - /// - /// - /// - public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) - { - var s = value as string; - if (string.IsNullOrEmpty(s)) - { - return null; - } - - return JsonSerializer.Deserialize(@"""" + value + @""""); - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Dockerfile deleted file mode 100644 index 7184e1ece4d..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. - -# Container we use for final publish -FROM mcr.microsoft.com/dotnet/core/aspnet:6.0-buster-slim AS base -WORKDIR /app -EXPOSE 80 -EXPOSE 443 - -# Build container -FROM mcr.microsoft.com/dotnet/core/sdk:6.0-buster AS build - -# Copy the code into the container -WORKDIR /src -COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] - -# NuGet restore -RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" -COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] - -# Build the API -WORKDIR "Org.OpenAPITools" -RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build - -# Publish it -FROM build AS publish -RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish - -# Make the final image for publishing -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Filters/BasePathFilter.cs deleted file mode 100644 index a2385451076..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Filters/BasePathFilter.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Linq; -using System.Text.RegularExpressions; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace Org.OpenAPITools.Filters -{ - /// - /// BasePath Document Filter sets BasePath property of OpenAPI and removes it from the individual URL paths - /// - public class BasePathFilter : IDocumentFilter - { - /// - /// Constructor - /// - /// BasePath to remove from Operations - public BasePathFilter(string basePath) - { - BasePath = basePath; - } - - /// - /// Gets the BasePath of the OpenAPI Doc - /// - /// The BasePath of the OpenAPI Doc - public string BasePath { get; } - - /// - /// Apply the filter - /// - /// OpenApiDocument - /// FilterContext - public void Apply(OpenApiDocument openapiDoc, DocumentFilterContext context) - { - //openapiDoc.BasePath = BasePath; - - var pathsToModify = openapiDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); - - foreach (var (key, value) in pathsToModify) - { - if (key.StartsWith(BasePath)) - { - var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); - openapiDoc.Paths.Remove(key); - openapiDoc.Paths.Add(newKey, value); - } - } - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs deleted file mode 100644 index 65d9d469520..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Linq; -using Microsoft.AspNetCore.Mvc.Controllers; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace Org.OpenAPITools.Filters -{ - /// - /// Path Parameter Validation Rules Filter - /// - public class GeneratePathParamsValidationFilter : IOperationFilter - { - /// - /// Constructor - /// - /// Operation - /// OperationFilterContext - public void Apply(OpenApiOperation operation, OperationFilterContext context) - { - var pars = context.ApiDescription.ParameterDescriptions; - - foreach (var par in pars) - { - var openapiParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); - - var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); - - // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 - // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 - // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema - if (attributes.Any() && openapiParam != null) - { - // Required - [Required] - var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); - if (requiredAttr != null) - { - openapiParam.Required = true; - } - - // Regex Pattern [RegularExpression] - var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); - if (regexAttr != null) - { - var regex = (string)regexAttr.ConstructorArguments[0].Value; - openapiParam.Schema.Pattern = regex; - } - - // String Length [StringLength] - int? minLength = null, maxLength = null; - var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); - if (stringLengthAttr != null) - { - if (stringLengthAttr.NamedArguments.Count == 1) - { - minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; - } - maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; - } - - var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); - if (minLengthAttr != null) - { - minLength = (int)minLengthAttr.ConstructorArguments[0].Value; - } - - var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); - if (maxLengthAttr != null) - { - maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; - } - - if (minLength != null) - { - openapiParam.Schema.MinLength = minLength; - } - - if (maxLength != null) - { - openapiParam.Schema.MaxLength = maxLength; - } - - // Range [Range] - var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); - if (rangeAttr != null) - { - var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; - var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; - - openapiParam.Schema.MinLength = rangeMin; - openapiParam.Schema.MaxLength = rangeMax; - } - } - } - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs deleted file mode 100644 index 8285e7d6a0b..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Formatters/InputFormatterStream.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.IO; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Formatters; - -namespace Org.OpenAPITools.Formatters -{ - /// - public class InputFormatterStream : InputFormatter - { - /// - public InputFormatterStream() - { - SupportedMediaTypes.Add("application/octet-stream"); - SupportedMediaTypes.Add("image/jpeg"); - } - - /// - public override Task ReadRequestBodyAsync(InputFormatterContext context) - { - return InputFormatterResult.SuccessAsync(context.HttpContext.Request.Body); - } - - /// - protected override bool CanReadType(Type type) - { - if (type == typeof(Stream)) - { - return true; - } - - return false; - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Animal.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Animal.cs deleted file mode 100644 index 6172a1b27e9..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Animal.cs +++ /dev/null @@ -1,146 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using JsonSubTypes; -using Swashbuckle.AspNetCore.Annotations; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// - /// - [DataContract] - [SwaggerDiscriminator("ClassName")] - [JsonSubtypes.KnownSubType(typeof(Cat), "CAT")] - [SwaggerSubType(typeof(Cat), DiscriminatorValue = "CAT")] - [JsonSubtypes.KnownSubType(typeof(Dog), "DOG")] - [SwaggerSubType(typeof(Dog), DiscriminatorValue = "DOG")] - public partial class Animal : IEquatable - { - /// - /// Gets or Sets ClassName - /// - [Required] - [DataMember(Name="className", EmitDefaultValue=false)] - public string ClassName { get; set; } - - /// - /// Gets or Sets Color - /// - [DataMember(Name="color", EmitDefaultValue=false)] - public string Color { get; set; } = "red"; - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Animal {\n"); - sb.Append(" ClassName: ").Append(ClassName).Append("\n"); - sb.Append(" Color: ").Append(Color).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Animal)obj); - } - - /// - /// Returns true if Animal instances are equal - /// - /// Instance of Animal to be compared - /// Boolean - public bool Equals(Animal other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - ClassName == other.ClassName || - ClassName != null && - ClassName.Equals(other.ClassName) - ) && - ( - Color == other.Color || - Color != null && - Color.Equals(other.Color) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - if (ClassName != null) - hashCode = hashCode * 59 + ClassName.GetHashCode(); - if (Color != null) - hashCode = hashCode * 59 + Color.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Animal left, Animal right) - { - return Equals(left, right); - } - - public static bool operator !=(Animal left, Animal right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/ApiResponse.cs deleted file mode 100644 index 9362efa8367..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/ApiResponse.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// Describes the result of uploading an image resource - /// - [DataContract] - public partial class ApiResponse : IEquatable - { - /// - /// Gets or Sets Code - /// - [DataMember(Name="code", EmitDefaultValue=true)] - public int Code { get; set; } - - /// - /// Gets or Sets Type - /// - [DataMember(Name="type", EmitDefaultValue=false)] - public string Type { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name="message", EmitDefaultValue=false)] - public string Message { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ApiResponse {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((ApiResponse)obj); - } - - /// - /// Returns true if ApiResponse instances are equal - /// - /// Instance of ApiResponse to be compared - /// Boolean - public bool Equals(ApiResponse other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Code == other.Code || - - Code.Equals(other.Code) - ) && - ( - Type == other.Type || - Type != null && - Type.Equals(other.Type) - ) && - ( - Message == other.Message || - Message != null && - Message.Equals(other.Message) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Code.GetHashCode(); - if (Type != null) - hashCode = hashCode * 59 + Type.GetHashCode(); - if (Message != null) - hashCode = hashCode * 59 + Message.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(ApiResponse left, ApiResponse right) - { - return Equals(left, right); - } - - public static bool operator !=(ApiResponse left, ApiResponse right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Cat.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Cat.cs deleted file mode 100644 index 01639d12eed..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Cat.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// - /// - [DataContract] - public partial class Cat : Animal, IEquatable - { - /// - /// Gets or Sets Declawed - /// - [DataMember(Name="declawed", EmitDefaultValue=true)] - public bool Declawed { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Cat {\n"); - sb.Append(" Declawed: ").Append(Declawed).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public new string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Cat)obj); - } - - /// - /// Returns true if Cat instances are equal - /// - /// Instance of Cat to be compared - /// Boolean - public bool Equals(Cat other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Declawed == other.Declawed || - - Declawed.Equals(other.Declawed) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Declawed.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Cat left, Cat right) - { - return Equals(left, right); - } - - public static bool operator !=(Cat left, Cat right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/CatAllOf.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/CatAllOf.cs deleted file mode 100644 index e16bd27ef53..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/CatAllOf.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// - /// - [DataContract] - public partial class CatAllOf : IEquatable - { - /// - /// Gets or Sets Declawed - /// - [DataMember(Name="declawed", EmitDefaultValue=true)] - public bool Declawed { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class CatAllOf {\n"); - sb.Append(" Declawed: ").Append(Declawed).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((CatAllOf)obj); - } - - /// - /// Returns true if CatAllOf instances are equal - /// - /// Instance of CatAllOf to be compared - /// Boolean - public bool Equals(CatAllOf other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Declawed == other.Declawed || - - Declawed.Equals(other.Declawed) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Declawed.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(CatAllOf left, CatAllOf right) - { - return Equals(left, right); - } - - public static bool operator !=(CatAllOf left, CatAllOf right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Category.cs deleted file mode 100644 index 11eac79c541..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Category.cs +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A category for a pet - /// - [DataContract] - public partial class Category : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=true)] - public long Id { get; set; } - - /// - /// Gets or Sets Name - /// - [RegularExpression("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")] - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Category)obj); - } - - /// - /// Returns true if Category instances are equal - /// - /// Instance of Category to be compared - /// Boolean - public bool Equals(Category other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Name == other.Name || - Name != null && - Name.Equals(other.Name) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Name != null) - hashCode = hashCode * 59 + Name.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Category left, Category right) - { - return Equals(left, right); - } - - public static bool operator !=(Category left, Category right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Dog.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Dog.cs deleted file mode 100644 index c08f6b036d9..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Dog.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// - /// - [DataContract] - public partial class Dog : Animal, IEquatable - { - /// - /// Gets or Sets Breed - /// - [DataMember(Name="breed", EmitDefaultValue=false)] - public string Breed { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Dog {\n"); - sb.Append(" Breed: ").Append(Breed).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public new string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Dog)obj); - } - - /// - /// Returns true if Dog instances are equal - /// - /// Instance of Dog to be compared - /// Boolean - public bool Equals(Dog other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Breed == other.Breed || - Breed != null && - Breed.Equals(other.Breed) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - if (Breed != null) - hashCode = hashCode * 59 + Breed.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Dog left, Dog right) - { - return Equals(left, right); - } - - public static bool operator !=(Dog left, Dog right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/DogAllOf.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/DogAllOf.cs deleted file mode 100644 index 8d4e1ea1750..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/DogAllOf.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// - /// - [DataContract] - public partial class DogAllOf : IEquatable - { - /// - /// Gets or Sets Breed - /// - [DataMember(Name="breed", EmitDefaultValue=false)] - public string Breed { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class DogAllOf {\n"); - sb.Append(" Breed: ").Append(Breed).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((DogAllOf)obj); - } - - /// - /// Returns true if DogAllOf instances are equal - /// - /// Instance of DogAllOf to be compared - /// Boolean - public bool Equals(DogAllOf other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Breed == other.Breed || - Breed != null && - Breed.Equals(other.Breed) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - if (Breed != null) - hashCode = hashCode * 59 + Breed.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(DogAllOf left, DogAllOf right) - { - return Equals(left, right); - } - - public static bool operator !=(DogAllOf left, DogAllOf right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Order.cs deleted file mode 100644 index b7385cfe794..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Order.cs +++ /dev/null @@ -1,223 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// An order for a pets from the pet store - /// - [DataContract] - public partial class Order : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=true)] - public long Id { get; set; } - - /// - /// Gets or Sets PetId - /// - [DataMember(Name="petId", EmitDefaultValue=true)] - public long PetId { get; set; } - - /// - /// Gets or Sets Quantity - /// - [DataMember(Name="quantity", EmitDefaultValue=true)] - public int Quantity { get; set; } - - /// - /// Gets or Sets ShipDate - /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime ShipDate { get; set; } - - - /// - /// Order Status - /// - /// Order Status - - public enum StatusEnum - { - - /// - /// Enum PlacedEnum for placed - /// - [EnumMember(Value = "placed")] - PlacedEnum = 1, - - /// - /// Enum ApprovedEnum for approved - /// - [EnumMember(Value = "approved")] - ApprovedEnum = 2, - - /// - /// Enum DeliveredEnum for delivered - /// - [EnumMember(Value = "delivered")] - DeliveredEnum = 3 - } - - /// - /// Order Status - /// - /// Order Status - [DataMember(Name="status", EmitDefaultValue=true)] - public StatusEnum Status { get; set; } - - /// - /// Gets or Sets Complete - /// - [DataMember(Name="complete", EmitDefaultValue=true)] - public bool Complete { get; set; } = false; - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Order {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Order)obj); - } - - /// - /// Returns true if Order instances are equal - /// - /// Instance of Order to be compared - /// Boolean - public bool Equals(Order other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - PetId == other.PetId || - - PetId.Equals(other.PetId) - ) && - ( - Quantity == other.Quantity || - - Quantity.Equals(other.Quantity) - ) && - ( - ShipDate == other.ShipDate || - ShipDate != null && - ShipDate.Equals(other.ShipDate) - ) && - ( - Status == other.Status || - - Status.Equals(other.Status) - ) && - ( - Complete == other.Complete || - - Complete.Equals(other.Complete) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - - hashCode = hashCode * 59 + PetId.GetHashCode(); - - hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) - hashCode = hashCode * 59 + ShipDate.GetHashCode(); - - hashCode = hashCode * 59 + Status.GetHashCode(); - - hashCode = hashCode * 59 + Complete.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Order left, Order right) - { - return Equals(left, right); - } - - public static bool operator !=(Order left, Order right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Pet.cs deleted file mode 100644 index b78b4afb783..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Pet.cs +++ /dev/null @@ -1,228 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A pet for sale in the pet store - /// - [DataContract] - public partial class Pet : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=true)] - public long Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name="category", EmitDefaultValue=false)] - public Category Category { get; set; } - - /// - /// Gets or Sets Name - /// - /// "doggie" - [Required] - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Gets or Sets PhotoUrls - /// - [Required] - [DataMember(Name="photoUrls", EmitDefaultValue=false)] - public List PhotoUrls { get; set; } - - /// - /// Gets or Sets Tags - /// - [DataMember(Name="tags", EmitDefaultValue=false)] - public List Tags { get; set; } - - - /// - /// pet status in the store - /// - /// pet status in the store - - public enum StatusEnum - { - - /// - /// Enum AvailableEnum for available - /// - [EnumMember(Value = "available")] - AvailableEnum = 1, - - /// - /// Enum PendingEnum for pending - /// - [EnumMember(Value = "pending")] - PendingEnum = 2, - - /// - /// Enum SoldEnum for sold - /// - [EnumMember(Value = "sold")] - SoldEnum = 3 - } - - /// - /// pet status in the store - /// - /// pet status in the store - [DataMember(Name="status", EmitDefaultValue=true)] - public StatusEnum Status { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Pet)obj); - } - - /// - /// Returns true if Pet instances are equal - /// - /// Instance of Pet to be compared - /// Boolean - public bool Equals(Pet other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Category == other.Category || - Category != null && - Category.Equals(other.Category) - ) && - ( - Name == other.Name || - Name != null && - Name.Equals(other.Name) - ) && - ( - PhotoUrls == other.PhotoUrls || - PhotoUrls != null && - other.PhotoUrls != null && - PhotoUrls.SequenceEqual(other.PhotoUrls) - ) && - ( - Tags == other.Tags || - Tags != null && - other.Tags != null && - Tags.SequenceEqual(other.Tags) - ) && - ( - Status == other.Status || - - Status.Equals(other.Status) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Category != null) - hashCode = hashCode * 59 + Category.GetHashCode(); - if (Name != null) - hashCode = hashCode * 59 + Name.GetHashCode(); - if (PhotoUrls != null) - hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); - if (Tags != null) - hashCode = hashCode * 59 + Tags.GetHashCode(); - - hashCode = hashCode * 59 + Status.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Pet left, Pet right) - { - return Equals(left, right); - } - - public static bool operator !=(Pet left, Pet right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Tag.cs deleted file mode 100644 index 0a40e7f333e..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/Tag.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A tag for a pet - /// - [DataContract] - public partial class Tag : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=true)] - public long Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Tag {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Tag)obj); - } - - /// - /// Returns true if Tag instances are equal - /// - /// Instance of Tag to be compared - /// Boolean - public bool Equals(Tag other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Name == other.Name || - Name != null && - Name.Equals(other.Name) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Name != null) - hashCode = hashCode * 59 + Name.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Tag left, Tag right) - { - return Equals(left, right); - } - - public static bool operator !=(Tag left, Tag right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/User.cs deleted file mode 100644 index 49dd6ebe212..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Models/User.cs +++ /dev/null @@ -1,223 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using System.Text.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A User who is purchasing from the pet store - /// - [DataContract] - public partial class User : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=true)] - public long Id { get; set; } - - /// - /// Gets or Sets Username - /// - [DataMember(Name="username", EmitDefaultValue=false)] - public string Username { get; set; } - - /// - /// Gets or Sets FirstName - /// - [DataMember(Name="firstName", EmitDefaultValue=false)] - public string FirstName { get; set; } - - /// - /// Gets or Sets LastName - /// - [DataMember(Name="lastName", EmitDefaultValue=false)] - public string LastName { get; set; } - - /// - /// Gets or Sets Email - /// - [DataMember(Name="email", EmitDefaultValue=false)] - public string Email { get; set; } - - /// - /// Gets or Sets Password - /// - [DataMember(Name="password", EmitDefaultValue=false)] - public string Password { get; set; } - - /// - /// Gets or Sets Phone - /// - [DataMember(Name="phone", EmitDefaultValue=false)] - public string Phone { get; set; } - - /// - /// User Status - /// - /// User Status - [DataMember(Name="userStatus", EmitDefaultValue=true)] - public int UserStatus { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class User {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - var options = new JsonSerializerOptions - { - WriteIndented = true - }; - - return JsonSerializer.Serialize(this, options); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((User)obj); - } - - /// - /// Returns true if User instances are equal - /// - /// Instance of User to be compared - /// Boolean - public bool Equals(User other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Username == other.Username || - Username != null && - Username.Equals(other.Username) - ) && - ( - FirstName == other.FirstName || - FirstName != null && - FirstName.Equals(other.FirstName) - ) && - ( - LastName == other.LastName || - LastName != null && - LastName.Equals(other.LastName) - ) && - ( - Email == other.Email || - Email != null && - Email.Equals(other.Email) - ) && - ( - Password == other.Password || - Password != null && - Password.Equals(other.Password) - ) && - ( - Phone == other.Phone || - Phone != null && - Phone.Equals(other.Phone) - ) && - ( - UserStatus == other.UserStatus || - - UserStatus.Equals(other.UserStatus) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Username != null) - hashCode = hashCode * 59 + Username.GetHashCode(); - if (FirstName != null) - hashCode = hashCode * 59 + FirstName.GetHashCode(); - if (LastName != null) - hashCode = hashCode * 59 + LastName.GetHashCode(); - if (Email != null) - hashCode = hashCode * 59 + Email.GetHashCode(); - if (Password != null) - hashCode = hashCode * 59 + Password.GetHashCode(); - if (Phone != null) - hashCode = hashCode * 59 + Phone.GetHashCode(); - - hashCode = hashCode * 59 + UserStatus.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(User left, User right) - { - return Equals(left, right); - } - - public static bool operator !=(User left, User right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs deleted file mode 100644 index b862226f2c1..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Linq; -using System.Text; - -namespace Org.OpenAPITools.OpenApi -{ - /// - /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x - /// - public static class TypeExtensions - { - /// - /// Produce a friendly name for the type which is unique. - /// - /// - /// - public static string FriendlyId(this Type type, bool fullyQualified = false) - { - var typeName = fullyQualified - ? type.FullNameSansTypeParameters().Replace("+", ".") - : type.Name; - - if (type.IsGenericType) - { - var genericArgumentIds = type.GetGenericArguments() - .Select(t => t.FriendlyId(fullyQualified)) - .ToArray(); - - return new StringBuilder(typeName) - .Replace($"`{genericArgumentIds.Count()}", string.Empty) - .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") - .ToString(); - } - - return typeName; - } - - /// - /// Determine the fully qualified type name without type parameters. - /// - /// - public static string FullNameSansTypeParameters(this Type type) - { - var fullName = type.FullName; - if (string.IsNullOrEmpty(fullName)) - fullName = type.Name; - var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); - return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Org.OpenAPITools.csproj deleted file mode 100644 index 7b20010d5bd..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - A library generated from a OpenAPI doc - No Copyright - OpenAPI - net6.0 - true - true - 1.0.0 - Org.OpenAPITools - Org.OpenAPITools - cb87e868-8646-48ef-9bb6-344b537d0d37 - Linux - ..\.. - - - - - - - - - - - - diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Program.cs deleted file mode 100644 index 00ed16ed675..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Program.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace Org.OpenAPITools -{ - /// - /// Program - /// - public class Program - { - /// - /// Main - /// - /// - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - /// - /// Create the host builder. - /// - /// - /// IHostBuilder - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup() - .UseUrls("http://0.0.0.0:8080/"); - }); - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Properties/launchSettings.json deleted file mode 100644 index 99cfeea4b91..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Properties/launchSettings.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:61788", - "sslPort": 44301 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "openapi", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "OpenAPI": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "openapi", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Docker": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/openapi", - "publishAllPorts": true, - "useSSL": true - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Startup.cs deleted file mode 100644 index 135dc1305bf..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/Startup.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.IO; -using System.Reflection; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.OpenApi.Models; -using System.Text.Json; -using System.Text.Json.Serialization; -using Org.OpenAPITools.Authentication; -using Org.OpenAPITools.Filters; -using Org.OpenAPITools.OpenApi; -using Org.OpenAPITools.Formatters; - -namespace Org.OpenAPITools -{ - /// - /// Startup - /// - public class Startup - { - /// - /// Constructor - /// - /// - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - /// - /// The application configuration. - /// - public IConfiguration Configuration { get; } - - /// - /// This method gets called by the runtime. Use this method to add services to the container. - /// - /// - public void ConfigureServices(IServiceCollection services) - { - services.AddTransient(); - services.AddAuthorization(authConfig => - { - authConfig.AddPolicy("api_key", policyBuilder => - { - policyBuilder - .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); - }); - }); - - // Add framework services. - services - // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ - .AddControllers(options => { - options.InputFormatters.Insert(0, new InputFormatterStream()); - }) - .AddJsonOptions(options => - { - options.JsonSerializerOptions.PropertyNamingPolicy = JsonNamingPolicy.CamelCase; - options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter(JsonNamingPolicy.CamelCase)); - }); - services - .AddSwaggerGen(c => - { - c.EnableAnnotations(enableAnnotationsForInheritance: true, enableAnnotationsForPolymorphism: true); - - c.SwaggerDoc("1.0.0", new OpenApiInfo - { - Title = "OpenAPI Petstore", - Description = "OpenAPI Petstore (ASP.NET Core 6.0)", - TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), - Contact = new OpenApiContact - { - Name = "OpenAPI-Generator Contributors", - Url = new Uri("https://github.com/openapitools/openapi-generator"), - Email = "" - }, - License = new OpenApiLicense - { - Name = "NoLicense", - Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") - }, - Version = "1.0.0", - }); - c.CustomSchemaIds(type => type.FriendlyId(true)); - c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); - // Sets the basePath property in the OpenAPI document generated - c.DocumentFilter("/v2"); - - // Include DataAnnotation attributes on Controller Action parameters as OpenAPI validation rules (e.g required, pattern, ..) - // Use [ValidateModelState] on Actions to actually validate it in C# as well! - c.OperationFilter(); - }); - } - - /// - /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - /// - /// - /// - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - app.UseHsts(); - } - - app.UseHttpsRedirection(); - app.UseDefaultFiles(); - app.UseStaticFiles(); - app.UseSwagger(c => - { - c.RouteTemplate = "openapi/{documentName}/openapi.json"; - }) - .UseSwaggerUI(c => - { - // set route prefix to openapi, e.g. http://localhost:8080/openapi/index.html - c.RoutePrefix = "openapi"; - //TODO: Either use the SwaggerGen generated OpenAPI contract (generated from C# classes) - c.SwaggerEndpoint("/openapi/1.0.0/openapi.json", "OpenAPI Petstore"); - - //TODO: Or alternatively use the original OpenAPI contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); - }); - app.UseRouting(); - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/appsettings.Development.json b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/appsettings.Development.json deleted file mode 100644 index e203e9407e7..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/appsettings.json deleted file mode 100644 index def9159a7d9..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/README.md deleted file mode 100644 index 6a0b78471a3..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Welcome to ASP.NET 5 Preview - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). -Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). - -We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. -The ASP.NET Team - -### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) - -### This application consists of: -* Sample pages using ASP.NET MVC 6 -* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources -* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) - -#### NEW CONCEPTS -* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) -* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) -* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) -* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) -* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) -* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) - -#### CUSTOMIZE APP -* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) -* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) -* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) -* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) -* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) -* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) -* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) - -#### DEPLOY -* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) -* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) -* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) -* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) - -We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/index.html deleted file mode 100644 index f3318bc90a1..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/index.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/openapi-original.json deleted file mode 100644 index 53d1a8e9b10..00000000000 --- a/samples/server/petstore/aspnetcore-6.0-useNewtonsoft/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ /dev/null @@ -1,1151 +0,0 @@ -{ - "openapi" : "3.0.0", - "info" : { - "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", - "license" : { - "name" : "Apache-2.0", - "url" : "https://www.apache.org/licenses/LICENSE-2.0.html" - }, - "title" : "OpenAPI Petstore", - "version" : "1.0.0" - }, - "externalDocs" : { - "description" : "Find out more about Swagger", - "url" : "http://swagger.io" - }, - "servers" : [ { - "url" : "http://petstore.swagger.io/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" : { - "description" : "", - "operationId" : "addPet", - "requestBody" : { - "$ref" : "#/components/requestBodies/Pet" - }, - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "successful operation" - }, - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Add a new pet to the store", - "tags" : [ "pet" ] - }, - "put" : { - "description" : "", - "operationId" : "updatePet", - "requestBody" : { - "$ref" : "#/components/requestBodies/Pet" - }, - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - }, - "405" : { - "description" : "Validation exception" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Update an existing pet", - "tags" : [ "pet" ] - } - }, - "/pet/findByStatus" : { - "get" : { - "description" : "Multiple status values can be provided with comma separated strings", - "operationId" : "findPetsByStatus", - "parameters" : [ { - "deprecated" : true, - "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" : { - "description" : "Invalid status value" - } - }, - "security" : [ { - "petstore_auth" : [ "read:pets" ] - } ], - "summary" : "Finds Pets by status", - "tags" : [ "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" - }, - "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" : { - "description" : "Invalid tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "read:pets" ] - } ], - "summary" : "Finds Pets by tags", - "tags" : [ "pet" ] - } - }, - "/pet/{petId}" : { - "delete" : { - "description" : "", - "operationId" : "deletePet", - "parameters" : [ { - "explode" : false, - "in" : "header", - "name" : "api_key", - "required" : false, - "schema" : { - "type" : "string" - }, - "style" : "simple" - }, { - "description" : "Pet id to delete", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "responses" : { - "400" : { - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Deletes a pet", - "tags" : [ "pet" ] - }, - "get" : { - "description" : "Returns a single pet", - "operationId" : "getPetById", - "parameters" : [ { - "description" : "ID of pet to return", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Pet not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Find pet by ID", - "tags" : [ "pet" ] - }, - "post" : { - "description" : "", - "operationId" : "updatePetWithForm", - "parameters" : [ { - "description" : "ID of pet that needs to be updated", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "requestBody" : { - "content" : { - "application/x-www-form-urlencoded" : { - "schema" : { - "$ref" : "#/components/schemas/updatePetWithForm_request" - } - } - } - }, - "responses" : { - "405" : { - "description" : "Invalid input" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Updates a pet in the store with form data", - "tags" : [ "pet" ] - } - }, - "/pet/{petId}/uploadImage" : { - "post" : { - "description" : "", - "operationId" : "uploadFile", - "parameters" : [ { - "description" : "ID of pet to update", - "explode" : false, - "in" : "path", - "name" : "petId", - "required" : true, - "schema" : { - "format" : "int64", - "type" : "integer" - }, - "style" : "simple" - } ], - "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" ] - } - }, - "/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" ] - } - }, - "/store/order" : { - "post" : { - "description" : "", - "operationId" : "placeOrder", - "requestBody" : { - "content" : { - "application/json" : { - "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" : { - "description" : "Invalid Order" - } - }, - "summary" : "Place an order for a pet", - "tags" : [ "store" ] - } - }, - "/store/order/{orderId}" : { - "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", - "explode" : false, - "in" : "path", - "name" : "orderId", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "responses" : { - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "summary" : "Delete purchase order by ID", - "tags" : [ "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", - "explode" : false, - "in" : "path", - "name" : "orderId", - "required" : true, - "schema" : { - "format" : "int64", - "maximum" : 5, - "minimum" : 1, - "type" : "integer" - }, - "style" : "simple" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Order" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid ID supplied" - }, - "404" : { - "description" : "Order not found" - } - }, - "summary" : "Find purchase order by ID", - "tags" : [ "store" ] - } - }, - "/user" : { - "post" : { - "description" : "This can only be done by the logged in user.", - "operationId" : "createUser", - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - } - }, - "description" : "Created user object", - "required" : true - }, - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Create user", - "tags" : [ "user" ] - } - }, - "/user/createWithArray" : { - "post" : { - "description" : "", - "operationId" : "createUsersWithArrayInput", - "requestBody" : { - "$ref" : "#/components/requestBodies/UserArray" - }, - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Creates list of users with given input array", - "tags" : [ "user" ] - } - }, - "/user/createWithList" : { - "post" : { - "description" : "", - "operationId" : "createUsersWithListInput", - "requestBody" : { - "$ref" : "#/components/requestBodies/UserArray" - }, - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Creates list of users with given input array", - "tags" : [ "user" ] - } - }, - "/user/login" : { - "get" : { - "description" : "", - "operationId" : "loginUser", - "parameters" : [ { - "description" : "The user name for login", - "explode" : true, - "in" : "query", - "name" : "username", - "required" : true, - "schema" : { - "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", - "type" : "string" - }, - "style" : "form" - }, { - "description" : "The password for login in clear text", - "explode" : true, - "in" : "query", - "name" : "password", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "form" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "type" : "string" - } - }, - "application/json" : { - "schema" : { - "type" : "string" - } - } - }, - "description" : "successful operation", - "headers" : { - "Set-Cookie" : { - "description" : "Cookie authentication key for use with the `api_key` apiKey authentication.", - "explode" : false, - "schema" : { - "example" : "AUTH_KEY=abcde12345; Path=/; HttpOnly", - "type" : "string" - }, - "style" : "simple" - }, - "X-Rate-Limit" : { - "description" : "calls per hour allowed by the user", - "explode" : false, - "schema" : { - "format" : "int32", - "type" : "integer" - }, - "style" : "simple" - }, - "X-Expires-After" : { - "description" : "date in UTC when token expires", - "explode" : false, - "schema" : { - "format" : "date-time", - "type" : "string" - }, - "style" : "simple" - } - } - }, - "400" : { - "description" : "Invalid username/password supplied" - } - }, - "summary" : "Logs user into the system", - "tags" : [ "user" ] - } - }, - "/user/logout" : { - "get" : { - "description" : "", - "operationId" : "logoutUser", - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Logs out current logged in user session", - "tags" : [ "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", - "explode" : false, - "in" : "path", - "name" : "username", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "responses" : { - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Delete user", - "tags" : [ "user" ] - }, - "get" : { - "description" : "", - "operationId" : "getUserByName", - "parameters" : [ { - "description" : "The name that needs to be fetched. Use user1 for testing.", - "explode" : false, - "in" : "path", - "name" : "username", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "responses" : { - "200" : { - "content" : { - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - }, - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - } - }, - "description" : "successful operation" - }, - "400" : { - "description" : "Invalid username supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "summary" : "Get user by user name", - "tags" : [ "user" ] - }, - "put" : { - "description" : "This can only be done by the logged in user.", - "operationId" : "updateUser", - "parameters" : [ { - "description" : "name that need to be deleted", - "explode" : false, - "in" : "path", - "name" : "username", - "required" : true, - "schema" : { - "type" : "string" - }, - "style" : "simple" - } ], - "requestBody" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/User" - } - } - }, - "description" : "Updated user object", - "required" : true - }, - "responses" : { - "400" : { - "description" : "Invalid user supplied" - }, - "404" : { - "description" : "User not found" - } - }, - "security" : [ { - "api_key" : [ ] - } ], - "summary" : "Updated user", - "tags" : [ "user" ] - } - }, - "/fake/parameter_example_test" : { - "get" : { - "description" : "", - "operationId" : "fake_parameter_example_test", - "parameters" : [ { - "explode" : true, - "in" : "query", - "name" : "data", - "required" : true, - "schema" : { - "$ref" : "#/components/schemas/Pet" - }, - "style" : "form" - } ], - "responses" : { - "default" : { - "description" : "successful operation" - } - }, - "summary" : "fake endpoint to test parameter example (object)", - "tags" : [ "fake" ] - } - } - }, - "components" : { - "requestBodies" : { - "UserArray" : { - "content" : { - "application/json" : { - "schema" : { - "items" : { - "$ref" : "#/components/schemas/User" - }, - "type" : "array" - } - } - }, - "description" : "List of user object", - "required" : true - }, - "Pet" : { - "content" : { - "application/json" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - }, - "application/xml" : { - "schema" : { - "$ref" : "#/components/schemas/Pet" - } - } - }, - "description" : "Pet object that needs to be added to the store", - "required" : true - } - }, - "schemas" : { - "Order" : { - "description" : "An order for a pets from the pet store", - "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" - } - }, - "title" : "Pet Order", - "type" : "object", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "name" : { - "pattern" : "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", - "type" : "string" - } - }, - "title" : "Pet category", - "type" : "object", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "description" : "A User who is purchasing from the pet store", - "example" : { - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "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" - } - }, - "title" : "a User", - "type" : "object", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "type" : "object", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "category" : { - "$ref" : "#/components/schemas/Category" - }, - "name" : { - "example" : "doggie", - "type" : "string" - }, - "photoUrls" : { - "items" : { - "type" : "string" - }, - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - } - }, - "tags" : { - "items" : { - "$ref" : "#/components/schemas/Tag" - }, - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - } - }, - "status" : { - "deprecated" : true, - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ], - "type" : "string" - } - }, - "required" : [ "name", "photoUrls" ], - "title" : "a Pet", - "type" : "object", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - }, - "properties" : { - "code" : { - "format" : "int32", - "type" : "integer" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "type" : "object" - }, - "Dog" : { - "allOf" : [ { - "$ref" : "#/components/schemas/Animal" - }, { - "$ref" : "#/components/schemas/Dog_allOf" - } ] - }, - "Cat" : { - "allOf" : [ { - "$ref" : "#/components/schemas/Animal" - }, { - "$ref" : "#/components/schemas/Cat_allOf" - } ] - }, - "Animal" : { - "discriminator" : { - "mapping" : { - "DOG" : "#/components/schemas/Dog", - "CAT" : "#/components/schemas/Cat" - }, - "propertyName" : "className" - }, - "properties" : { - "className" : { - "type" : "string" - }, - "color" : { - "default" : "red", - "type" : "string" - } - }, - "required" : [ "className" ], - "type" : "object" - }, - "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" - }, - "Dog_allOf" : { - "properties" : { - "breed" : { - "type" : "string" - } - }, - "type" : "object", - "example" : null - }, - "Cat_allOf" : { - "properties" : { - "declawed" : { - "type" : "boolean" - } - }, - "type" : "object", - "example" : null - } - }, - "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" - } - } - } -} diff --git a/samples/server/petstore/aspnetcore3/.openapi-generator-ignore b/samples/server/petstore/aspnetcore3/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/server/petstore/aspnetcore3/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/server/petstore/aspnetcore3/.openapi-generator/VERSION b/samples/server/petstore/aspnetcore3/.openapi-generator/VERSION deleted file mode 100644 index b5d898602c2..00000000000 --- a/samples/server/petstore/aspnetcore3/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.3.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore3/Org.OpenAPITools.sln b/samples/server/petstore/aspnetcore3/Org.OpenAPITools.sln deleted file mode 100644 index c2bc3876420..00000000000 --- a/samples/server/petstore/aspnetcore3/Org.OpenAPITools.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27428.2043 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Org.OpenAPITools", "src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3C799344-F285-4669-8FD5-7ED9B795D5C5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/samples/server/petstore/aspnetcore3/README.md b/samples/server/petstore/aspnetcore3/README.md deleted file mode 100644 index ad46d4e125c..00000000000 --- a/samples/server/petstore/aspnetcore3/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# Org.OpenAPITools - ASP.NET Core 3.0 Server - -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -## Run - -Linux/OS X: - -``` -sh build.sh -``` - -Windows: - -``` -build.bat -``` -## Run in Docker - -``` -cd src/Org.OpenAPITools -docker build -t org.openapitools . -docker run -p 5000:8080 org.openapitools -``` diff --git a/samples/server/petstore/aspnetcore3/build.bat b/samples/server/petstore/aspnetcore3/build.bat deleted file mode 100644 index cd65518e428..00000000000 --- a/samples/server/petstore/aspnetcore3/build.bat +++ /dev/null @@ -1,9 +0,0 @@ -:: Generated by: https://openapi-generator.tech -:: - -@echo off - -dotnet restore src\Org.OpenAPITools -dotnet build src\Org.OpenAPITools -echo Now, run the following to start the project: dotnet run -p src\Org.OpenAPITools\Org.OpenAPITools.csproj --launch-profile web. -echo. diff --git a/samples/server/petstore/aspnetcore3/build.sh b/samples/server/petstore/aspnetcore3/build.sh deleted file mode 100644 index afbeddb8378..00000000000 --- a/samples/server/petstore/aspnetcore3/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# -# Generated by: https://openapi-generator.tech -# - -dotnet restore src/Org.OpenAPITools/ && \ - dotnet build src/Org.OpenAPITools/ && \ - echo "Now, run the following to start the project: dotnet run -p src/Org.OpenAPITools/Org.OpenAPITools.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/.gitignore b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/.gitignore deleted file mode 100644 index cd9b840e549..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/.gitignore +++ /dev/null @@ -1,208 +0,0 @@ -PID - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -[Bb]in/ -[Oo]bj/ - -# Visual Studio 2015 cache/options directory -.vs/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Windows Azure Build Output -csx/ -*.build.csdef - -# Windows Store app package directory -AppPackages/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -[Ss]tyle[Cc]op.* -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -bower_components/ -orleans.codegen.cs - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs deleted file mode 100644 index f388cfdf983..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Attributes/ValidateModelStateAttribute.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Reflection; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Controllers; -using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.AspNetCore.Mvc.ModelBinding; - -namespace Org.OpenAPITools.Attributes -{ - /// - /// Model state validation attribute - /// - public class ValidateModelStateAttribute : ActionFilterAttribute - { - /// - /// Called before the action method is invoked - /// - /// - public override void OnActionExecuting(ActionExecutingContext context) - { - // Per https://blog.markvincze.com/how-to-validate-action-parameters-with-dataannotation-attributes/ - var descriptor = context.ActionDescriptor as ControllerActionDescriptor; - if (descriptor != null) - { - foreach (var parameter in descriptor.MethodInfo.GetParameters()) - { - object args = null; - if (context.ActionArguments.ContainsKey(parameter.Name)) - { - args = context.ActionArguments[parameter.Name]; - } - - ValidateAttributes(parameter, args, context.ModelState); - } - } - - if (!context.ModelState.IsValid) - { - context.Result = new BadRequestObjectResult(context.ModelState); - } - } - - private void ValidateAttributes(ParameterInfo parameter, object args, ModelStateDictionary modelState) - { - foreach (var attributeData in parameter.CustomAttributes) - { - var attributeInstance = parameter.GetCustomAttribute(attributeData.AttributeType); - - var validationAttribute = attributeInstance as ValidationAttribute; - if (validationAttribute != null) - { - var isValid = validationAttribute.IsValid(args); - if (!isValid) - { - modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); - } - } - } - } - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs deleted file mode 100644 index 92b2512e441..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Authentication/ApiAuthentication.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc.Filters; - -namespace Org.OpenAPITools.Authentication -{ - /// - /// A requirement that an ApiKey must be present. - /// - public class ApiKeyRequirement : IAuthorizationRequirement - { - /// - /// Get the list of api keys - /// - public IReadOnlyList ApiKeys { get; } - - /// - /// Get the policy name, - /// - public string PolicyName { get; } - - /// - /// Create a new instance of the class. - /// - /// - /// - public ApiKeyRequirement(IEnumerable apiKeys, string policyName) - { - ApiKeys = apiKeys?.ToList() ?? new List(); - PolicyName = policyName; - } - } - - /// - /// Enforce that an api key is present. - /// - public class ApiKeyRequirementHandler : AuthorizationHandler - { - /// - protected override Task HandleRequirementAsync(AuthorizationHandlerContext context, ApiKeyRequirement requirement) - { - SucceedRequirementIfApiKeyPresentAndValid(context, requirement); - return Task.CompletedTask; - } - - private void SucceedRequirementIfApiKeyPresentAndValid(AuthorizationHandlerContext context, ApiKeyRequirement requirement) - { - - if (context.Resource is AuthorizationFilterContext authorizationFilterContext) - { - var apiKey = authorizationFilterContext.HttpContext.Request.Headers["api_key"].FirstOrDefault(); - if (requirement.PolicyName == "api_key" && apiKey != null && requirement.ApiKeys.Any(requiredApiKey => apiKey == requiredApiKey)) - { - context.Succeed(requirement); - } - } - - } - } -} - diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/PetApi.cs deleted file mode 100644 index 2102b82d8fe..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/PetApi.cs +++ /dev/null @@ -1,232 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Mvc; -using Swashbuckle.AspNetCore.Annotations; -using Microsoft.AspNetCore.Authorization; -using Swashbuckle.AspNetCore.SwaggerGen; -using Newtonsoft.Json; -using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; - -namespace Org.OpenAPITools.Controllers -{ - /// - /// - /// - [ApiController] - public class PetApiController : ControllerBase - { - /// - /// Add a new pet to the store - /// - /// Pet object that needs to be added to the store - /// Invalid input - [HttpPost] - [Route("/v2/pet")] - [ValidateModelState] - [SwaggerOperation("AddPet")] - public virtual IActionResult AddPet([FromBody]Pet body) - { - - //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(405); - - throw new NotImplementedException(); - } - - /// - /// Deletes a pet - /// - /// Pet id to delete - /// - /// Invalid pet value - [HttpDelete] - [Route("/v2/pet/{petId}")] - [ValidateModelState] - [SwaggerOperation("DeletePet")] - public virtual IActionResult DeletePet([FromRoute][Required]long petId, [FromHeader]string apiKey) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - - throw new NotImplementedException(); - } - - /// - /// Finds Pets by status - /// - /// Multiple status values can be provided with comma separated strings - /// Status values that need to be considered for filter - /// successful operation - /// Invalid status value - [HttpGet] - [Route("/v2/pet/findByStatus")] - [ValidateModelState] - [SwaggerOperation("FindPetsByStatus")] - [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] - public virtual IActionResult FindPetsByStatus([FromQuery][Required()]List status) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(List)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; - exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : default(List); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Finds Pets by tags - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// Tags to filter by - /// successful operation - /// Invalid tag value - [HttpGet] - [Route("/v2/pet/findByTags")] - [ValidateModelState] - [SwaggerOperation("FindPetsByTags")] - [SwaggerResponse(statusCode: 200, type: typeof(List), description: "successful operation")] - public virtual IActionResult FindPetsByTags([FromQuery][Required()]List tags) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(List)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; - exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : default(List); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Find pet by ID - /// - /// Returns a single pet - /// ID of pet to return - /// successful operation - /// Invalid ID supplied - /// Pet not found - [HttpGet] - [Route("/v2/pet/{petId}")] - [Authorize(Policy = "api_key")] - [ValidateModelState] - [SwaggerOperation("GetPetById")] - [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] - public virtual IActionResult GetPetById([FromRoute][Required]long petId) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Pet)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - string exampleJson = null; - exampleJson = "{\n \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ],\n \"name\" : \"doggie\",\n \"id\" : 0,\n \"category\" : {\n \"name\" : \"name\",\n \"id\" : 6\n },\n \"tags\" : [ {\n \"name\" : \"name\",\n \"id\" : 1\n }, {\n \"name\" : \"name\",\n \"id\" : 1\n } ],\n \"status\" : \"available\"\n}"; - exampleJson = "\n 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(Pet); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Update an existing pet - /// - /// Pet object that needs to be added to the store - /// Invalid ID supplied - /// Pet not found - /// Validation exception - [HttpPut] - [Route("/v2/pet")] - [ValidateModelState] - [SwaggerOperation("UpdatePet")] - public virtual IActionResult UpdatePet([FromBody]Pet body) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(405); - - throw new NotImplementedException(); - } - - /// - /// Updates a pet in the store with form data - /// - /// ID of pet that needs to be updated - /// Updated name of the pet - /// Updated status of the pet - /// Invalid input - [HttpPost] - [Route("/v2/pet/{petId}")] - [ValidateModelState] - [SwaggerOperation("UpdatePetWithForm")] - public virtual IActionResult UpdatePetWithForm([FromRoute][Required]long petId, [FromForm]string name, [FromForm]string status) - { - - //TODO: Uncomment the next line to return response 405 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(405); - - throw new NotImplementedException(); - } - - /// - /// uploads an image - /// - /// ID of pet to update - /// Additional data to pass to server - /// file to upload - /// successful operation - [HttpPost] - [Route("/v2/pet/{petId}/uploadImage")] - [ValidateModelState] - [SwaggerOperation("UploadFile")] - [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] - public virtual IActionResult UploadFile([FromRoute][Required]long petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(ApiResponse)); - string exampleJson = null; - exampleJson = "{\n \"code\" : 0,\n \"type\" : \"type\",\n \"message\" : \"message\"\n}"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(ApiResponse); - //TODO: Change the data returned - return new ObjectResult(example); - } - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/StoreApi.cs deleted file mode 100644 index 4ec7250e14f..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/StoreApi.cs +++ /dev/null @@ -1,139 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Mvc; -using Swashbuckle.AspNetCore.Annotations; -using Microsoft.AspNetCore.Authorization; -using Swashbuckle.AspNetCore.SwaggerGen; -using Newtonsoft.Json; -using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; - -namespace Org.OpenAPITools.Controllers -{ - /// - /// - /// - [ApiController] - public class StoreApiController : ControllerBase - { - /// - /// Delete purchase order by ID - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// ID of the order that needs to be deleted - /// Invalid ID supplied - /// Order not found - [HttpDelete] - [Route("/v2/store/order/{orderId}")] - [ValidateModelState] - [SwaggerOperation("DeleteOrder")] - public virtual IActionResult DeleteOrder([FromRoute][Required]string orderId) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - - throw new NotImplementedException(); - } - - /// - /// Returns pet inventories by status - /// - /// Returns a map of status codes to quantities - /// successful operation - [HttpGet] - [Route("/v2/store/inventory")] - [Authorize(Policy = "api_key")] - [ValidateModelState] - [SwaggerOperation("GetInventory")] - [SwaggerResponse(statusCode: 200, type: typeof(Dictionary), description: "successful operation")] - public virtual IActionResult GetInventory() - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Dictionary)); - string exampleJson = null; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject>(exampleJson) - : default(Dictionary); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Find purchase order by ID - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - /// ID of pet that needs to be fetched - /// successful operation - /// Invalid ID supplied - /// Order not found - [HttpGet] - [Route("/v2/store/order/{orderId}")] - [ValidateModelState] - [SwaggerOperation("GetOrderById")] - [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] - public virtual IActionResult GetOrderById([FromRoute][Required][Range(1, 5)]long orderId) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Order)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - string exampleJson = null; - exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; - exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(Order); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Place an order for a pet - /// - /// order placed for purchasing the pet - /// successful operation - /// Invalid Order - [HttpPost] - [Route("/v2/store/order")] - [ValidateModelState] - [SwaggerOperation("PlaceOrder")] - [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] - public virtual IActionResult PlaceOrder([FromBody]Order body) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(Order)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - exampleJson = "{\n \"petId\" : 6,\n \"quantity\" : 1,\n \"id\" : 0,\n \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\",\n \"complete\" : false,\n \"status\" : \"placed\"\n}"; - exampleJson = "\n 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(Order); - //TODO: Change the data returned - return new ObjectResult(example); - } - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/UserApi.cs deleted file mode 100644 index c37f0251d3b..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Controllers/UserApi.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Mvc; -using Swashbuckle.AspNetCore.Annotations; -using Microsoft.AspNetCore.Authorization; -using Swashbuckle.AspNetCore.SwaggerGen; -using Newtonsoft.Json; -using Org.OpenAPITools.Attributes; -using Org.OpenAPITools.Models; - -namespace Org.OpenAPITools.Controllers -{ - /// - /// - /// - [ApiController] - public class UserApiController : ControllerBase - { - /// - /// Create user - /// - /// This can only be done by the logged in user. - /// Created user object - /// successful operation - [HttpPost] - [Route("/v2/user")] - [ValidateModelState] - [SwaggerOperation("CreateUser")] - public virtual IActionResult CreateUser([FromBody]User body) - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - [HttpPost] - [Route("/v2/user/createWithArray")] - [ValidateModelState] - [SwaggerOperation("CreateUsersWithArrayInput")] - public virtual IActionResult CreateUsersWithArrayInput([FromBody]List body) - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Creates list of users with given input array - /// - /// List of user object - /// successful operation - [HttpPost] - [Route("/v2/user/createWithList")] - [ValidateModelState] - [SwaggerOperation("CreateUsersWithListInput")] - public virtual IActionResult CreateUsersWithListInput([FromBody]List body) - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Delete user - /// - /// This can only be done by the logged in user. - /// The name that needs to be deleted - /// Invalid username supplied - /// User not found - [HttpDelete] - [Route("/v2/user/{username}")] - [ValidateModelState] - [SwaggerOperation("DeleteUser")] - public virtual IActionResult DeleteUser([FromRoute][Required]string username) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - - throw new NotImplementedException(); - } - - /// - /// Get user by user name - /// - /// The name that needs to be fetched. Use user1 for testing. - /// successful operation - /// Invalid username supplied - /// User not found - [HttpGet] - [Route("/v2/user/{username}")] - [ValidateModelState] - [SwaggerOperation("GetUserByName")] - [SwaggerResponse(statusCode: 200, type: typeof(User), description: "successful operation")] - public virtual IActionResult GetUserByName([FromRoute][Required]string username) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(User)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - string exampleJson = null; - exampleJson = "{\n \"firstName\" : \"firstName\",\n \"lastName\" : \"lastName\",\n \"password\" : \"password\",\n \"userStatus\" : 6,\n \"phone\" : \"phone\",\n \"id\" : 0,\n \"email\" : \"email\",\n \"username\" : \"username\"\n}"; - exampleJson = "\n 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(User); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Logs user into the system - /// - /// The user name for login - /// The password for login in clear text - /// successful operation - /// Invalid username/password supplied - [HttpGet] - [Route("/v2/user/login")] - [ValidateModelState] - [SwaggerOperation("LoginUser")] - [SwaggerResponse(statusCode: 200, type: typeof(string), description: "successful operation")] - public virtual IActionResult LoginUser([FromQuery][Required()]string username, [FromQuery][Required()]string password) - { - - //TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(200, default(string)); - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - string exampleJson = null; - - var example = exampleJson != null - ? JsonConvert.DeserializeObject(exampleJson) - : default(string); - //TODO: Change the data returned - return new ObjectResult(example); - } - - /// - /// Logs out current logged in user session - /// - /// successful operation - [HttpGet] - [Route("/v2/user/logout")] - [ValidateModelState] - [SwaggerOperation("LogoutUser")] - public virtual IActionResult LogoutUser() - { - - //TODO: Uncomment the next line to return response 0 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(0); - - throw new NotImplementedException(); - } - - /// - /// Updated user - /// - /// This can only be done by the logged in user. - /// name that need to be deleted - /// Updated user object - /// Invalid user supplied - /// User not found - [HttpPut] - [Route("/v2/user/{username}")] - [ValidateModelState] - [SwaggerOperation("UpdateUser")] - public virtual IActionResult UpdateUser([FromRoute][Required]string username, [FromBody]User body) - { - - //TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(400); - //TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ... - // return StatusCode(404); - - throw new NotImplementedException(); - } - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs deleted file mode 100644 index 00b75a3cc7c..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Converters/CustomEnumConverter.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.ComponentModel; -using System.Globalization; -using Newtonsoft.Json; - -namespace Org.OpenAPITools.Converters -{ - /// - /// Custom string to enum converter - /// - public class CustomEnumConverter : TypeConverter - { - /// - /// Determine if we can convert a type to an enum - /// - /// - /// - /// - public override bool CanConvertFrom(ITypeDescriptorContext context, Type sourceType) - { - return sourceType == typeof(string) || base.CanConvertFrom(context, sourceType); - } - - /// - /// Convert from a type value to an enum - /// - /// - /// - /// - /// - public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) - { - var s = value as string; - if (string.IsNullOrEmpty(s)) - { - return null; - } - - return JsonConvert.DeserializeObject(@"""" + value.ToString() + @""""); - } - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Dockerfile b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Dockerfile deleted file mode 100644 index a054cdee5ac..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. - -# Container we use for final publish -FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base -WORKDIR /app -EXPOSE 80 -EXPOSE 443 - -# Build container -FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build - -# Copy the code into the container -WORKDIR /src -COPY ["src/Org.OpenAPITools/Org.OpenAPITools.csproj", "Org.OpenAPITools/"] - -# NuGet restore -RUN dotnet restore "Org.OpenAPITools/Org.OpenAPITools.csproj" -COPY ["src/Org.OpenAPITools/", "Org.OpenAPITools/"] - -# Build the API -WORKDIR "Org.OpenAPITools" -RUN dotnet build "Org.OpenAPITools.csproj" -c Release -o /app/build - -# Publish it -FROM build AS publish -RUN dotnet publish "Org.OpenAPITools.csproj" -c Release -o /app/publish - -# Make the final image for publishing -FROM base AS final -WORKDIR /app -COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "Org.OpenAPITools.dll"] diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Filters/BasePathFilter.cs deleted file mode 100644 index 09ab6006a7b..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Filters/BasePathFilter.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Linq; -using System.Text.RegularExpressions; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace Org.OpenAPITools.Filters -{ - /// - /// BasePath Document Filter sets BasePath property of Swagger and removes it from the individual URL paths - /// - public class BasePathFilter : IDocumentFilter - { - /// - /// Constructor - /// - /// BasePath to remove from Operations - public BasePathFilter(string basePath) - { - BasePath = basePath; - } - - /// - /// Gets the BasePath of the Swagger Doc - /// - /// The BasePath of the Swagger Doc - public string BasePath { get; } - - /// - /// Apply the filter - /// - /// SwaggerDocument - /// FilterContext - public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) - { - //swaggerDoc.BasePath = BasePath; - - var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(BasePath)).ToList(); - - foreach (var (key, value) in pathsToModify) - { - if (key.StartsWith(BasePath)) - { - var newKey = Regex.Replace(key, $"^{BasePath}", string.Empty); - swaggerDoc.Paths.Remove(key); - swaggerDoc.Paths.Add(newKey, value); - } - } - } - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs deleted file mode 100644 index 823aa34de41..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Filters/GeneratePathParamsValidationFilter.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System.ComponentModel.DataAnnotations; -using System.Linq; -using Microsoft.AspNetCore.Mvc.Controllers; -using Microsoft.OpenApi.Models; -using Swashbuckle.AspNetCore.SwaggerGen; - -namespace Org.OpenAPITools.Filters -{ - /// - /// Path Parameter Validation Rules Filter - /// - public class GeneratePathParamsValidationFilter : IOperationFilter - { - /// - /// Constructor - /// - /// Operation - /// OperationFilterContext - public void Apply(OpenApiOperation operation, OperationFilterContext context) - { - var pars = context.ApiDescription.ParameterDescriptions; - - foreach (var par in pars) - { - var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); - - var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes.ToList(); - - // See https://github.com/domaindrivendev/Swashbuckle.AspNetCore/issues/1147 - // and https://mikeralphson.github.io/openapi/2017/03/15/openapi3.0.0-rc0 - // Basically OpenAPI v3 body parameters are split out into RequestBody and the properties have moved to schema - if (attributes.Any() && swaggerParam != null) - { - // Required - [Required] - var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); - if (requiredAttr != null) - { - swaggerParam.Required = true; - } - - // Regex Pattern [RegularExpression] - var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); - if (regexAttr != null) - { - var regex = (string)regexAttr.ConstructorArguments[0].Value; - swaggerParam.Schema.Pattern = regex; - } - - // String Length [StringLength] - int? minLength = null, maxLength = null; - var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); - if (stringLengthAttr != null) - { - if (stringLengthAttr.NamedArguments.Count == 1) - { - minLength = (int)stringLengthAttr.NamedArguments.Single(p => p.MemberName == "MinimumLength").TypedValue.Value; - } - maxLength = (int)stringLengthAttr.ConstructorArguments[0].Value; - } - - var minLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MinLengthAttribute)); - if (minLengthAttr != null) - { - minLength = (int)minLengthAttr.ConstructorArguments[0].Value; - } - - var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); - if (maxLengthAttr != null) - { - maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; - } - - if (minLength != null) - { - swaggerParam.Schema.MinLength = minLength; - } - - if (maxLength != null) - { - swaggerParam.Schema.MaxLength = maxLength; - } - - // Range [Range] - var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); - if (rangeAttr != null) - { - var rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; - var rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; - - swaggerParam.Schema.MinLength = rangeMin; - swaggerParam.Schema.MaxLength = rangeMax; - } - } - } - } - } -} - diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/ApiResponse.cs deleted file mode 100644 index ef3413980ea..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/ApiResponse.cs +++ /dev/null @@ -1,147 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// Describes the result of uploading an image resource - /// - [DataContract] - public partial class ApiResponse : IEquatable - { - /// - /// Gets or Sets Code - /// - [DataMember(Name="code", EmitDefaultValue=false)] - public int Code { get; set; } - - /// - /// Gets or Sets Type - /// - [DataMember(Name="type", EmitDefaultValue=false)] - public string Type { get; set; } - - /// - /// Gets or Sets Message - /// - [DataMember(Name="message", EmitDefaultValue=false)] - public string Message { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class ApiResponse {\n"); - sb.Append(" Code: ").Append(Code).Append("\n"); - sb.Append(" Type: ").Append(Type).Append("\n"); - sb.Append(" Message: ").Append(Message).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((ApiResponse)obj); - } - - /// - /// Returns true if ApiResponse instances are equal - /// - /// Instance of ApiResponse to be compared - /// Boolean - public bool Equals(ApiResponse other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Code == other.Code || - - Code.Equals(other.Code) - ) && - ( - Type == other.Type || - Type != null && - Type.Equals(other.Type) - ) && - ( - Message == other.Message || - Message != null && - Message.Equals(other.Message) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Code.GetHashCode(); - if (Type != null) - hashCode = hashCode * 59 + Type.GetHashCode(); - if (Message != null) - hashCode = hashCode * 59 + Message.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(ApiResponse left, ApiResponse right) - { - return Equals(left, right); - } - - public static bool operator !=(ApiResponse left, ApiResponse right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Category.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Category.cs deleted file mode 100644 index 6ac6a181baf..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Category.cs +++ /dev/null @@ -1,133 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A category for a pet - /// - [DataContract] - public partial class Category : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - public long Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Category {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Category)obj); - } - - /// - /// Returns true if Category instances are equal - /// - /// Instance of Category to be compared - /// Boolean - public bool Equals(Category other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Name == other.Name || - Name != null && - Name.Equals(other.Name) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Name != null) - hashCode = hashCode * 59 + Name.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Category left, Category right) - { - return Equals(left, right); - } - - public static bool operator !=(Category left, Category right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Order.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Order.cs deleted file mode 100644 index 77a4c75a1b1..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Order.cs +++ /dev/null @@ -1,219 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// An order for a pets from the pet store - /// - [DataContract] - public partial class Order : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - public long Id { get; set; } - - /// - /// Gets or Sets PetId - /// - [DataMember(Name="petId", EmitDefaultValue=false)] - public long PetId { get; set; } - - /// - /// Gets or Sets Quantity - /// - [DataMember(Name="quantity", EmitDefaultValue=false)] - public int Quantity { get; set; } - - /// - /// Gets or Sets ShipDate - /// - [DataMember(Name="shipDate", EmitDefaultValue=false)] - public DateTime ShipDate { get; set; } - - - /// - /// Order Status - /// - /// Order Status - [TypeConverter(typeof(CustomEnumConverter))] - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum StatusEnum - { - - /// - /// Enum PlacedEnum for placed - /// - [EnumMember(Value = "placed")] - PlacedEnum = 1, - - /// - /// Enum ApprovedEnum for approved - /// - [EnumMember(Value = "approved")] - ApprovedEnum = 2, - - /// - /// Enum DeliveredEnum for delivered - /// - [EnumMember(Value = "delivered")] - DeliveredEnum = 3 - } - - /// - /// Order Status - /// - /// Order Status - [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum Status { get; set; } - - /// - /// Gets or Sets Complete - /// - [DataMember(Name="complete", EmitDefaultValue=false)] - public bool Complete { get; set; } = false; - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Order {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" PetId: ").Append(PetId).Append("\n"); - sb.Append(" Quantity: ").Append(Quantity).Append("\n"); - sb.Append(" ShipDate: ").Append(ShipDate).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append(" Complete: ").Append(Complete).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Order)obj); - } - - /// - /// Returns true if Order instances are equal - /// - /// Instance of Order to be compared - /// Boolean - public bool Equals(Order other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - PetId == other.PetId || - - PetId.Equals(other.PetId) - ) && - ( - Quantity == other.Quantity || - - Quantity.Equals(other.Quantity) - ) && - ( - ShipDate == other.ShipDate || - ShipDate != null && - ShipDate.Equals(other.ShipDate) - ) && - ( - Status == other.Status || - - Status.Equals(other.Status) - ) && - ( - Complete == other.Complete || - - Complete.Equals(other.Complete) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - - hashCode = hashCode * 59 + PetId.GetHashCode(); - - hashCode = hashCode * 59 + Quantity.GetHashCode(); - if (ShipDate != null) - hashCode = hashCode * 59 + ShipDate.GetHashCode(); - - hashCode = hashCode * 59 + Status.GetHashCode(); - - hashCode = hashCode * 59 + Complete.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Order left, Order right) - { - return Equals(left, right); - } - - public static bool operator !=(Order left, Order right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Pet.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Pet.cs deleted file mode 100644 index a814c6e1edf..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Pet.cs +++ /dev/null @@ -1,223 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A pet for sale in the pet store - /// - [DataContract] - public partial class Pet : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - public long Id { get; set; } - - /// - /// Gets or Sets Category - /// - [DataMember(Name="category", EmitDefaultValue=false)] - public Category Category { get; set; } - - /// - /// Gets or Sets Name - /// - [Required] - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Gets or Sets PhotoUrls - /// - [Required] - [DataMember(Name="photoUrls", EmitDefaultValue=false)] - public List PhotoUrls { get; set; } - - /// - /// Gets or Sets Tags - /// - [DataMember(Name="tags", EmitDefaultValue=false)] - public List Tags { get; set; } - - - /// - /// pet status in the store - /// - /// pet status in the store - [TypeConverter(typeof(CustomEnumConverter))] - [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum StatusEnum - { - - /// - /// Enum AvailableEnum for available - /// - [EnumMember(Value = "available")] - AvailableEnum = 1, - - /// - /// Enum PendingEnum for pending - /// - [EnumMember(Value = "pending")] - PendingEnum = 2, - - /// - /// Enum SoldEnum for sold - /// - [EnumMember(Value = "sold")] - SoldEnum = 3 - } - - /// - /// pet status in the store - /// - /// pet status in the store - [DataMember(Name="status", EmitDefaultValue=false)] - public StatusEnum Status { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Pet {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Category: ").Append(Category).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n"); - sb.Append(" Tags: ").Append(Tags).Append("\n"); - sb.Append(" Status: ").Append(Status).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Pet)obj); - } - - /// - /// Returns true if Pet instances are equal - /// - /// Instance of Pet to be compared - /// Boolean - public bool Equals(Pet other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Category == other.Category || - Category != null && - Category.Equals(other.Category) - ) && - ( - Name == other.Name || - Name != null && - Name.Equals(other.Name) - ) && - ( - PhotoUrls == other.PhotoUrls || - PhotoUrls != null && - other.PhotoUrls != null && - PhotoUrls.SequenceEqual(other.PhotoUrls) - ) && - ( - Tags == other.Tags || - Tags != null && - other.Tags != null && - Tags.SequenceEqual(other.Tags) - ) && - ( - Status == other.Status || - - Status.Equals(other.Status) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Category != null) - hashCode = hashCode * 59 + Category.GetHashCode(); - if (Name != null) - hashCode = hashCode * 59 + Name.GetHashCode(); - if (PhotoUrls != null) - hashCode = hashCode * 59 + PhotoUrls.GetHashCode(); - if (Tags != null) - hashCode = hashCode * 59 + Tags.GetHashCode(); - - hashCode = hashCode * 59 + Status.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Pet left, Pet right) - { - return Equals(left, right); - } - - public static bool operator !=(Pet left, Pet right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Tag.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Tag.cs deleted file mode 100644 index f0a131f617c..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/Tag.cs +++ /dev/null @@ -1,133 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A tag for a pet - /// - [DataContract] - public partial class Tag : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - public long Id { get; set; } - - /// - /// Gets or Sets Name - /// - [DataMember(Name="name", EmitDefaultValue=false)] - public string Name { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class Tag {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Name: ").Append(Name).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((Tag)obj); - } - - /// - /// Returns true if Tag instances are equal - /// - /// Instance of Tag to be compared - /// Boolean - public bool Equals(Tag other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Name == other.Name || - Name != null && - Name.Equals(other.Name) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Name != null) - hashCode = hashCode * 59 + Name.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(Tag left, Tag right) - { - return Equals(left, right); - } - - public static bool operator !=(Tag left, Tag right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/User.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/User.cs deleted file mode 100644 index 3c8a18d63cf..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Models/User.cs +++ /dev/null @@ -1,218 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.Linq; -using System.Text; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Org.OpenAPITools.Converters; - -namespace Org.OpenAPITools.Models -{ - /// - /// A User who is purchasing from the pet store - /// - [DataContract] - public partial class User : IEquatable - { - /// - /// Gets or Sets Id - /// - [DataMember(Name="id", EmitDefaultValue=false)] - public long Id { get; set; } - - /// - /// Gets or Sets Username - /// - [DataMember(Name="username", EmitDefaultValue=false)] - public string Username { get; set; } - - /// - /// Gets or Sets FirstName - /// - [DataMember(Name="firstName", EmitDefaultValue=false)] - public string FirstName { get; set; } - - /// - /// Gets or Sets LastName - /// - [DataMember(Name="lastName", EmitDefaultValue=false)] - public string LastName { get; set; } - - /// - /// Gets or Sets Email - /// - [DataMember(Name="email", EmitDefaultValue=false)] - public string Email { get; set; } - - /// - /// Gets or Sets Password - /// - [DataMember(Name="password", EmitDefaultValue=false)] - public string Password { get; set; } - - /// - /// Gets or Sets Phone - /// - [DataMember(Name="phone", EmitDefaultValue=false)] - public string Phone { get; set; } - - /// - /// User Status - /// - /// User Status - [DataMember(Name="userStatus", EmitDefaultValue=false)] - public int UserStatus { get; set; } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class User {\n"); - sb.Append(" Id: ").Append(Id).Append("\n"); - sb.Append(" Username: ").Append(Username).Append("\n"); - sb.Append(" FirstName: ").Append(FirstName).Append("\n"); - sb.Append(" LastName: ").Append(LastName).Append("\n"); - sb.Append(" Email: ").Append(Email).Append("\n"); - sb.Append(" Password: ").Append(Password).Append("\n"); - sb.Append(" Phone: ").Append(Phone).Append("\n"); - sb.Append(" UserStatus: ").Append(UserStatus).Append("\n"); - sb.Append("}\n"); - return sb.ToString(); - } - - /// - /// Returns the JSON string presentation of the object - /// - /// JSON string presentation of the object - public string ToJson() - { - return JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object obj) - { - if (obj is null) return false; - if (ReferenceEquals(this, obj)) return true; - return obj.GetType() == GetType() && Equals((User)obj); - } - - /// - /// Returns true if User instances are equal - /// - /// Instance of User to be compared - /// Boolean - public bool Equals(User other) - { - if (other is null) return false; - if (ReferenceEquals(this, other)) return true; - - return - ( - Id == other.Id || - - Id.Equals(other.Id) - ) && - ( - Username == other.Username || - Username != null && - Username.Equals(other.Username) - ) && - ( - FirstName == other.FirstName || - FirstName != null && - FirstName.Equals(other.FirstName) - ) && - ( - LastName == other.LastName || - LastName != null && - LastName.Equals(other.LastName) - ) && - ( - Email == other.Email || - Email != null && - Email.Equals(other.Email) - ) && - ( - Password == other.Password || - Password != null && - Password.Equals(other.Password) - ) && - ( - Phone == other.Phone || - Phone != null && - Phone.Equals(other.Phone) - ) && - ( - UserStatus == other.UserStatus || - - UserStatus.Equals(other.UserStatus) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - var hashCode = 41; - // Suitable nullity checks etc, of course :) - - hashCode = hashCode * 59 + Id.GetHashCode(); - if (Username != null) - hashCode = hashCode * 59 + Username.GetHashCode(); - if (FirstName != null) - hashCode = hashCode * 59 + FirstName.GetHashCode(); - if (LastName != null) - hashCode = hashCode * 59 + LastName.GetHashCode(); - if (Email != null) - hashCode = hashCode * 59 + Email.GetHashCode(); - if (Password != null) - hashCode = hashCode * 59 + Password.GetHashCode(); - if (Phone != null) - hashCode = hashCode * 59 + Phone.GetHashCode(); - - hashCode = hashCode * 59 + UserStatus.GetHashCode(); - return hashCode; - } - } - - #region Operators - #pragma warning disable 1591 - - public static bool operator ==(User left, User right) - { - return Equals(left, right); - } - - public static bool operator !=(User left, User right) - { - return !Equals(left, right); - } - - #pragma warning restore 1591 - #endregion Operators - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs deleted file mode 100644 index b862226f2c1..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/OpenApi/TypeExtensions.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Linq; -using System.Text; - -namespace Org.OpenAPITools.OpenApi -{ - /// - /// Replacement utilities from Swashbuckle.AspNetCore.SwaggerGen which are not in 5.x - /// - public static class TypeExtensions - { - /// - /// Produce a friendly name for the type which is unique. - /// - /// - /// - public static string FriendlyId(this Type type, bool fullyQualified = false) - { - var typeName = fullyQualified - ? type.FullNameSansTypeParameters().Replace("+", ".") - : type.Name; - - if (type.IsGenericType) - { - var genericArgumentIds = type.GetGenericArguments() - .Select(t => t.FriendlyId(fullyQualified)) - .ToArray(); - - return new StringBuilder(typeName) - .Replace($"`{genericArgumentIds.Count()}", string.Empty) - .Append($"[{string.Join(",", genericArgumentIds).TrimEnd(',')}]") - .ToString(); - } - - return typeName; - } - - /// - /// Determine the fully qualified type name without type parameters. - /// - /// - public static string FullNameSansTypeParameters(this Type type) - { - var fullName = type.FullName; - if (string.IsNullOrEmpty(fullName)) - fullName = type.Name; - var chopIndex = fullName.IndexOf("[[", StringComparison.Ordinal); - return (chopIndex == -1) ? fullName : fullName.Substring(0, chopIndex); - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Org.OpenAPITools.csproj b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Org.OpenAPITools.csproj deleted file mode 100644 index e0f43209ba7..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Org.OpenAPITools.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - Org.OpenAPITools - Org.OpenAPITools - netcoreapp3.0 - true - true - Org.OpenAPITools - Org.OpenAPITools - bd74038c-1dca-4b76-ae76-537f7afee2ae - Linux - ..\.. - - - - - - - - - - - - diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Program.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Program.cs deleted file mode 100644 index 28b87acf753..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Program.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace Org.OpenAPITools -{ - /// - /// Program - /// - public class Program - { - /// - /// Main - /// - /// - public static void Main(string[] args) - { - CreateWebHostBuilder(args).Build().Run(); - } - - /// - /// Create the host builder. - /// - /// - /// IHostBuilder - public static IHostBuilder CreateWebHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup() - .UseUrls("http://0.0.0.0:8080/"); - }); - } -} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Properties/launchSettings.json b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Properties/launchSettings.json deleted file mode 100644 index 57b03cc43aa..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Properties/launchSettings.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:61788", - "sslPort": 44301 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "OpenAPI": { - "commandName": "Project", - "launchBrowser": true, - "launchUrl": "swagger", - "applicationUrl": "https://localhost:5001;http://localhost:5000", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Docker": { - "commandName": "Docker", - "launchBrowser": true, - "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", - "publishAllPorts": true, - "useSSL": true - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Startup.cs b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Startup.cs deleted file mode 100644 index cfcd30f6a1a..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/Startup.cs +++ /dev/null @@ -1,159 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * Generated by: https://openapi-generator.tech - */ - -using System; -using System.IO; -using System.Reflection; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.OpenApi.Models; -using Newtonsoft.Json.Converters; -using Newtonsoft.Json.Serialization; -using Org.OpenAPITools.Authentication; -using Org.OpenAPITools.Filters; -using Org.OpenAPITools.OpenApi; - -namespace Org.OpenAPITools -{ - /// - /// Startup - /// - public class Startup - { - /// - /// Constructor - /// - /// - public Startup(IHostEnvironment env) - { - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) - .AddEnvironmentVariables(); - - Configuration = builder.Build(); - } - - /// - /// The application configuration. - /// - public IConfiguration Configuration { get; } - - /// - /// This method gets called by the runtime. Use this method to add services to the container. - /// - /// - public void ConfigureServices(IServiceCollection services) - { - services.AddTransient(); - services.AddAuthorization(authConfig => - { - authConfig.AddPolicy("api_key", policyBuilder => - { - policyBuilder - .AddRequirements(new ApiKeyRequirement(new[] { "my-secret-key" },"api_key")); - }); - }); - - // Add framework services. - services - // Don't need the full MVC stack for an API, see https://andrewlock.net/comparing-startup-between-the-asp-net-core-3-templates/ - .AddControllers() - .AddNewtonsoftJson(opts => - { - opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - opts.SerializerSettings.Converters.Add(new StringEnumConverter - { - NamingStrategy = new CamelCaseNamingStrategy() - }); - }); - - services - .AddSwaggerGen(c => - { - c.SwaggerDoc("1.0.0", new OpenApiInfo - { - Title = "OpenAPI Petstore", - Description = "OpenAPI Petstore (ASP.NET Core 3.0)", - TermsOfService = new Uri("https://github.com/openapitools/openapi-generator"), - Contact = new OpenApiContact - { - Name = "OpenAPI-Generator Contributors", - Url = new Uri("https://github.com/openapitools/openapi-generator"), - Email = "" - }, - License = new OpenApiLicense - { - Name = "NoLicense", - Url = new Uri("https://www.apache.org/licenses/LICENSE-2.0.html") - }, - Version = "1.0.0", - }); - c.CustomSchemaIds(type => type.FriendlyId(true)); - c.DescribeAllEnumsAsStrings(); - c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{Assembly.GetEntryAssembly().GetName().Name}.xml"); - // Sets the basePath property in the Swagger document generated - c.DocumentFilter("/v2"); - - // Include DataAnnotation attributes on Controller Action parameters as Swagger validation rules (e.g required, pattern, ..) - // Use [ValidateModelState] on Actions to actually validate it in C# as well! - c.OperationFilter(); - }); - services - .AddSwaggerGenNewtonsoftSupport(); - } - - /// - /// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - /// - /// - /// - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - else - { - app.UseHsts(); - } - - app.UseHttpsRedirection(); - app - // TODO: Renable if you need MVC views as well as just the API - //.UseMvc() - .UseDefaultFiles() - .UseStaticFiles() - .UseSwagger(c => - { - c.RouteTemplate = "swagger/{documentName}/openapi.json"; - }) - .UseSwaggerUI(c => - { - //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/1.0.0/openapi.json", "OpenAPI Petstore"); - - //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/openapi-original.json", "OpenAPI Petstore Original"); - }); - app.UseRouting(); - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/appsettings.json b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/appsettings.json deleted file mode 100644 index def9159a7d9..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/appsettings.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Warning" - } - }, - "AllowedHosts": "*" -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/README.md b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/README.md deleted file mode 100644 index 6a0b78471a3..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# Welcome to ASP.NET 5 Preview - -We've made some big updates in this release, so it’s **important** that you spend a few minutes to learn what’s new. - -ASP.NET 5 has been rearchitected to make it **lean** and **composable**. It's fully **open source** and available on [GitHub](http://go.microsoft.com/fwlink/?LinkID=517854). -Your new project automatically takes advantage of modern client-side utilities like [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) and [npm](http://go.microsoft.com/fwlink/?LinkId=518005) (to add client-side libraries) and [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) (for client-side build and automation tasks). - -We hope you enjoy the new capabilities in ASP.NET 5 and Visual Studio 2015. -The ASP.NET Team - -### You've created a new ASP.NET 5 project. [Learn what's new](http://go.microsoft.com/fwlink/?LinkId=518016) - -### This application consists of: -* Sample pages using ASP.NET MVC 6 -* [Gulp](http://go.microsoft.com/fwlink/?LinkId=518007) and [Bower](http://go.microsoft.com/fwlink/?LinkId=518004) for managing client-side resources -* Theming using [Bootstrap](http://go.microsoft.com/fwlink/?LinkID=398939) - -#### NEW CONCEPTS -* [The 'wwwroot' explained](http://go.microsoft.com/fwlink/?LinkId=518008) -* [Configuration in ASP.NET 5](http://go.microsoft.com/fwlink/?LinkId=518012) -* [Dependency Injection](http://go.microsoft.com/fwlink/?LinkId=518013) -* [Razor TagHelpers](http://go.microsoft.com/fwlink/?LinkId=518014) -* [Manage client packages using Gulp](http://go.microsoft.com/fwlink/?LinkID=517849) -* [Develop on different platforms](http://go.microsoft.com/fwlink/?LinkID=517850) - -#### CUSTOMIZE APP -* [Add Controllers and Views](http://go.microsoft.com/fwlink/?LinkID=398600) -* [Add Data using EntityFramework](http://go.microsoft.com/fwlink/?LinkID=398602) -* [Add Authentication using Identity](http://go.microsoft.com/fwlink/?LinkID=398603) -* [Add real time support using SignalR](http://go.microsoft.com/fwlink/?LinkID=398606) -* [Add Class library](http://go.microsoft.com/fwlink/?LinkID=398604) -* [Add Web APIs with MVC 6](http://go.microsoft.com/fwlink/?LinkId=518009) -* [Add client packages using Bower](http://go.microsoft.com/fwlink/?LinkID=517848) - -#### DEPLOY -* [Run your app locally](http://go.microsoft.com/fwlink/?LinkID=517851) -* [Run your app on ASP.NET Core 5](http://go.microsoft.com/fwlink/?LinkID=517852) -* [Run commands in your 'project.json'](http://go.microsoft.com/fwlink/?LinkID=517853) -* [Publish to Microsoft Azure Web Sites](http://go.microsoft.com/fwlink/?LinkID=398609) -* [Publish to the file system](http://go.microsoft.com/fwlink/?LinkId=518019) - -We would love to hear your [feedback](http://go.microsoft.com/fwlink/?LinkId=518015) diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/index.html b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/index.html deleted file mode 100644 index cde1f2f90b9..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/index.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/openapi-original.json b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/openapi-original.json deleted file mode 100644 index c275869fc6d..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/openapi-original.json +++ /dev/null @@ -1,1012 +0,0 @@ -{ - "openapi" : "3.0.1", - "info" : { - "description" : "This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.", - "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/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" : { - "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" - }, - "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" : { - "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" - } - }, - "/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" ] - } - }, - "/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" - }, - "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 tag value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Finds Pets by tags", - "tags" : [ "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" : { - "400" : { - "content" : { }, - "description" : "Invalid pet value" - } - }, - "security" : [ { - "petstore_auth" : [ "write:pets", "read:pets" ] - } ], - "summary" : "Deletes a pet", - "tags" : [ "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" ] - }, - "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" : { - "properties" : { - "name" : { - "description" : "Updated name of the pet", - "type" : "string" - }, - "status" : { - "description" : "Updated status of the pet", - "type" : "string" - } - } - } - } - } - }, - "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" ] - } - }, - "/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" : { - "properties" : { - "additionalMetadata" : { - "description" : "Additional data to pass to server", - "type" : "string" - }, - "file" : { - "description" : "file to upload", - "format" : "binary", - "type" : "string" - } - } - } - } - } - }, - "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" ] - } - }, - "/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" ] - } - }, - "/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" - } - }, - "/store/order/{orderId}" : { - "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" : "orderId", - "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" ] - }, - "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" : "orderId", - "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" ] - } - }, - "/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" - } - }, - "/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" - } - }, - "/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" - } - }, - "/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" ] - } - }, - "/user/logout" : { - "get" : { - "operationId" : "logoutUser", - "responses" : { - "default" : { - "content" : { }, - "description" : "successful operation" - } - }, - "summary" : "Logs out current logged in user session", - "tags" : [ "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" ] - }, - "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" ] - }, - "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" - } - } - }, - "components" : { - "schemas" : { - "Order" : { - "description" : "An order for a pets from the pet store", - "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" - } - }, - "title" : "Pet Order", - "type" : "object", - "xml" : { - "name" : "Order" - } - }, - "Category" : { - "description" : "A category for a pet", - "example" : { - "name" : "name", - "id" : 6 - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet category", - "type" : "object", - "xml" : { - "name" : "Category" - } - }, - "User" : { - "description" : "A User who is purchasing from the pet store", - "example" : { - "firstName" : "firstName", - "lastName" : "lastName", - "password" : "password", - "userStatus" : 6, - "phone" : "phone", - "id" : 0, - "email" : "email", - "username" : "username" - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "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" - } - }, - "title" : "a User", - "type" : "object", - "xml" : { - "name" : "User" - } - }, - "Tag" : { - "description" : "A tag for a pet", - "example" : { - "name" : "name", - "id" : 1 - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "name" : { - "type" : "string" - } - }, - "title" : "Pet Tag", - "type" : "object", - "xml" : { - "name" : "Tag" - } - }, - "Pet" : { - "description" : "A pet for sale in the pet store", - "example" : { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" - }, - "properties" : { - "id" : { - "format" : "int64", - "type" : "integer" - }, - "category" : { - "$ref" : "#/components/schemas/Category" - }, - "name" : { - "example" : "doggie", - "type" : "string" - }, - "photoUrls" : { - "items" : { - "type" : "string" - }, - "type" : "array", - "xml" : { - "name" : "photoUrl", - "wrapped" : true - } - }, - "tags" : { - "items" : { - "$ref" : "#/components/schemas/Tag" - }, - "type" : "array", - "xml" : { - "name" : "tag", - "wrapped" : true - } - }, - "status" : { - "description" : "pet status in the store", - "enum" : [ "available", "pending", "sold" ], - "type" : "string" - } - }, - "required" : [ "name", "photoUrls" ], - "title" : "a Pet", - "type" : "object", - "xml" : { - "name" : "Pet" - } - }, - "ApiResponse" : { - "description" : "Describes the result of uploading an image resource", - "example" : { - "code" : 0, - "type" : "type", - "message" : "message" - }, - "properties" : { - "code" : { - "format" : "int32", - "type" : "integer" - }, - "type" : { - "type" : "string" - }, - "message" : { - "type" : "string" - } - }, - "title" : "An uploaded response", - "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" - } - } - } -} diff --git a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/web.config b/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/web.config deleted file mode 100644 index e70a7778d60..00000000000 --- a/samples/server/petstore/aspnetcore3/src/Org.OpenAPITools/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION b/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc19..00000000000 --- a/samples/server/petstore/cpp-qt5-qhttpengine-server/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/.openapi-generator-ignore b/samples/server/petstore/helidon/se-default/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/server/petstore/helidon/se-default/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/server/petstore/helidon/se-default/.openapi-generator/FILES b/samples/server/petstore/helidon/se-default/.openapi-generator/FILES deleted file mode 100644 index 6fcc1abdb5e..00000000000 --- a/samples/server/petstore/helidon/se-default/.openapi-generator/FILES +++ /dev/null @@ -1,117 +0,0 @@ -.openapi-generator-ignore -README.md -build.gradle -pom.xml -settings.gradle -src/main/java/org/openapitools/server/Main.java -src/main/java/org/openapitools/server/RFC3339DateFormat.java -src/main/java/org/openapitools/server/api/AnotherFakeService.java -src/main/java/org/openapitools/server/api/DefaultService.java -src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java -src/main/java/org/openapitools/server/api/FakeService.java -src/main/java/org/openapitools/server/api/JsonProvider.java -src/main/java/org/openapitools/server/api/PetService.java -src/main/java/org/openapitools/server/api/StoreService.java -src/main/java/org/openapitools/server/api/UserService.java -src/main/java/org/openapitools/server/api/ValidatorUtils.java -src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java -src/main/java/org/openapitools/server/model/Animal.java -src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/server/model/ArrayTest.java -src/main/java/org/openapitools/server/model/Capitalization.java -src/main/java/org/openapitools/server/model/Cat.java -src/main/java/org/openapitools/server/model/CatAllOf.java -src/main/java/org/openapitools/server/model/Category.java -src/main/java/org/openapitools/server/model/ClassModel.java -src/main/java/org/openapitools/server/model/Client.java -src/main/java/org/openapitools/server/model/DeprecatedObject.java -src/main/java/org/openapitools/server/model/Dog.java -src/main/java/org/openapitools/server/model/DogAllOf.java -src/main/java/org/openapitools/server/model/EnumArrays.java -src/main/java/org/openapitools/server/model/EnumClass.java -src/main/java/org/openapitools/server/model/EnumTest.java -src/main/java/org/openapitools/server/model/FileSchemaTestClass.java -src/main/java/org/openapitools/server/model/Foo.java -src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java -src/main/java/org/openapitools/server/model/FormatTest.java -src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/server/model/HealthCheckResult.java -src/main/java/org/openapitools/server/model/MapTest.java -src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/server/model/Model200Response.java -src/main/java/org/openapitools/server/model/ModelApiResponse.java -src/main/java/org/openapitools/server/model/ModelFile.java -src/main/java/org/openapitools/server/model/ModelList.java -src/main/java/org/openapitools/server/model/ModelReturn.java -src/main/java/org/openapitools/server/model/Name.java -src/main/java/org/openapitools/server/model/NullableClass.java -src/main/java/org/openapitools/server/model/NumberOnly.java -src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java -src/main/java/org/openapitools/server/model/Order.java -src/main/java/org/openapitools/server/model/OuterComposite.java -src/main/java/org/openapitools/server/model/OuterEnum.java -src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java -src/main/java/org/openapitools/server/model/OuterEnumInteger.java -src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java -src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java -src/main/java/org/openapitools/server/model/Pet.java -src/main/java/org/openapitools/server/model/ReadOnlyFirst.java -src/main/java/org/openapitools/server/model/SingleRefType.java -src/main/java/org/openapitools/server/model/SpecialModelName.java -src/main/java/org/openapitools/server/model/Tag.java -src/main/java/org/openapitools/server/model/User.java -src/main/java/org/openapitools/server/package-info.java -src/main/resources/META-INF/openapi.yml -src/main/resources/application.yaml -src/main/resources/logging.properties -src/test/java/org/openapitools/server/MainTest.java -src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java -src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java -src/test/java/org/openapitools/server/model/AnimalTest.java -src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java -src/test/java/org/openapitools/server/model/ArrayTestTest.java -src/test/java/org/openapitools/server/model/CapitalizationTest.java -src/test/java/org/openapitools/server/model/CatAllOfTest.java -src/test/java/org/openapitools/server/model/CatTest.java -src/test/java/org/openapitools/server/model/CategoryTest.java -src/test/java/org/openapitools/server/model/ClassModelTest.java -src/test/java/org/openapitools/server/model/ClientTest.java -src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java -src/test/java/org/openapitools/server/model/DogAllOfTest.java -src/test/java/org/openapitools/server/model/DogTest.java -src/test/java/org/openapitools/server/model/EnumArraysTest.java -src/test/java/org/openapitools/server/model/EnumClassTest.java -src/test/java/org/openapitools/server/model/EnumTestTest.java -src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java -src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java -src/test/java/org/openapitools/server/model/FooTest.java -src/test/java/org/openapitools/server/model/FormatTestTest.java -src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java -src/test/java/org/openapitools/server/model/HealthCheckResultTest.java -src/test/java/org/openapitools/server/model/MapTestTest.java -src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java -src/test/java/org/openapitools/server/model/Model200ResponseTest.java -src/test/java/org/openapitools/server/model/ModelApiResponseTest.java -src/test/java/org/openapitools/server/model/ModelFileTest.java -src/test/java/org/openapitools/server/model/ModelListTest.java -src/test/java/org/openapitools/server/model/ModelReturnTest.java -src/test/java/org/openapitools/server/model/NameTest.java -src/test/java/org/openapitools/server/model/NullableClassTest.java -src/test/java/org/openapitools/server/model/NumberOnlyTest.java -src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java -src/test/java/org/openapitools/server/model/OrderTest.java -src/test/java/org/openapitools/server/model/OuterCompositeTest.java -src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java -src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java -src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java -src/test/java/org/openapitools/server/model/OuterEnumTest.java -src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java -src/test/java/org/openapitools/server/model/PetTest.java -src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java -src/test/java/org/openapitools/server/model/SingleRefTypeTest.java -src/test/java/org/openapitools/server/model/SpecialModelNameTest.java -src/test/java/org/openapitools/server/model/TagTest.java -src/test/java/org/openapitools/server/model/UserTest.java diff --git a/samples/server/petstore/helidon/se-default/.openapi-generator/VERSION b/samples/server/petstore/helidon/se-default/.openapi-generator/VERSION deleted file mode 100644 index 5f68295fc19..00000000000 --- a/samples/server/petstore/helidon/se-default/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/README.md b/samples/server/petstore/helidon/se-default/README.md deleted file mode 100644 index 540d6734b4c..00000000000 --- a/samples/server/petstore/helidon/se-default/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Helidon SE Server with OpenAPI - -## Build and run - -With JDK11+ -```bash -mvn package -java -jar target/petstore-helidon-se-server.jar -``` - -## Exercise the application - -``` -curl -X PATCH http://petstore.swagger.io:80/v2/another-fake/dummy -curl -X GET http://petstore.swagger.io:80/v2/foo -curl -X GET http://petstore.swagger.io:80/v2/fake/health -curl -X GET http://petstore.swagger.io:80/v2/fake/http-signature-test -curl -X POST http://petstore.swagger.io:80/v2/fake/outer/boolean -curl -X POST http://petstore.swagger.io:80/v2/fake/outer/composite -curl -X POST http://petstore.swagger.io:80/v2/fake/outer/number -curl -X POST http://petstore.swagger.io:80/v2/fake/outer/string -curl -X POST http://petstore.swagger.io:80/v2/fake/property/enum-int -curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-binary -curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-file-schema -curl -X PUT http://petstore.swagger.io:80/v2/fake/body-with-query-params -curl -X PATCH http://petstore.swagger.io:80/v2/fake -curl -X POST http://petstore.swagger.io:80/v2/fake -curl -X GET http://petstore.swagger.io:80/v2/fake -curl -X DELETE http://petstore.swagger.io:80/v2/fake -curl -X POST http://petstore.swagger.io:80/v2/fake/inline-additionalProperties -curl -X GET http://petstore.swagger.io:80/v2/fake/jsonFormData -curl -X PUT http://petstore.swagger.io:80/v2/fake/test-query-parameters -curl -X PATCH http://petstore.swagger.io:80/v2/fake_classname_test -curl -X POST http://petstore.swagger.io:80/v2/pet -curl -X DELETE http://petstore.swagger.io:80/v2/pet/{petId} -curl -X GET http://petstore.swagger.io:80/v2/pet/findByStatus -curl -X GET http://petstore.swagger.io:80/v2/pet/findByTags -curl -X GET http://petstore.swagger.io:80/v2/pet/{petId} -curl -X PUT http://petstore.swagger.io:80/v2/pet -curl -X POST http://petstore.swagger.io:80/v2/pet/{petId} -curl -X POST http://petstore.swagger.io:80/v2/pet/{petId}/uploadImage -curl -X POST http://petstore.swagger.io:80/v2/fake/{petId}/uploadImageWithRequiredFile -curl -X DELETE http://petstore.swagger.io:80/v2/store/order/{order_id} -curl -X GET http://petstore.swagger.io:80/v2/store/inventory -curl -X GET http://petstore.swagger.io:80/v2/store/order/{order_id} -curl -X POST http://petstore.swagger.io:80/v2/store/order -curl -X POST http://petstore.swagger.io:80/v2/user -curl -X POST http://petstore.swagger.io:80/v2/user/createWithArray -curl -X POST http://petstore.swagger.io:80/v2/user/createWithList -curl -X DELETE http://petstore.swagger.io:80/v2/user/{username} -curl -X GET http://petstore.swagger.io:80/v2/user/{username} -curl -X GET http://petstore.swagger.io:80/v2/user/login -curl -X GET http://petstore.swagger.io:80/v2/user/logout -curl -X PUT http://petstore.swagger.io:80/v2/user/{username} - -``` - -## Try health and metrics - -``` -curl -s -X GET http://petstore.swagger.io:80/v2/health -{"outcome":"UP",... -. . . - -# Prometheus Format -curl -s -X GET http://petstore.swagger.io:80/v2/metrics -# TYPE base:gc_g1_young_generation_count gauge -. . . - -# JSON Format -curl -H 'Accept: application/json' -X GET http://petstore.swagger.io:80/v2/metrics -{"base":... -. . . -``` \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/build.gradle b/samples/server/petstore/helidon/se-default/build.gradle deleted file mode 100644 index 82a52e798c7..00000000000 --- a/samples/server/petstore/helidon/se-default/build.gradle +++ /dev/null @@ -1,77 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -group = 'org.openapitools' -version = '1.0.0' - -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: \" \\""" - - -sourceCompatibility = 11 -targetCompatibility = 11 - -tasks.withType(JavaCompile) { - options.encoding = 'UTF-8' -} - -ext { - helidonVersion = '2.5.2' - mainClass='org.openapitools.server.Main' - validationApiVersion = '2.0.1.Final' -} - -test { - useJUnitPlatform() -} - -repositories { - mavenCentral() - mavenLocal() -} - -dependencies { - // import Helidon BOM - implementation enforcedPlatform("io.helidon:helidon-dependencies:${project.helidonVersion}") - implementation "javax.validation:validation-api:${project.validationApiVersion}" - implementation 'io.helidon.webserver:helidon-webserver' - implementation 'io.helidon.media:helidon-media-jsonp' - implementation 'io.helidon.media:helidon-media-jackson' - implementation 'io.helidon.media:helidon-media-multipart' - implementation 'io.helidon.config:helidon-config-yaml' - implementation 'io.helidon.health:helidon-health' - implementation 'io.helidon.health:helidon-health-checks' - implementation 'io.helidon.metrics:helidon-metrics' - implementation 'io.helidon.openapi:helidon-openapi' - testImplementation 'org.junit.jupiter:junit-jupiter-api' - testImplementation 'io.helidon.webclient:helidon-webclient' - testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' -} - -// define a custom task to copy all dependencies in the runtime classpath -// into build/libs/libs -// uses built-in Copy -task copyLibs(type: Copy) { - from configurations.runtimeClasspath - into 'build/libs/libs' -} - -// add it as a dependency of built-in task 'assemble' -copyLibs.dependsOn jar -assemble.dependsOn copyLibs - -// default jar configuration -// set the main classpath -// add each jar under build/libs/libs into the classpath -jar { - archiveFileName = "${project.name}.jar" - manifest { - attributes ('Main-Class': "${project.mainClass}", - 'Class-Path': configurations.runtimeClasspath.files.collect { "libs/$it.name" }.join(' ') - ) - } -} -application { -mainClass = "${project.mainClass}" -} diff --git a/samples/server/petstore/helidon/se-default/pom.xml b/samples/server/petstore/helidon/se-default/pom.xml deleted file mode 100644 index b2b12f12735..00000000000 --- a/samples/server/petstore/helidon/se-default/pom.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - 4.0.0 - - io.helidon.applications - helidon-se - 2.5.2 - - - org.openapitools - petstore-helidon-se-server - 1.0.0 - petstore-helidon-se-server - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - - - org.openapitools.server.Main - 2.0.1.Final - - - - - javax.validation - validation-api - ${version.validation.api} - - - io.helidon.webserver - helidon-webserver - - - io.helidon.media - helidon-media-jsonp - - - io.helidon.media - helidon-media-multipart - - - io.helidon.config - helidon-config-yaml - - - io.helidon.health - helidon-health - - - io.helidon.health - helidon-health-checks - - - io.helidon.metrics - helidon-metrics - - - io.helidon.openapi - helidon-openapi - - - io.helidon.media - helidon-media-jackson - - - org.junit.jupiter - junit-jupiter-api - test - - - io.helidon.webclient - helidon-webclient - test - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-libs - - - - - io.helidon.build-tools - helidon-maven-plugin - - - third-party-license-report - - - - - - diff --git a/samples/server/petstore/helidon/se-default/settings.gradle b/samples/server/petstore/helidon/se-default/settings.gradle deleted file mode 100644 index 891d6d6d87c..00000000000 --- a/samples/server/petstore/helidon/se-default/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'petstore-helidon-se-server' \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/Main.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/Main.java deleted file mode 100644 index 00e0eda238e..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/Main.java +++ /dev/null @@ -1,89 +0,0 @@ -package org.openapitools.server; - - -import io.helidon.common.LogConfig; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.health.HealthSupport; -import io.helidon.health.checks.HealthChecks; -import io.helidon.media.jsonp.JsonpSupport; -import io.helidon.media.jackson.JacksonSupport; -import org.openapitools.server.api.JsonProvider; -import io.helidon.metrics.MetricsSupport; -import io.helidon.openapi.OpenAPISupport; -import io.helidon.webserver.Routing; -import io.helidon.webserver.WebServer; - -/** -* The application main class. -*/ -public final class Main { - - /** - * Cannot be instantiated. - */ - private Main() { - } - - /** - * Application main entry point. - * @param args command line arguments. - */ - public static void main(final String[] args) { - startServer(); - } - - /** - * Start the server. - * @return the created {@link WebServer} instance - */ - static Single startServer() { - - // load logging configuration - LogConfig.configureRuntime(); - - // By default this will pick up application.yaml from the classpath - Config config = Config.create(); - - WebServer server = WebServer.builder(createRouting(config)) - .config(config.get("server")) - .addMediaSupport(JsonpSupport.create()) - .addMediaSupport(JacksonSupport.create(JsonProvider.objectMapper())) - .build(); - - Single webserver = server.start(); - - // Try to start the server. If successful, print some info and arrange to - // print a message at shutdown. If unsuccessful, print the exception. - webserver.thenAccept(ws -> { - System.out.println("WEB server is up! http://petstore.swagger.io:80/v2"); - ws.whenShutdown().thenRun(() -> System.out.println("WEB server is DOWN. Good bye!")); - }) - .exceptionallyAccept(t -> { - System.err.println("Startup failed: " + t.getMessage()); - t.printStackTrace(System.err); - }); - - return webserver; - } - - /** - * Creates new {@link Routing}. - * - * @return routing configured with JSON support, a health check, and a service - * @param config configuration of this server - */ - private static Routing createRouting(Config config) { - - MetricsSupport metrics = MetricsSupport.create(); - HealthSupport health = HealthSupport.builder() - .addLiveness(HealthChecks.healthChecks()) // Adds a convenient set of checks - .build(); - - return Routing.builder() - .register(OpenAPISupport.create(config.get(OpenAPISupport.Builder.CONFIG_KEY))) - .register(health) // Health at "/health" - .register(metrics) // Metrics at "/metrics" - .build(); - } -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/RFC3339DateFormat.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/RFC3339DateFormat.java deleted file mode 100644 index f47f2f7f983..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/RFC3339DateFormat.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/AnotherFakeService.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/AnotherFakeService.java deleted file mode 100644 index ce5241a2f9a..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/AnotherFakeService.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.openapitools.server.api; - -import org.openapitools.server.model.Client; -import io.helidon.webserver.Handler; -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.util.Optional; -import java.util.logging.Logger; - -import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - - -public abstract class AnotherFakeService implements Service { - - protected static final Logger LOGGER = Logger.getLogger(AnotherFakeService.class.getName()); - private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); - - protected final Config config; - - public AnotherFakeService(Config config) { - this.config = config; - } - - /** - * A service registers itself by updating the routing rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules.patch("/another-fake/dummy", Handler.create(Client.class, this::call123testSpecialTags)); - } - - - /** - * PATCH /another-fake/dummy : To test special tags. - * @param request the server request - * @param response the server response - * @param client client model - */ - void call123testSpecialTags(ServerRequest request, ServerResponse response, Client client) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(client); - - handleCall123testSpecialTags(request, response, client); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PATCH /another-fake/dummy : To test special tags. - * @param request the server request - * @param response the server response - * @param client client model - */ - abstract void handleCall123testSpecialTags(ServerRequest request, ServerResponse response, Client client); - - - abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable); -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/DefaultService.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/DefaultService.java deleted file mode 100644 index 1c6febbae70..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/DefaultService.java +++ /dev/null @@ -1,61 +0,0 @@ -package org.openapitools.server.api; - -import org.openapitools.server.model.FooGetDefaultResponse; -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.util.Optional; -import java.util.logging.Logger; - -import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - - -public abstract class DefaultService implements Service { - - protected static final Logger LOGGER = Logger.getLogger(DefaultService.class.getName()); - private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); - - protected final Config config; - - public DefaultService(Config config) { - this.config = config; - } - - /** - * A service registers itself by updating the routing rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules.get("/foo", this::fooGet); - } - - - /** - * GET /foo. - * @param request the server request - * @param response the server response - */ - void fooGet(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - - handleFooGet(request, response); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /foo. - * @param request the server request - * @param response the server response - */ - abstract void handleFooGet(ServerRequest request, ServerResponse response); - - - abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable); -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java deleted file mode 100644 index e95639e45f0..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/FakeClassnameTags123Service.java +++ /dev/null @@ -1,65 +0,0 @@ -package org.openapitools.server.api; - -import org.openapitools.server.model.Client; -import io.helidon.webserver.Handler; -import com.fasterxml.jackson.databind.ObjectMapper; - -import java.util.Optional; -import java.util.logging.Logger; - -import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - - -public abstract class FakeClassnameTags123Service implements Service { - - protected static final Logger LOGGER = Logger.getLogger(FakeClassnameTags123Service.class.getName()); - private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); - - protected final Config config; - - public FakeClassnameTags123Service(Config config) { - this.config = config; - } - - /** - * A service registers itself by updating the routing rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules.patch("/fake_classname_test", Handler.create(Client.class, this::testClassname)); - } - - - /** - * PATCH /fake_classname_test : To test class name in snake case. - * @param request the server request - * @param response the server response - * @param client client model - */ - void testClassname(ServerRequest request, ServerResponse response, Client client) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(client); - - handleTestClassname(request, response, client); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PATCH /fake_classname_test : To test class name in snake case. - * @param request the server request - * @param response the server response - * @param client client model - */ - abstract void handleTestClassname(ServerRequest request, ServerResponse response, Client client); - - - abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable); -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/FakeService.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/FakeService.java deleted file mode 100644 index f668ccfcd6f..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/FakeService.java +++ /dev/null @@ -1,668 +0,0 @@ -package org.openapitools.server.api; - -import java.util.ArrayList; -import java.math.BigDecimal; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import org.openapitools.server.model.Client; -import io.helidon.common.http.DataChunk; -import org.openapitools.server.model.EnumClass; -import java.io.File; -import org.openapitools.server.model.FileSchemaTestClass; -import io.helidon.webserver.Handler; -import java.util.HashMap; -import org.openapitools.server.model.HealthCheckResult; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.time.LocalDate; -import java.util.Map; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.time.OffsetDateTime; -import org.openapitools.server.model.OuterComposite; -import org.openapitools.server.model.OuterObjectWithEnumProperty; -import org.openapitools.server.model.Pet; -import io.helidon.media.multipart.ReadableBodyPart; -import java.io.UncheckedIOException; -import org.openapitools.server.model.User; - -import java.util.Optional; -import java.util.logging.Logger; - -import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - - -public abstract class FakeService implements Service { - - protected static final Logger LOGGER = Logger.getLogger(FakeService.class.getName()); - private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); - - protected final Config config; - - public FakeService(Config config) { - this.config = config; - } - - /** - * A service registers itself by updating the routing rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules.get("/fake/health", this::fakeHealthGet); - rules.get("/fake/http-signature-test", Handler.create(Pet.class, this::fakeHttpSignatureTest)); - rules.post("/fake/outer/boolean", this::fakeOuterBooleanSerialize); - rules.post("/fake/outer/composite", Handler.create(OuterComposite.class, this::fakeOuterCompositeSerialize)); - rules.post("/fake/outer/number", this::fakeOuterNumberSerialize); - rules.post("/fake/outer/string", this::fakeOuterStringSerialize); - rules.post("/fake/property/enum-int", Handler.create(OuterObjectWithEnumProperty.class, this::fakePropertyEnumIntegerSerialize)); - rules.put("/fake/body-with-binary", this::testBodyWithBinary); - rules.put("/fake/body-with-file-schema", Handler.create(FileSchemaTestClass.class, this::testBodyWithFileSchema)); - rules.put("/fake/body-with-query-params", Handler.create(User.class, this::testBodyWithQueryParams)); - rules.patch("/fake", Handler.create(Client.class, this::testClientModel)); - rules.post("/fake", this::testEndpointParameters); - rules.get("/fake", this::testEnumParameters); - rules.delete("/fake", this::testGroupParameters); - rules.post("/fake/inline-additionalProperties", this::testInlineAdditionalProperties); - rules.get("/fake/jsonFormData", this::testJsonFormData); - rules.put("/fake/test-query-parameters", this::testQueryParameterCollectionFormat); - } - - - private void processNonFileFormField(String name, Map> nonFileFormContent, ReadableBodyPart part) { - List content = nonFileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); - part.content().as(String.class).thenAccept(content::add); - } - - private void processFileFormField(String name, Map> fileFormContent, ReadableBodyPart part) { - List content = fileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); - part.content().map(DataChunk::bytes) - .collect(ByteArrayOutputStream::new, (stream, bytes) -> { - try { - stream.write(bytes); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }) - .thenAccept(byteStream -> content.add(new ByteArrayInputStream(byteStream.toByteArray()))); - } - - - /** - * GET /fake/health : Health check endpoint. - * @param request the server request - * @param response the server response - */ - void fakeHealthGet(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - - handleFakeHealthGet(request, response); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /fake/health : Health check endpoint. - * @param request the server request - * @param response the server response - */ - abstract void handleFakeHealthGet(ServerRequest request, ServerResponse response); - - - /** - * GET /fake/http-signature-test : test http signature authentication. - * @param request the server request - * @param response the server response - * @param pet Pet object that needs to be added to the store - */ - void fakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(pet); - String query1 = request.queryParams().toMap().getOrDefault("query_1", List.of()).stream().findFirst().orElse(null); - String header1 = request.headers().value("header_1").orElse(null); - - handleFakeHttpSignatureTest(request, response, pet, query1, header1); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /fake/http-signature-test : test http signature authentication. - * @param request the server request - * @param response the server response - * @param pet Pet object that needs to be added to the store - * @param query1 query parameter - * @param header1 header parameter - */ - abstract void handleFakeHttpSignatureTest(ServerRequest request, ServerResponse response, Pet pet, String query1, String header1); - - - /** - * POST /fake/outer/boolean. - * @param request the server request - * @param response the server response - */ - void fakeOuterBooleanSerialize(ServerRequest request, ServerResponse response) { - Single.create(request.content().as(new GenericType() { })) - .thenAccept(body -> { - ValidatorUtils.checkNonNull(body); - - handleFakeOuterBooleanSerialize(request, response, body); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake/outer/boolean. - * @param request the server request - * @param response the server response - * @param body Input boolean as post body - */ - abstract void handleFakeOuterBooleanSerialize(ServerRequest request, ServerResponse response, Boolean body); - - - /** - * POST /fake/outer/composite. - * @param request the server request - * @param response the server response - * @param outerComposite Input composite as post body - */ - void fakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, OuterComposite outerComposite) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(outerComposite); - - handleFakeOuterCompositeSerialize(request, response, outerComposite); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake/outer/composite. - * @param request the server request - * @param response the server response - * @param outerComposite Input composite as post body - */ - abstract void handleFakeOuterCompositeSerialize(ServerRequest request, ServerResponse response, OuterComposite outerComposite); - - - /** - * POST /fake/outer/number. - * @param request the server request - * @param response the server response - */ - void fakeOuterNumberSerialize(ServerRequest request, ServerResponse response) { - Single.create(request.content().as(new GenericType() { })) - .thenAccept(body -> { - ValidatorUtils.checkNonNull(body); - - handleFakeOuterNumberSerialize(request, response, body); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake/outer/number. - * @param request the server request - * @param response the server response - * @param body Input number as post body - */ - abstract void handleFakeOuterNumberSerialize(ServerRequest request, ServerResponse response, BigDecimal body); - - - /** - * POST /fake/outer/string. - * @param request the server request - * @param response the server response - */ - void fakeOuterStringSerialize(ServerRequest request, ServerResponse response) { - Single.create(request.content().as(new GenericType() { })) - .thenAccept(body -> { - ValidatorUtils.checkNonNull(body); - - handleFakeOuterStringSerialize(request, response, body); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake/outer/string. - * @param request the server request - * @param response the server response - * @param body Input string as post body - */ - abstract void handleFakeOuterStringSerialize(ServerRequest request, ServerResponse response, String body); - - - /** - * POST /fake/property/enum-int. - * @param request the server request - * @param response the server response - * @param outerObjectWithEnumProperty Input enum (int) as post body - */ - void fakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, OuterObjectWithEnumProperty outerObjectWithEnumProperty) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(outerObjectWithEnumProperty); - - handleFakePropertyEnumIntegerSerialize(request, response, outerObjectWithEnumProperty); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake/property/enum-int. - * @param request the server request - * @param response the server response - * @param outerObjectWithEnumProperty Input enum (int) as post body - */ - abstract void handleFakePropertyEnumIntegerSerialize(ServerRequest request, ServerResponse response, OuterObjectWithEnumProperty outerObjectWithEnumProperty); - - - /** - * PUT /fake/body-with-binary. - * @param request the server request - * @param response the server response - */ - void testBodyWithBinary(ServerRequest request, ServerResponse response) { - Single.create(request.content().as(new GenericType() { })) - .thenAccept(body -> { - ValidatorUtils.checkNonNull(body); - - handleTestBodyWithBinary(request, response, body); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PUT /fake/body-with-binary. - * @param request the server request - * @param response the server response - * @param body image to upload - */ - abstract void handleTestBodyWithBinary(ServerRequest request, ServerResponse response, InputStream body); - - - /** - * PUT /fake/body-with-file-schema. - * @param request the server request - * @param response the server response - * @param fileSchemaTestClass fileSchemaTestClass - */ - void testBodyWithFileSchema(ServerRequest request, ServerResponse response, FileSchemaTestClass fileSchemaTestClass) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(fileSchemaTestClass); - - handleTestBodyWithFileSchema(request, response, fileSchemaTestClass); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PUT /fake/body-with-file-schema. - * @param request the server request - * @param response the server response - * @param fileSchemaTestClass fileSchemaTestClass - */ - abstract void handleTestBodyWithFileSchema(ServerRequest request, ServerResponse response, FileSchemaTestClass fileSchemaTestClass); - - - /** - * PUT /fake/body-with-query-params. - * @param request the server request - * @param response the server response - * @param user user - */ - void testBodyWithQueryParams(ServerRequest request, ServerResponse response, User user) { - Single.create(Single.empty()) - .thenAccept(val -> { - String query = request.queryParams().toMap().getOrDefault("query", List.of()).stream().findFirst().orElse(null); - ValidatorUtils.checkNonNull(query); - ValidatorUtils.checkNonNull(user); - - handleTestBodyWithQueryParams(request, response, query, user); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PUT /fake/body-with-query-params. - * @param request the server request - * @param response the server response - * @param query query - * @param user user - */ - abstract void handleTestBodyWithQueryParams(ServerRequest request, ServerResponse response, String query, User user); - - - /** - * PATCH /fake : To test \"client\" model. - * @param request the server request - * @param response the server response - * @param client client model - */ - void testClientModel(ServerRequest request, ServerResponse response, Client client) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(client); - - handleTestClientModel(request, response, client); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PATCH /fake : To test \"client\" model. - * @param request the server request - * @param response the server response - * @param client client model - */ - abstract void handleTestClientModel(ServerRequest request, ServerResponse response, Client client); - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . - * @param request the server request - * @param response the server response - */ - void testEndpointParameters(ServerRequest request, ServerResponse response) { - Map> nonFileFormContent = new HashMap<>(); - Map> fileFormContent = new HashMap<>(); - Single formSingle = request.content().asStream(ReadableBodyPart.class) - .forEach(part -> { - String name = part.name(); - if ("integer".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("int32".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("int64".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("number".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("float".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("double".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("string".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("pattern_without_delimiter".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("byte".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("binary".equals(name)) { - processFileFormField(name, fileFormContent, part); - } - if ("date".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("dateTime".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("password".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("callback".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - part.drain(); - }); - Single.create(formSingle) - .thenAccept(val -> { - BigDecimal number = Optional.ofNullable(nonFileFormContent.get("number")).flatMap(list->list.stream().findFirst()).map(BigDecimal::new).orElse(null); - ValidatorUtils.checkNonNull(number); - ValidatorUtils.validateMin(number, "32.1", true); - ValidatorUtils.validateMax(number, "543.2", true); - Double _double = Optional.ofNullable(nonFileFormContent.get("double")).flatMap(list->list.stream().findFirst()).map(Double::valueOf).orElse(null); - ValidatorUtils.checkNonNull(_double); - ValidatorUtils.validateMin(_double, "67.8", true); - ValidatorUtils.validateMax(_double, "123.4", true); - String patternWithoutDelimiter = Optional.ofNullable(nonFileFormContent.get("pattern_without_delimiter")).flatMap(list->list.stream().findFirst()).orElse(null); - ValidatorUtils.checkNonNull(patternWithoutDelimiter); - ValidatorUtils.validatePattern(patternWithoutDelimiter, "^[A-Z].*"); - byte[] _byte = Optional.ofNullable(nonFileFormContent.get("byte")).flatMap(list->list.stream().findFirst()).map(byte[]::valueOf).orElse(null); - ValidatorUtils.checkNonNull(_byte); - Integer integer = Optional.ofNullable(nonFileFormContent.get("integer")).flatMap(list->list.stream().findFirst()).map(Integer::valueOf).orElse(null); - ValidatorUtils.validateMin(integer, 10); - ValidatorUtils.validateMax(integer, 100); - Integer int32 = Optional.ofNullable(nonFileFormContent.get("int32")).flatMap(list->list.stream().findFirst()).map(Integer::valueOf).orElse(null); - ValidatorUtils.validateMin(int32, 20); - ValidatorUtils.validateMax(int32, 200); - Long int64 = Optional.ofNullable(nonFileFormContent.get("int64")).flatMap(list->list.stream().findFirst()).map(Long::valueOf).orElse(null); - Float _float = Optional.ofNullable(nonFileFormContent.get("float")).flatMap(list->list.stream().findFirst()).map(Float::valueOf).orElse(null); - ValidatorUtils.validateMax(_float, "987.6", true); - String string = Optional.ofNullable(nonFileFormContent.get("string")).flatMap(list->list.stream().findFirst()).orElse(null); - ValidatorUtils.validatePattern(string, "/[a-z]/i"); - InputStream binary = Optional.ofNullable(fileFormContent.get("binary")).flatMap(list->list.stream().findFirst()).orElse(null); - LocalDate date = Optional.ofNullable(nonFileFormContent.get("date")).flatMap(list->list.stream().findFirst()).map(LocalDate::parse).orElse(null); - OffsetDateTime dateTime = Optional.ofNullable(nonFileFormContent.get("dateTime")).flatMap(list->list.stream().findFirst()).map(OffsetDateTime::parse).orElse(null); - String password = Optional.ofNullable(nonFileFormContent.get("password")).flatMap(list->list.stream().findFirst()).orElse(null); - ValidatorUtils.validateSize(password, 10, 64); - String paramCallback = Optional.ofNullable(nonFileFormContent.get("callback")).flatMap(list->list.stream().findFirst()).orElse(null); - - handleTestEndpointParameters(request, response, number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 . - * @param request the server request - * @param response the server response - * @param number None - * @param _double None - * @param patternWithoutDelimiter None - * @param _byte None - * @param integer None - * @param int32 None - * @param int64 None - * @param _float None - * @param string None - * @param binary None - * @param date None - * @param dateTime None - * @param password None - * @param paramCallback None - */ - abstract void handleTestEndpointParameters(ServerRequest request, ServerResponse response, BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, InputStream binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback); - - - /** - * GET /fake : To test enum parameters. - * @param request the server request - * @param response the server response - */ - void testEnumParameters(ServerRequest request, ServerResponse response) { - Map> nonFileFormContent = new HashMap<>(); - Map> fileFormContent = new HashMap<>(); - Single formSingle = request.content().asStream(ReadableBodyPart.class) - .forEach(part -> { - String name = part.name(); - if ("enum_form_string_array".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("enum_form_string".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - part.drain(); - }); - Single.create(formSingle) - .thenAccept(val -> { - List enumHeaderStringArray = request.headers().value("enum_header_string_array").orElse(null); - String enumHeaderString = request.headers().value("enum_header_string").orElse(null); - List enumQueryStringArray = Optional.ofNullable(request.queryParams().toMap().get("enum_query_string_array")).orElse(null); - String enumQueryString = request.queryParams().toMap().getOrDefault("enum_query_string", List.of()).stream().findFirst().orElse(null); - Integer enumQueryInteger = request.queryParams().toMap().getOrDefault("enum_query_integer", List.of()).stream().findFirst().map(Integer::valueOf).orElse(null); - Double enumQueryDouble = request.queryParams().toMap().getOrDefault("enum_query_double", List.of()).stream().findFirst().map(Double::valueOf).orElse(null); - List enumQueryModelArray = Optional.ofNullable(request.queryParams().toMap().get("enum_query_model_array")).orElse(null); - List enumFormStringArray = Optional.ofNullable(nonFileFormContent.get("enum_form_string_array")).orElse(null); - String enumFormString = Optional.ofNullable(nonFileFormContent.get("enum_form_string")).flatMap(list->list.stream().findFirst()).orElse(null); - - handleTestEnumParameters(request, response, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumQueryModelArray, enumFormStringArray, enumFormString); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /fake : To test enum parameters. - * @param request the server request - * @param response the server response - * @param enumHeaderStringArray Header parameter enum test (string array) - * @param enumHeaderString Header parameter enum test (string) - * @param enumQueryStringArray Query parameter enum test (string array) - * @param enumQueryString Query parameter enum test (string) - * @param enumQueryInteger Query parameter enum test (double) - * @param enumQueryDouble Query parameter enum test (double) - * @param enumQueryModelArray enumQueryModelArray - * @param enumFormStringArray Form parameter enum test (string array) - * @param enumFormString Form parameter enum test (string) - */ - abstract void handleTestEnumParameters(ServerRequest request, ServerResponse response, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumQueryModelArray, List enumFormStringArray, String enumFormString); - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional). - * @param request the server request - * @param response the server response - */ - void testGroupParameters(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - Integer requiredStringGroup = request.queryParams().toMap().getOrDefault("required_string_group", List.of()).stream().findFirst().map(Integer::valueOf).orElse(null); - ValidatorUtils.checkNonNull(requiredStringGroup); - Boolean requiredBooleanGroup = request.headers().value("required_boolean_group").map(Boolean::valueOf).orElse(null); - ValidatorUtils.checkNonNull(requiredBooleanGroup); - Long requiredInt64Group = request.queryParams().toMap().getOrDefault("required_int64_group", List.of()).stream().findFirst().map(Long::valueOf).orElse(null); - ValidatorUtils.checkNonNull(requiredInt64Group); - Integer stringGroup = request.queryParams().toMap().getOrDefault("string_group", List.of()).stream().findFirst().map(Integer::valueOf).orElse(null); - Boolean booleanGroup = request.headers().value("boolean_group").map(Boolean::valueOf).orElse(null); - Long int64Group = request.queryParams().toMap().getOrDefault("int64_group", List.of()).stream().findFirst().map(Long::valueOf).orElse(null); - - handleTestGroupParameters(request, response, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle DELETE /fake : Fake endpoint to test group parameters (optional). - * @param request the server request - * @param response the server response - * @param requiredStringGroup Required String in group parameters - * @param requiredBooleanGroup Required Boolean in group parameters - * @param requiredInt64Group Required Integer in group parameters - * @param stringGroup String in group parameters - * @param booleanGroup Boolean in group parameters - * @param int64Group Integer in group parameters - */ - abstract void handleTestGroupParameters(ServerRequest request, ServerResponse response, Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group); - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties. - * @param request the server request - * @param response the server response - */ - void testInlineAdditionalProperties(ServerRequest request, ServerResponse response) { - Single.create(request.content().as(new GenericType>() { })) - .thenAccept(requestBody -> { - ValidatorUtils.checkNonNull(requestBody); - - handleTestInlineAdditionalProperties(request, response, requestBody); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake/inline-additionalProperties : test inline additionalProperties. - * @param request the server request - * @param response the server response - * @param requestBody request body - */ - abstract void handleTestInlineAdditionalProperties(ServerRequest request, ServerResponse response, String requestBody); - - - /** - * GET /fake/jsonFormData : test json serialization of form data. - * @param request the server request - * @param response the server response - */ - void testJsonFormData(ServerRequest request, ServerResponse response) { - Map> nonFileFormContent = new HashMap<>(); - Map> fileFormContent = new HashMap<>(); - Single formSingle = request.content().asStream(ReadableBodyPart.class) - .forEach(part -> { - String name = part.name(); - if ("param".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("param2".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - part.drain(); - }); - Single.create(formSingle) - .thenAccept(val -> { - String param = Optional.ofNullable(nonFileFormContent.get("param")).flatMap(list->list.stream().findFirst()).orElse(null); - ValidatorUtils.checkNonNull(param); - String param2 = Optional.ofNullable(nonFileFormContent.get("param2")).flatMap(list->list.stream().findFirst()).orElse(null); - ValidatorUtils.checkNonNull(param2); - - handleTestJsonFormData(request, response, param, param2); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /fake/jsonFormData : test json serialization of form data. - * @param request the server request - * @param response the server response - * @param param field1 - * @param param2 field2 - */ - abstract void handleTestJsonFormData(ServerRequest request, ServerResponse response, String param, String param2); - - - /** - * PUT /fake/test-query-parameters. - * @param request the server request - * @param response the server response - */ - void testQueryParameterCollectionFormat(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - List pipe = Optional.ofNullable(request.queryParams().toMap().get("pipe")).orElse(null); - ValidatorUtils.checkNonNull(pipe); - List ioutil = Optional.ofNullable(request.queryParams().toMap().get("ioutil")).orElse(null); - ValidatorUtils.checkNonNull(ioutil); - List http = Optional.ofNullable(request.queryParams().toMap().get("http")).orElse(null); - ValidatorUtils.checkNonNull(http); - List url = Optional.ofNullable(request.queryParams().toMap().get("url")).orElse(null); - ValidatorUtils.checkNonNull(url); - List context = Optional.ofNullable(request.queryParams().toMap().get("context")).orElse(null); - ValidatorUtils.checkNonNull(context); - String allowEmpty = request.queryParams().toMap().getOrDefault("allowEmpty", List.of()).stream().findFirst().orElse(null); - ValidatorUtils.checkNonNull(allowEmpty); - String language = Optional.ofNullable(request.queryParams().toMap().get("language")).orElse(null); - - handleTestQueryParameterCollectionFormat(request, response, pipe, ioutil, http, url, context, allowEmpty, language); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PUT /fake/test-query-parameters. - * @param request the server request - * @param response the server response - * @param pipe pipe - * @param ioutil ioutil - * @param http http - * @param url url - * @param context context - * @param allowEmpty allowEmpty - * @param language language - */ - abstract void handleTestQueryParameterCollectionFormat(ServerRequest request, ServerResponse response, List pipe, List ioutil, List http, List url, List context, String allowEmpty, String language); - - - abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable); -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/JsonProvider.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/JsonProvider.java deleted file mode 100644 index 41f01e882ab..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/JsonProvider.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.server.api; - -import com.fasterxml.jackson.annotation.JsonAutoDetect; -import com.fasterxml.jackson.annotation.PropertyAccessor; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; - -public class JsonProvider { - - public static ObjectMapper objectMapper() { - ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new JavaTimeModule()); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.setVisibility(PropertyAccessor.FIELD, JsonAutoDetect.Visibility.ANY); - mapper.configure(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE, false); - return mapper; - } -} \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/PetService.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/PetService.java deleted file mode 100644 index 06762d4d4a4..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/PetService.java +++ /dev/null @@ -1,352 +0,0 @@ -package org.openapitools.server.api; - -import java.util.ArrayList; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import io.helidon.common.http.DataChunk; -import java.io.File; -import io.helidon.webserver.Handler; -import java.util.HashMap; -import java.io.IOException; -import java.io.InputStream; -import java.util.List; -import java.util.Map; -import org.openapitools.server.model.ModelApiResponse; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.openapitools.server.model.Pet; -import io.helidon.media.multipart.ReadableBodyPart; -import java.util.Set; -import java.io.UncheckedIOException; - -import java.util.Optional; -import java.util.logging.Logger; - -import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - - -public abstract class PetService implements Service { - - protected static final Logger LOGGER = Logger.getLogger(PetService.class.getName()); - private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); - - protected final Config config; - - public PetService(Config config) { - this.config = config; - } - - /** - * A service registers itself by updating the routing rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules.post("/pet", Handler.create(Pet.class, this::addPet)); - rules.delete("/pet/{petId}", this::deletePet); - rules.get("/pet/findByStatus", this::findPetsByStatus); - rules.get("/pet/findByTags", this::findPetsByTags); - rules.get("/pet/{petId}", this::getPetById); - rules.put("/pet", Handler.create(Pet.class, this::updatePet)); - rules.post("/pet/{petId}", this::updatePetWithForm); - rules.post("/pet/{petId}/uploadImage", this::uploadFile); - rules.post("/fake/{petId}/uploadImageWithRequiredFile", this::uploadFileWithRequiredFile); - } - - - private void processNonFileFormField(String name, Map> nonFileFormContent, ReadableBodyPart part) { - List content = nonFileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); - part.content().as(String.class).thenAccept(content::add); - } - - private void processFileFormField(String name, Map> fileFormContent, ReadableBodyPart part) { - List content = fileFormContent.computeIfAbsent(name, key -> new ArrayList<>()); - part.content().map(DataChunk::bytes) - .collect(ByteArrayOutputStream::new, (stream, bytes) -> { - try { - stream.write(bytes); - } catch (IOException e) { - throw new UncheckedIOException(e); - } - }) - .thenAccept(byteStream -> content.add(new ByteArrayInputStream(byteStream.toByteArray()))); - } - - - /** - * POST /pet : Add a new pet to the store. - * @param request the server request - * @param response the server response - * @param pet Pet object that needs to be added to the store - */ - void addPet(ServerRequest request, ServerResponse response, Pet pet) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(pet); - - handleAddPet(request, response, pet); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /pet : Add a new pet to the store. - * @param request the server request - * @param response the server response - * @param pet Pet object that needs to be added to the store - */ - abstract void handleAddPet(ServerRequest request, ServerResponse response, Pet pet); - - - /** - * DELETE /pet/{petId} : Deletes a pet. - * @param request the server request - * @param response the server response - */ - void deletePet(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null); - ValidatorUtils.checkNonNull(petId); - String apiKey = request.headers().value("api_key").orElse(null); - - handleDeletePet(request, response, petId, apiKey); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle DELETE /pet/{petId} : Deletes a pet. - * @param request the server request - * @param response the server response - * @param petId Pet id to delete - * @param apiKey apiKey - */ - abstract void handleDeletePet(ServerRequest request, ServerResponse response, Long petId, String apiKey); - - - /** - * GET /pet/findByStatus : Finds Pets by status. - * @param request the server request - * @param response the server response - */ - void findPetsByStatus(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - List status = Optional.ofNullable(request.queryParams().toMap().get("status")).orElse(null); - ValidatorUtils.checkNonNull(status); - - handleFindPetsByStatus(request, response, status); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /pet/findByStatus : Finds Pets by status. - * @param request the server request - * @param response the server response - * @param status Status values that need to be considered for filter - */ - abstract void handleFindPetsByStatus(ServerRequest request, ServerResponse response, List status); - - - /** - * GET /pet/findByTags : Finds Pets by tags. - * @param request the server request - * @param response the server response - */ - void findPetsByTags(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - List tags = Optional.ofNullable(request.queryParams().toMap().get("tags")).orElse(null); - ValidatorUtils.checkNonNull(tags); - - handleFindPetsByTags(request, response, tags); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /pet/findByTags : Finds Pets by tags. - * @param request the server request - * @param response the server response - * @param tags Tags to filter by - */ - abstract void handleFindPetsByTags(ServerRequest request, ServerResponse response, List tags); - - - /** - * GET /pet/{petId} : Find pet by ID. - * @param request the server request - * @param response the server response - */ - void getPetById(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null); - ValidatorUtils.checkNonNull(petId); - - handleGetPetById(request, response, petId); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /pet/{petId} : Find pet by ID. - * @param request the server request - * @param response the server response - * @param petId ID of pet to return - */ - abstract void handleGetPetById(ServerRequest request, ServerResponse response, Long petId); - - - /** - * PUT /pet : Update an existing pet. - * @param request the server request - * @param response the server response - * @param pet Pet object that needs to be added to the store - */ - void updatePet(ServerRequest request, ServerResponse response, Pet pet) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(pet); - - handleUpdatePet(request, response, pet); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PUT /pet : Update an existing pet. - * @param request the server request - * @param response the server response - * @param pet Pet object that needs to be added to the store - */ - abstract void handleUpdatePet(ServerRequest request, ServerResponse response, Pet pet); - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data. - * @param request the server request - * @param response the server response - */ - void updatePetWithForm(ServerRequest request, ServerResponse response) { - Map> nonFileFormContent = new HashMap<>(); - Map> fileFormContent = new HashMap<>(); - Single formSingle = request.content().asStream(ReadableBodyPart.class) - .forEach(part -> { - String name = part.name(); - if ("name".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("status".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - part.drain(); - }); - Single.create(formSingle) - .thenAccept(val -> { - Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null); - ValidatorUtils.checkNonNull(petId); - String name = Optional.ofNullable(nonFileFormContent.get("name")).flatMap(list->list.stream().findFirst()).orElse(null); - String status = Optional.ofNullable(nonFileFormContent.get("status")).flatMap(list->list.stream().findFirst()).orElse(null); - - handleUpdatePetWithForm(request, response, petId, name, status); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /pet/{petId} : Updates a pet in the store with form data. - * @param request the server request - * @param response the server response - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - */ - abstract void handleUpdatePetWithForm(ServerRequest request, ServerResponse response, Long petId, String name, String status); - - - /** - * POST /pet/{petId}/uploadImage : uploads an image. - * @param request the server request - * @param response the server response - */ - void uploadFile(ServerRequest request, ServerResponse response) { - Map> nonFileFormContent = new HashMap<>(); - Map> fileFormContent = new HashMap<>(); - Single formSingle = request.content().asStream(ReadableBodyPart.class) - .forEach(part -> { - String name = part.name(); - if ("additionalMetadata".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("file".equals(name)) { - processFileFormField(name, fileFormContent, part); - } - part.drain(); - }); - Single.create(formSingle) - .thenAccept(val -> { - Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null); - ValidatorUtils.checkNonNull(petId); - String additionalMetadata = Optional.ofNullable(nonFileFormContent.get("additionalMetadata")).flatMap(list->list.stream().findFirst()).orElse(null); - InputStream _file = Optional.ofNullable(fileFormContent.get("file")).flatMap(list->list.stream().findFirst()).orElse(null); - - handleUploadFile(request, response, petId, additionalMetadata, _file); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /pet/{petId}/uploadImage : uploads an image. - * @param request the server request - * @param response the server response - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param _file file to upload - */ - abstract void handleUploadFile(ServerRequest request, ServerResponse response, Long petId, String additionalMetadata, InputStream _file); - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required). - * @param request the server request - * @param response the server response - */ - void uploadFileWithRequiredFile(ServerRequest request, ServerResponse response) { - Map> nonFileFormContent = new HashMap<>(); - Map> fileFormContent = new HashMap<>(); - Single formSingle = request.content().asStream(ReadableBodyPart.class) - .forEach(part -> { - String name = part.name(); - if ("additionalMetadata".equals(name)) { - processNonFileFormField(name, nonFileFormContent, part); - } - if ("requiredFile".equals(name)) { - processFileFormField(name, fileFormContent, part); - } - part.drain(); - }); - Single.create(formSingle) - .thenAccept(val -> { - Long petId = Optional.ofNullable(request.path().param("petId")).map(Long::valueOf).orElse(null); - ValidatorUtils.checkNonNull(petId); - InputStream requiredFile = Optional.ofNullable(fileFormContent.get("requiredFile")).flatMap(list->list.stream().findFirst()).orElse(null); - ValidatorUtils.checkNonNull(requiredFile); - String additionalMetadata = Optional.ofNullable(nonFileFormContent.get("additionalMetadata")).flatMap(list->list.stream().findFirst()).orElse(null); - - handleUploadFileWithRequiredFile(request, response, petId, requiredFile, additionalMetadata); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required). - * @param request the server request - * @param response the server response - * @param petId ID of pet to update - * @param requiredFile file to upload - * @param additionalMetadata Additional data to pass to server - */ - abstract void handleUploadFileWithRequiredFile(ServerRequest request, ServerResponse response, Long petId, InputStream requiredFile, String additionalMetadata); - - - abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable); -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/StoreService.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/StoreService.java deleted file mode 100644 index 837c2c20e05..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/StoreService.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.openapitools.server.api; - -import io.helidon.webserver.Handler; -import java.util.Map; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.openapitools.server.model.Order; - -import java.util.Optional; -import java.util.logging.Logger; - -import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - - -public abstract class StoreService implements Service { - - protected static final Logger LOGGER = Logger.getLogger(StoreService.class.getName()); - private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); - - protected final Config config; - - public StoreService(Config config) { - this.config = config; - } - - /** - * A service registers itself by updating the routing rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules.delete("/store/order/{order_id}", this::deleteOrder); - rules.get("/store/inventory", this::getInventory); - rules.get("/store/order/{order_id}", this::getOrderById); - rules.post("/store/order", Handler.create(Order.class, this::placeOrder)); - } - - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID. - * @param request the server request - * @param response the server response - */ - void deleteOrder(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - String orderId = Optional.ofNullable(request.path().param("order_id")).orElse(null); - ValidatorUtils.checkNonNull(orderId); - - handleDeleteOrder(request, response, orderId); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle DELETE /store/order/{order_id} : Delete purchase order by ID. - * @param request the server request - * @param response the server response - * @param orderId ID of the order that needs to be deleted - */ - abstract void handleDeleteOrder(ServerRequest request, ServerResponse response, String orderId); - - - /** - * GET /store/inventory : Returns pet inventories by status. - * @param request the server request - * @param response the server response - */ - void getInventory(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - - handleGetInventory(request, response); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /store/inventory : Returns pet inventories by status. - * @param request the server request - * @param response the server response - */ - abstract void handleGetInventory(ServerRequest request, ServerResponse response); - - - /** - * GET /store/order/{order_id} : Find purchase order by ID. - * @param request the server request - * @param response the server response - */ - void getOrderById(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - Long orderId = Optional.ofNullable(request.path().param("order_id")).map(Long::valueOf).orElse(null); - ValidatorUtils.checkNonNull(orderId); - ValidatorUtils.validateMin(orderId.intValue(), 1); - ValidatorUtils.validateMax(orderId.intValue(), 5); - - handleGetOrderById(request, response, orderId); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /store/order/{order_id} : Find purchase order by ID. - * @param request the server request - * @param response the server response - * @param orderId ID of pet that needs to be fetched - */ - abstract void handleGetOrderById(ServerRequest request, ServerResponse response, Long orderId); - - - /** - * POST /store/order : Place an order for a pet. - * @param request the server request - * @param response the server response - * @param order order placed for purchasing the pet - */ - void placeOrder(ServerRequest request, ServerResponse response, Order order) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(order); - - handlePlaceOrder(request, response, order); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /store/order : Place an order for a pet. - * @param request the server request - * @param response the server response - * @param order order placed for purchasing the pet - */ - abstract void handlePlaceOrder(ServerRequest request, ServerResponse response, Order order); - - - abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable); -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/UserService.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/UserService.java deleted file mode 100644 index 7f1600c5819..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/UserService.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.openapitools.server.api; - -import io.helidon.webserver.Handler; -import java.util.List; -import com.fasterxml.jackson.databind.ObjectMapper; -import java.time.OffsetDateTime; -import org.openapitools.server.model.User; - -import java.util.Optional; -import java.util.logging.Logger; - -import io.helidon.common.GenericType; -import io.helidon.common.reactive.Single; -import io.helidon.config.Config; -import io.helidon.webserver.Routing; -import io.helidon.webserver.ServerRequest; -import io.helidon.webserver.ServerResponse; -import io.helidon.webserver.Service; - - -public abstract class UserService implements Service { - - protected static final Logger LOGGER = Logger.getLogger(UserService.class.getName()); - private static final ObjectMapper MAPPER = JsonProvider.objectMapper(); - - protected final Config config; - - public UserService(Config config) { - this.config = config; - } - - /** - * A service registers itself by updating the routing rules. - * @param rules the routing rules. - */ - @Override - public void update(Routing.Rules rules) { - rules.post("/user", Handler.create(User.class, this::createUser)); - rules.post("/user/createWithArray", this::createUsersWithArrayInput); - rules.post("/user/createWithList", this::createUsersWithListInput); - rules.delete("/user/{username}", this::deleteUser); - rules.get("/user/{username}", this::getUserByName); - rules.get("/user/login", this::loginUser); - rules.get("/user/logout", this::logoutUser); - rules.put("/user/{username}", Handler.create(User.class, this::updateUser)); - } - - - /** - * POST /user : Create user. - * @param request the server request - * @param response the server response - * @param user Created user object - */ - void createUser(ServerRequest request, ServerResponse response, User user) { - Single.create(Single.empty()) - .thenAccept(val -> { - ValidatorUtils.checkNonNull(user); - - handleCreateUser(request, response, user); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /user : Create user. - * @param request the server request - * @param response the server response - * @param user Created user object - */ - abstract void handleCreateUser(ServerRequest request, ServerResponse response, User user); - - - /** - * POST /user/createWithArray : Creates list of users with given input array. - * @param request the server request - * @param response the server response - */ - void createUsersWithArrayInput(ServerRequest request, ServerResponse response) { - Single.create(request.content().as(new GenericType>() { })) - .thenAccept(user -> { - ValidatorUtils.checkNonNull(user); - - handleCreateUsersWithArrayInput(request, response, user); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /user/createWithArray : Creates list of users with given input array. - * @param request the server request - * @param response the server response - * @param user List of user object - */ - abstract void handleCreateUsersWithArrayInput(ServerRequest request, ServerResponse response, List user); - - - /** - * POST /user/createWithList : Creates list of users with given input array. - * @param request the server request - * @param response the server response - */ - void createUsersWithListInput(ServerRequest request, ServerResponse response) { - Single.create(request.content().as(new GenericType>() { })) - .thenAccept(user -> { - ValidatorUtils.checkNonNull(user); - - handleCreateUsersWithListInput(request, response, user); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle POST /user/createWithList : Creates list of users with given input array. - * @param request the server request - * @param response the server response - * @param user List of user object - */ - abstract void handleCreateUsersWithListInput(ServerRequest request, ServerResponse response, List user); - - - /** - * DELETE /user/{username} : Delete user. - * @param request the server request - * @param response the server response - */ - void deleteUser(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - String username = Optional.ofNullable(request.path().param("username")).orElse(null); - ValidatorUtils.checkNonNull(username); - - handleDeleteUser(request, response, username); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle DELETE /user/{username} : Delete user. - * @param request the server request - * @param response the server response - * @param username The name that needs to be deleted - */ - abstract void handleDeleteUser(ServerRequest request, ServerResponse response, String username); - - - /** - * GET /user/{username} : Get user by user name. - * @param request the server request - * @param response the server response - */ - void getUserByName(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - String username = Optional.ofNullable(request.path().param("username")).orElse(null); - ValidatorUtils.checkNonNull(username); - - handleGetUserByName(request, response, username); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /user/{username} : Get user by user name. - * @param request the server request - * @param response the server response - * @param username The name that needs to be fetched. Use user1 for testing. - */ - abstract void handleGetUserByName(ServerRequest request, ServerResponse response, String username); - - - /** - * GET /user/login : Logs user into the system. - * @param request the server request - * @param response the server response - */ - void loginUser(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - String username = request.queryParams().toMap().getOrDefault("username", List.of()).stream().findFirst().orElse(null); - ValidatorUtils.checkNonNull(username); - String password = request.queryParams().toMap().getOrDefault("password", List.of()).stream().findFirst().orElse(null); - ValidatorUtils.checkNonNull(password); - - handleLoginUser(request, response, username, password); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /user/login : Logs user into the system. - * @param request the server request - * @param response the server response - * @param username The user name for login - * @param password The password for login in clear text - */ - abstract void handleLoginUser(ServerRequest request, ServerResponse response, String username, String password); - - - /** - * GET /user/logout : Logs out current logged in user session. - * @param request the server request - * @param response the server response - */ - void logoutUser(ServerRequest request, ServerResponse response) { - Single.create(Single.empty()) - .thenAccept(val -> { - - handleLogoutUser(request, response); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle GET /user/logout : Logs out current logged in user session. - * @param request the server request - * @param response the server response - */ - abstract void handleLogoutUser(ServerRequest request, ServerResponse response); - - - /** - * PUT /user/{username} : Updated user. - * @param request the server request - * @param response the server response - * @param user Updated user object - */ - void updateUser(ServerRequest request, ServerResponse response, User user) { - Single.create(Single.empty()) - .thenAccept(val -> { - String username = Optional.ofNullable(request.path().param("username")).orElse(null); - ValidatorUtils.checkNonNull(username); - ValidatorUtils.checkNonNull(user); - - handleUpdateUser(request, response, username, user); - }) - .exceptionally(throwable -> handleError(request, response, throwable)); - } - /** - * Handle PUT /user/{username} : Updated user. - * @param request the server request - * @param response the server response - * @param username name that need to be deleted - * @param user Updated user object - */ - abstract void handleUpdateUser(ServerRequest request, ServerResponse response, String username, User user); - - - abstract Void handleError(ServerRequest request, ServerResponse response, Throwable throwable); -} diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/ValidatorUtils.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/ValidatorUtils.java deleted file mode 100644 index a7839ab416e..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/api/ValidatorUtils.java +++ /dev/null @@ -1,112 +0,0 @@ -package org.openapitools.server.api; - -import java.lang.reflect.Array; -import java.math.BigDecimal; -import java.util.Collection; -import java.util.Map; -import java.util.Objects; - -import javax.validation.ValidationException; - -/** -* Validation utility methods. -*/ -public final class ValidatorUtils { - - public static boolean validateMin(Integer value, Integer min) { - checkNonNull(value); - if (value < min) { - throw new ValidationException(String.format("%s is less than %s", value, min)); - } - return true; - } - - public static boolean validateMax(Integer value, Integer max) { - checkNonNull(value); - if (value > max) { - throw new ValidationException(String.format("%s is more than %s", value, max)); - } - return true; - } - - public static boolean validateSize(Object value, Integer min, Integer max) { - checkNonNull(value); - Integer size = -1; - if (value instanceof Map) { - size = ((Map) value).size(); - } - if (value instanceof CharSequence) { - size = ((CharSequence) value).length(); - } - if (value instanceof Collection) { - size = ((Collection) value).size(); - } - if (value.getClass().isArray()) { - size = Array.getLength(value); - } - if (size == -1) { - throw new ValidationException("Value has incorrect type"); - } - if (min != null) { - validateMin(size, min); - } - if (max != null) { - validateMax(size, max); - } - return true; - } - - public static boolean validatePattern(String value, String pattern) { - checkNonNull(value, pattern); - if (value.matches(pattern)) { - return true; - } - throw new ValidationException(String.format("'%s' does not match the pattern '%s'", value, pattern)); - } - - public static boolean validateMin(BigDecimal value, String stringMinValue, boolean inclusive) { - checkNonNull(value); - BigDecimal minValue = new BigDecimal(stringMinValue); - int result = value.compareTo(minValue); - if (inclusive) { - if (result >= 0) { - return true; - } - } else { - if (result > 0) { - return true; - } - } - throw new ValidationException( - String.format("%s is not valid value. Min value '%s'. Inclusive - %s.", value, stringMinValue, inclusive) - ); - } - - public static boolean validateMax(BigDecimal value, String stringMaxValue, boolean inclusive) { - checkNonNull(value); - BigDecimal maxValue = new BigDecimal(stringMaxValue); - int result = value.compareTo(maxValue); - if (inclusive) { - if (result <= 0) { - return true; - } - } else { - if (result < 0) { - return true; - } - } - throw new ValidationException( - String.format("%s is not valid value. Max value '%s'. Inclusive - %s.", value, stringMaxValue, inclusive) - ); - } - - public static void checkNonNull(Object... args) { - try { - for (Object o : args) { - Objects.requireNonNull(o); - } - } catch (Exception e) { - throw new ValidationException(e); - } - } -} \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java deleted file mode 100644 index 6ecf060b56c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.server.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - - -public class AdditionalPropertiesClass { - - private Map mapProperty = new HashMap<>(); - private Map> mapOfMapProperty = new HashMap<>(); - - /** - * Default constructor. - */ - public AdditionalPropertiesClass() { - // JSON-B / Jackson - } - - /** - * Create AdditionalPropertiesClass. - * - * @param mapProperty mapProperty - * @param mapOfMapProperty mapOfMapProperty - */ - public AdditionalPropertiesClass( - Map mapProperty, - Map> mapOfMapProperty - ) { - this.mapProperty = mapProperty; - this.mapOfMapProperty = mapOfMapProperty; - } - - - - /** - * Get mapProperty - * @return mapProperty - */ - public Map getMapProperty() { - return mapProperty; - } - - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty - */ - public Map> getMapOfMapProperty() { - return mapOfMapProperty; - } - - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java deleted file mode 100644 index 2c417827320..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/AllOfWithSingleRef.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.server.model; - -import org.openapitools.jackson.nullable.JsonNullable; -import org.openapitools.server.model.SingleRefType; - - - -public class AllOfWithSingleRef { - - private String username; - private SingleRefType singleRefType; - - /** - * Default constructor. - */ - public AllOfWithSingleRef() { - // JSON-B / Jackson - } - - /** - * Create AllOfWithSingleRef. - * - * @param username username - * @param singleRefType singleRefType - */ - public AllOfWithSingleRef( - String username, - SingleRefType singleRefType - ) { - this.username = username; - this.singleRefType = singleRefType; - } - - - - /** - * Get username - * @return username - */ - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - /** - * Get singleRefType - * @return singleRefType - */ - public SingleRefType getSingleRefType() { - return singleRefType; - } - - public void setSingleRefType(SingleRefType singleRefType) { - this.singleRefType = singleRefType; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AllOfWithSingleRef {\n"); - - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Animal.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Animal.java deleted file mode 100644 index 72fd34477f8..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Animal.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Cat; -import org.openapitools.server.model.Dog; - - - -public class Animal { - - private String className; - private String color = "red"; - - /** - * Default constructor. - */ - public Animal() { - // JSON-B / Jackson - } - - /** - * Create Animal. - * - * @param className className - * @param color color - */ - public Animal( - String className, - String color - ) { - this.className = className; - this.color = color; - } - - - - /** - * Get className - * @return className - */ - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - /** - * Get color - * @return color - */ - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 5ba378a4203..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - - - -public class ArrayOfArrayOfNumberOnly { - - private List> arrayArrayNumber = new ArrayList<>(); - - /** - * Default constructor. - */ - public ArrayOfArrayOfNumberOnly() { - // JSON-B / Jackson - } - - /** - * Create ArrayOfArrayOfNumberOnly. - * - * @param arrayArrayNumber arrayArrayNumber - */ - public ArrayOfArrayOfNumberOnly( - List> arrayArrayNumber - ) { - this.arrayArrayNumber = arrayArrayNumber; - } - - - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java deleted file mode 100644 index 05e4cfc0700..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; - - - -public class ArrayOfNumberOnly { - - private List arrayNumber = new ArrayList<>(); - - /** - * Default constructor. - */ - public ArrayOfNumberOnly() { - // JSON-B / Jackson - } - - /** - * Create ArrayOfNumberOnly. - * - * @param arrayNumber arrayNumber - */ - public ArrayOfNumberOnly( - List arrayNumber - ) { - this.arrayNumber = arrayNumber; - } - - - - /** - * Get arrayNumber - * @return arrayNumber - */ - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayTest.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayTest.java deleted file mode 100644 index f7eeaade3fa..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ArrayTest.java +++ /dev/null @@ -1,103 +0,0 @@ -package org.openapitools.server.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.ReadOnlyFirst; - - - -public class ArrayTest { - - private List arrayOfString = new ArrayList<>(); - private List> arrayArrayOfInteger = new ArrayList<>(); - private List> arrayArrayOfModel = new ArrayList<>(); - - /** - * Default constructor. - */ - public ArrayTest() { - // JSON-B / Jackson - } - - /** - * Create ArrayTest. - * - * @param arrayOfString arrayOfString - * @param arrayArrayOfInteger arrayArrayOfInteger - * @param arrayArrayOfModel arrayArrayOfModel - */ - public ArrayTest( - List arrayOfString, - List> arrayArrayOfInteger, - List> arrayArrayOfModel - ) { - this.arrayOfString = arrayOfString; - this.arrayArrayOfInteger = arrayArrayOfInteger; - this.arrayArrayOfModel = arrayArrayOfModel; - } - - - - /** - * Get arrayOfString - * @return arrayOfString - */ - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Capitalization.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Capitalization.java deleted file mode 100644 index ab3f58fcd43..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Capitalization.java +++ /dev/null @@ -1,151 +0,0 @@ -package org.openapitools.server.model; - - - - -public class Capitalization { - - private String smallCamel; - private String capitalCamel; - private String smallSnake; - private String capitalSnake; - private String scAETHFlowPoints; - private String ATT_NAME; - - /** - * Default constructor. - */ - public Capitalization() { - // JSON-B / Jackson - } - - /** - * Create Capitalization. - * - * @param smallCamel smallCamel - * @param capitalCamel capitalCamel - * @param smallSnake smallSnake - * @param capitalSnake capitalSnake - * @param scAETHFlowPoints scAETHFlowPoints - * @param ATT_NAME Name of the pet - */ - public Capitalization( - String smallCamel, - String capitalCamel, - String smallSnake, - String capitalSnake, - String scAETHFlowPoints, - String ATT_NAME - ) { - this.smallCamel = smallCamel; - this.capitalCamel = capitalCamel; - this.smallSnake = smallSnake; - this.capitalSnake = capitalSnake; - this.scAETHFlowPoints = scAETHFlowPoints; - this.ATT_NAME = ATT_NAME; - } - - - - /** - * Get smallCamel - * @return smallCamel - */ - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - /** - * Get smallSnake - * @return smallSnake - */ - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Cat.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Cat.java deleted file mode 100644 index 3a21791cfa8..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Cat.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Animal; -import org.openapitools.server.model.CatAllOf; - - - -public class Cat extends Animal { - - private Boolean declawed; - - /** - * Default constructor. - */ - public Cat() { - // JSON-B / Jackson - } - - /** - * Create Cat. - * - * @param declawed declawed - */ - public Cat( - Boolean declawed - ) { - this.declawed = declawed; - } - - - - /** - * Get declawed - * @return declawed - */ - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Category.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Category.java deleted file mode 100644 index f449dcdbdcc..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Category.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.server.model; - - - - -public class Category { - - private Long id; - private String name = "default-name"; - - /** - * Default constructor. - */ - public Category() { - // JSON-B / Jackson - } - - /** - * Create Category. - * - * @param id id - * @param name name - */ - public Category( - Long id, - String name - ) { - this.id = id; - this.name = name; - } - - - - /** - * Get id - * @return id - */ - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - /** - * Get name - * @return name - */ - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ClassModel.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ClassModel.java deleted file mode 100644 index ba7528f6ddb..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ClassModel.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.openapitools.server.model; - - - -/** - * Model for testing model with \"_class\" property - */ -public class ClassModel { - - private String propertyClass; - - /** - * Default constructor. - */ - public ClassModel() { - // JSON-B / Jackson - } - - /** - * Create ClassModel. - * - * @param propertyClass propertyClass - */ - public ClassModel( - String propertyClass - ) { - this.propertyClass = propertyClass; - } - - - - /** - * Get propertyClass - * @return propertyClass - */ - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Client.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Client.java deleted file mode 100644 index 76c4d19ab60..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Client.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapitools.server.model; - - - - -public class Client { - - private String client; - - /** - * Default constructor. - */ - public Client() { - // JSON-B / Jackson - } - - /** - * Create Client. - * - * @param client client - */ - public Client( - String client - ) { - this.client = client; - } - - - - /** - * Get client - * @return client - */ - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/DeprecatedObject.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/DeprecatedObject.java deleted file mode 100644 index 7add1761a84..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/DeprecatedObject.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapitools.server.model; - - - - -public class DeprecatedObject { - - private String name; - - /** - * Default constructor. - */ - public DeprecatedObject() { - // JSON-B / Jackson - } - - /** - * Create DeprecatedObject. - * - * @param name name - */ - public DeprecatedObject( - String name - ) { - this.name = name; - } - - - - /** - * Get name - * @return name - */ - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeprecatedObject {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Dog.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Dog.java deleted file mode 100644 index ce1ba19b0f9..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Dog.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Animal; -import org.openapitools.server.model.DogAllOf; - - - -public class Dog extends Animal { - - private String breed; - - /** - * Default constructor. - */ - public Dog() { - // JSON-B / Jackson - } - - /** - * Create Dog. - * - * @param breed breed - */ - public Dog( - String breed - ) { - this.breed = breed; - } - - - - /** - * Get breed - * @return breed - */ - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumArrays.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumArrays.java deleted file mode 100644 index d7f30e7d963..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumArrays.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; - - - -public class EnumArrays { - - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static JustSymbolEnum fromValue(String text) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static ArrayEnumEnum fromValue(String text) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private List arrayEnum = new ArrayList<>(); - - /** - * Default constructor. - */ - public EnumArrays() { - // JSON-B / Jackson - } - - /** - * Create EnumArrays. - * - * @param justSymbol justSymbol - * @param arrayEnum arrayEnum - */ - public EnumArrays( - JustSymbolEnum justSymbol, - List arrayEnum - ) { - this.justSymbol = justSymbol; - this.arrayEnum = arrayEnum; - } - - - - /** - * Get justSymbol - * @return justSymbol - */ - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumClass.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumClass.java deleted file mode 100644 index d3f6c24ce36..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumClass.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.server.model; - - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -public enum EnumClass { - - _ABC("_abc"), - _EFG("-efg"), - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String text) { - for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumTest.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumTest.java deleted file mode 100644 index 54b36a98ed9..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/EnumTest.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import org.openapitools.server.model.OuterEnum; -import org.openapitools.server.model.OuterEnumDefaultValue; -import org.openapitools.server.model.OuterEnumInteger; -import org.openapitools.server.model.OuterEnumIntegerDefaultValue; - - - -public class EnumTest { - - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - LOWER("lower"), - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static EnumStringEnum fromValue(String text) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - LOWER("lower"), - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static EnumIntegerEnum fromValue(String text) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static EnumNumberEnum fromValue(String text) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private EnumNumberEnum enumNumber; - private OuterEnum outerEnum; - private OuterEnumInteger outerEnumInteger; - private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; - private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; - - /** - * Default constructor. - */ - public EnumTest() { - // JSON-B / Jackson - } - - /** - * Create EnumTest. - * - * @param enumString enumString - * @param enumStringRequired enumStringRequired - * @param enumInteger enumInteger - * @param enumNumber enumNumber - * @param outerEnum outerEnum - * @param outerEnumInteger outerEnumInteger - * @param outerEnumDefaultValue outerEnumDefaultValue - * @param outerEnumIntegerDefaultValue outerEnumIntegerDefaultValue - */ - public EnumTest( - EnumStringEnum enumString, - EnumStringRequiredEnum enumStringRequired, - EnumIntegerEnum enumInteger, - EnumNumberEnum enumNumber, - OuterEnum outerEnum, - OuterEnumInteger outerEnumInteger, - OuterEnumDefaultValue outerEnumDefaultValue, - OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue - ) { - this.enumString = enumString; - this.enumStringRequired = enumStringRequired; - this.enumInteger = enumInteger; - this.enumNumber = enumNumber; - this.outerEnum = outerEnum; - this.outerEnumInteger = outerEnumInteger; - this.outerEnumDefaultValue = outerEnumDefaultValue; - this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; - } - - - - /** - * Get enumString - * @return enumString - */ - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - /** - * Get enumInteger - * @return enumInteger - */ - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - /** - * Get enumNumber - * @return enumNumber - */ - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - /** - * Get outerEnum - * @return outerEnum - */ - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - /** - * Get outerEnumInteger - * @return outerEnumInteger - */ - public OuterEnumInteger getOuterEnumInteger() { - return outerEnumInteger; - } - - public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { - this.outerEnumInteger = outerEnumInteger; - } - - /** - * Get outerEnumDefaultValue - * @return outerEnumDefaultValue - */ - public OuterEnumDefaultValue getOuterEnumDefaultValue() { - return outerEnumDefaultValue; - } - - public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { - this.outerEnumDefaultValue = outerEnumDefaultValue; - } - - /** - * Get outerEnumIntegerDefaultValue - * @return outerEnumIntegerDefaultValue - */ - public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { - return outerEnumIntegerDefaultValue; - } - - public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { - this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); - sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); - sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java deleted file mode 100644 index 1730307fb6d..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FileSchemaTestClass.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.server.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.ModelFile; - - - -public class FileSchemaTestClass { - - private ModelFile _file; - private List files = new ArrayList<>(); - - /** - * Default constructor. - */ - public FileSchemaTestClass() { - // JSON-B / Jackson - } - - /** - * Create FileSchemaTestClass. - * - * @param _file _file - * @param files files - */ - public FileSchemaTestClass( - ModelFile _file, - List files - ) { - this._file = _file; - this.files = files; - } - - - - /** - * Get _file - * @return _file - */ - public ModelFile getFile() { - return _file; - } - - public void setFile(ModelFile _file) { - this._file = _file; - } - - /** - * Get files - * @return files - */ - public List getFiles() { - return files; - } - - public void setFiles(List files) { - this.files = files; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - - sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Foo.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Foo.java deleted file mode 100644 index 6b3869f6f4c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Foo.java +++ /dev/null @@ -1,66 +0,0 @@ -package org.openapitools.server.model; - - - - -public class Foo { - - private String bar = "bar"; - - /** - * Default constructor. - */ - public Foo() { - // JSON-B / Jackson - } - - /** - * Create Foo. - * - * @param bar bar - */ - public Foo( - String bar - ) { - this.bar = bar; - } - - - - /** - * Get bar - * @return bar - */ - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Foo {\n"); - - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java deleted file mode 100644 index f4716bdfcd1..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FooGetDefaultResponse.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.server.model.Foo; - - - -public class FooGetDefaultResponse { - - private Foo string; - - /** - * Default constructor. - */ - public FooGetDefaultResponse() { - // JSON-B / Jackson - } - - /** - * Create FooGetDefaultResponse. - * - * @param string string - */ - public FooGetDefaultResponse( - Foo string - ) { - this.string = string; - } - - - - /** - * Get string - * @return string - */ - public Foo getString() { - return string; - } - - public void setString(Foo string) { - this.string = string; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FooGetDefaultResponse {\n"); - - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FormatTest.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FormatTest.java deleted file mode 100644 index df656b5b83c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/FormatTest.java +++ /dev/null @@ -1,337 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.io.File; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.UUID; - - - -public class FormatTest { - - private Integer integer; - private Integer int32; - private Long int64; - private BigDecimal number; - private Float _float; - private Double _double; - private BigDecimal decimal; - private String string; - private byte[] _byte; - private File binary; - private LocalDate date; - private OffsetDateTime dateTime; - private UUID uuid; - private String password; - private String patternWithDigits; - private String patternWithDigitsAndDelimiter; - - /** - * Default constructor. - */ - public FormatTest() { - // JSON-B / Jackson - } - - /** - * Create FormatTest. - * - * @param integer integer - * @param int32 int32 - * @param int64 int64 - * @param number number - * @param _float _float - * @param _double _double - * @param decimal decimal - * @param string string - * @param _byte _byte - * @param binary binary - * @param date date - * @param dateTime dateTime - * @param uuid uuid - * @param password password - * @param patternWithDigits A string that is a 10 digit number. Can have leading zeros. - * @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - */ - public FormatTest( - Integer integer, - Integer int32, - Long int64, - BigDecimal number, - Float _float, - Double _double, - BigDecimal decimal, - String string, - byte[] _byte, - File binary, - LocalDate date, - OffsetDateTime dateTime, - UUID uuid, - String password, - String patternWithDigits, - String patternWithDigitsAndDelimiter - ) { - this.integer = integer; - this.int32 = int32; - this.int64 = int64; - this.number = number; - this._float = _float; - this._double = _double; - this.decimal = decimal; - this.string = string; - this._byte = _byte; - this.binary = binary; - this.date = date; - this.dateTime = dateTime; - this.uuid = uuid; - this.password = password; - this.patternWithDigits = patternWithDigits; - this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; - } - - - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - /** - * Get int64 - * @return int64 - */ - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - /** - * Get decimal - * @return decimal - */ - public BigDecimal getDecimal() { - return decimal; - } - - public void setDecimal(BigDecimal decimal) { - this.decimal = decimal; - } - - /** - * Get string - * @return string - */ - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - /** - * Get _byte - * @return _byte - */ - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - /** - * Get binary - * @return binary - */ - public File getBinary() { - return binary; - } - - public void setBinary(File binary) { - this.binary = binary; - } - - /** - * Get date - * @return date - */ - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - /** - * Get dateTime - * @return dateTime - */ - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - /** - * Get uuid - * @return uuid - */ - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - /** - * Get password - * @return password - */ - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - /** - * A string that is a 10 digit number. Can have leading zeros. - * @return patternWithDigits - */ - public String getPatternWithDigits() { - return patternWithDigits; - } - - public void setPatternWithDigits(String patternWithDigits) { - this.patternWithDigits = patternWithDigits; - } - - /** - * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - * @return patternWithDigitsAndDelimiter - */ - public String getPatternWithDigitsAndDelimiter() { - return patternWithDigitsAndDelimiter; - } - - public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { - this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); - sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java deleted file mode 100644 index b5228bf6e66..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -public class HasOnlyReadOnly { - - private String bar; - private String foo; - - /** - * Default constructor. - */ - public HasOnlyReadOnly() { - // JSON-B / Jackson - } - - /** - * Create HasOnlyReadOnly. - * - * @param bar bar - * @param foo foo - */ - public HasOnlyReadOnly( - String bar, - String foo - ) { - this.bar = bar; - this.foo = foo; - } - - - - /** - * Get bar - * @return bar - */ - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - /** - * Get foo - * @return foo - */ - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/HealthCheckResult.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/HealthCheckResult.java deleted file mode 100644 index 97e9dba137a..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/HealthCheckResult.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.server.model; - -import org.openapitools.jackson.nullable.JsonNullable; - - -/** - * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. - */ -public class HealthCheckResult { - - private String nullableMessage; - - /** - * Default constructor. - */ - public HealthCheckResult() { - // JSON-B / Jackson - } - - /** - * Create HealthCheckResult. - * - * @param nullableMessage nullableMessage - */ - public HealthCheckResult( - String nullableMessage - ) { - this.nullableMessage = nullableMessage; - } - - - - /** - * Get nullableMessage - * @return nullableMessage - */ - public String getNullableMessage() { - return nullableMessage; - } - - public void setNullableMessage(String nullableMessage) { - this.nullableMessage = nullableMessage; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HealthCheckResult {\n"); - - sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/MapTest.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/MapTest.java deleted file mode 100644 index e3e64479d97..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/MapTest.java +++ /dev/null @@ -1,159 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - - -public class MapTest { - - private Map> mapMapOfString = new HashMap<>(); - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static InnerEnum fromValue(String text) { - for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private Map mapOfEnumString = new HashMap<>(); - private Map directMap = new HashMap<>(); - private Map indirectMap = new HashMap<>(); - - /** - * Default constructor. - */ - public MapTest() { - // JSON-B / Jackson - } - - /** - * Create MapTest. - * - * @param mapMapOfString mapMapOfString - * @param mapOfEnumString mapOfEnumString - * @param directMap directMap - * @param indirectMap indirectMap - */ - public MapTest( - Map> mapMapOfString, - Map mapOfEnumString, - Map directMap, - Map indirectMap - ) { - this.mapMapOfString = mapMapOfString; - this.mapOfEnumString = mapOfEnumString; - this.directMap = directMap; - this.indirectMap = indirectMap; - } - - - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - /** - * Get directMap - * @return directMap - */ - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - /** - * Get indirectMap - * @return indirectMap - */ - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index b41d9fcecb9..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.openapitools.server.model; - -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.server.model.Animal; - - - -public class MixedPropertiesAndAdditionalPropertiesClass { - - private UUID uuid; - private OffsetDateTime dateTime; - private Map map = new HashMap<>(); - - /** - * Default constructor. - */ - public MixedPropertiesAndAdditionalPropertiesClass() { - // JSON-B / Jackson - } - - /** - * Create MixedPropertiesAndAdditionalPropertiesClass. - * - * @param uuid uuid - * @param dateTime dateTime - * @param map map - */ - public MixedPropertiesAndAdditionalPropertiesClass( - UUID uuid, - OffsetDateTime dateTime, - Map map - ) { - this.uuid = uuid; - this.dateTime = dateTime; - this.map = map; - } - - - - /** - * Get uuid - * @return uuid - */ - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - /** - * Get dateTime - * @return dateTime - */ - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - /** - * Get map - * @return map - */ - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Model200Response.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Model200Response.java deleted file mode 100644 index dc685bdf99b..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Model200Response.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; - - -/** - * Model for testing model name starting with number - */ -public class Model200Response { - - private Integer name; - private String propertyClass; - - /** - * Default constructor. - */ - public Model200Response() { - // JSON-B / Jackson - } - - /** - * Create Model200Response. - * - * @param name name - * @param propertyClass propertyClass - */ - public Model200Response( - Integer name, - String propertyClass - ) { - this.name = name; - this.propertyClass = propertyClass; - } - - - - /** - * Get name - * @return name - */ - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - /** - * Get propertyClass - * @return propertyClass - */ - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelApiResponse.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelApiResponse.java deleted file mode 100644 index 10d22866ed5..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelApiResponse.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -public class ModelApiResponse { - - private Integer code; - private String type; - private String message; - - /** - * Default constructor. - */ - public ModelApiResponse() { - // JSON-B / Jackson - } - - /** - * Create ModelApiResponse. - * - * @param code code - * @param type type - * @param message message - */ - public ModelApiResponse( - Integer code, - String type, - String message - ) { - this.code = code; - this.type = type; - this.message = message; - } - - - - /** - * Get code - * @return code - */ - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - /** - * Get type - * @return type - */ - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - /** - * Get message - * @return message - */ - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelFile.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelFile.java deleted file mode 100644 index 0721c23130d..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelFile.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; - - -/** - * Must be named `File` for test. - */ -public class ModelFile { - - private String sourceURI; - - /** - * Default constructor. - */ - public ModelFile() { - // JSON-B / Jackson - } - - /** - * Create ModelFile. - * - * @param sourceURI Test capitalization - */ - public ModelFile( - String sourceURI - ) { - this.sourceURI = sourceURI; - } - - - - /** - * Test capitalization - * @return sourceURI - */ - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelList.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelList.java deleted file mode 100644 index 6bba122e69e..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelList.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -public class ModelList { - - private String _123list; - - /** - * Default constructor. - */ - public ModelList() { - // JSON-B / Jackson - } - - /** - * Create ModelList. - * - * @param _123list _123list - */ - public ModelList( - String _123list - ) { - this._123list = _123list; - } - - - - /** - * Get _123list - * @return _123list - */ - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelReturn.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelReturn.java deleted file mode 100644 index 0b9538b4aaf..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ModelReturn.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; - - -/** - * Model for testing reserved words - */ -public class ModelReturn { - - private Integer _return; - - /** - * Default constructor. - */ - public ModelReturn() { - // JSON-B / Jackson - } - - /** - * Create ModelReturn. - * - * @param _return _return - */ - public ModelReturn( - Integer _return - ) { - this._return = _return; - } - - - - /** - * Get _return - * @return _return - */ - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Name.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Name.java deleted file mode 100644 index a081e1d5c13..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Name.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.server.model; - - - -/** - * Model for testing model name same as property name - */ -public class Name { - - private Integer name; - private Integer snakeCase; - private String property; - private Integer _123number; - - /** - * Default constructor. - */ - public Name() { - // JSON-B / Jackson - } - - /** - * Create Name. - * - * @param name name - * @param snakeCase snakeCase - * @param property property - * @param _123number _123number - */ - public Name( - Integer name, - Integer snakeCase, - String property, - Integer _123number - ) { - this.name = name; - this.snakeCase = snakeCase; - this.property = property; - this._123number = _123number; - } - - - - /** - * Get name - * @return name - */ - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - /** - * Get snakeCase - * @return snakeCase - */ - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - /** - * Get property - * @return property - */ - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - /** - * Get _123number - * @return _123number - */ - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/NullableClass.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/NullableClass.java deleted file mode 100644 index 2e2c2659cd4..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/NullableClass.java +++ /dev/null @@ -1,261 +0,0 @@ -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; - - - -public class NullableClass extends HashMap { - - private Integer integerProp; - private BigDecimal numberProp; - private Boolean booleanProp; - private String stringProp; - private LocalDate dateProp; - private OffsetDateTime datetimeProp; - private List arrayNullableProp = new ArrayList<>(); - private List arrayAndItemsNullableProp = new ArrayList<>(); - private List arrayItemsNullable = new ArrayList<>(); - private Map objectNullableProp = new HashMap<>(); - private Map objectAndItemsNullableProp = new HashMap<>(); - private Map objectItemsNullable = new HashMap<>(); - - /** - * Default constructor. - */ - public NullableClass() { - // JSON-B / Jackson - } - - /** - * Create NullableClass. - * - * @param integerProp integerProp - * @param numberProp numberProp - * @param booleanProp booleanProp - * @param stringProp stringProp - * @param dateProp dateProp - * @param datetimeProp datetimeProp - * @param arrayNullableProp arrayNullableProp - * @param arrayAndItemsNullableProp arrayAndItemsNullableProp - * @param arrayItemsNullable arrayItemsNullable - * @param objectNullableProp objectNullableProp - * @param objectAndItemsNullableProp objectAndItemsNullableProp - * @param objectItemsNullable objectItemsNullable - */ - public NullableClass( - Integer integerProp, - BigDecimal numberProp, - Boolean booleanProp, - String stringProp, - LocalDate dateProp, - OffsetDateTime datetimeProp, - List arrayNullableProp, - List arrayAndItemsNullableProp, - List arrayItemsNullable, - Map objectNullableProp, - Map objectAndItemsNullableProp, - Map objectItemsNullable - ) { - this.integerProp = integerProp; - this.numberProp = numberProp; - this.booleanProp = booleanProp; - this.stringProp = stringProp; - this.dateProp = dateProp; - this.datetimeProp = datetimeProp; - this.arrayNullableProp = arrayNullableProp; - this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; - this.arrayItemsNullable = arrayItemsNullable; - this.objectNullableProp = objectNullableProp; - this.objectAndItemsNullableProp = objectAndItemsNullableProp; - this.objectItemsNullable = objectItemsNullable; - } - - - - /** - * Get integerProp - * @return integerProp - */ - public Integer getIntegerProp() { - return integerProp; - } - - public void setIntegerProp(Integer integerProp) { - this.integerProp = integerProp; - } - - /** - * Get numberProp - * @return numberProp - */ - public BigDecimal getNumberProp() { - return numberProp; - } - - public void setNumberProp(BigDecimal numberProp) { - this.numberProp = numberProp; - } - - /** - * Get booleanProp - * @return booleanProp - */ - public Boolean getBooleanProp() { - return booleanProp; - } - - public void setBooleanProp(Boolean booleanProp) { - this.booleanProp = booleanProp; - } - - /** - * Get stringProp - * @return stringProp - */ - public String getStringProp() { - return stringProp; - } - - public void setStringProp(String stringProp) { - this.stringProp = stringProp; - } - - /** - * Get dateProp - * @return dateProp - */ - public LocalDate getDateProp() { - return dateProp; - } - - public void setDateProp(LocalDate dateProp) { - this.dateProp = dateProp; - } - - /** - * Get datetimeProp - * @return datetimeProp - */ - public OffsetDateTime getDatetimeProp() { - return datetimeProp; - } - - public void setDatetimeProp(OffsetDateTime datetimeProp) { - this.datetimeProp = datetimeProp; - } - - /** - * Get arrayNullableProp - * @return arrayNullableProp - */ - public List getArrayNullableProp() { - return arrayNullableProp; - } - - public void setArrayNullableProp(List arrayNullableProp) { - this.arrayNullableProp = arrayNullableProp; - } - - /** - * Get arrayAndItemsNullableProp - * @return arrayAndItemsNullableProp - */ - public List getArrayAndItemsNullableProp() { - return arrayAndItemsNullableProp; - } - - public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { - this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; - } - - /** - * Get arrayItemsNullable - * @return arrayItemsNullable - */ - public List getArrayItemsNullable() { - return arrayItemsNullable; - } - - public void setArrayItemsNullable(List arrayItemsNullable) { - this.arrayItemsNullable = arrayItemsNullable; - } - - /** - * Get objectNullableProp - * @return objectNullableProp - */ - public Map getObjectNullableProp() { - return objectNullableProp; - } - - public void setObjectNullableProp(Map objectNullableProp) { - this.objectNullableProp = objectNullableProp; - } - - /** - * Get objectAndItemsNullableProp - * @return objectAndItemsNullableProp - */ - public Map getObjectAndItemsNullableProp() { - return objectAndItemsNullableProp; - } - - public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { - this.objectAndItemsNullableProp = objectAndItemsNullableProp; - } - - /** - * Get objectItemsNullable - * @return objectItemsNullable - */ - public Map getObjectItemsNullable() { - return objectItemsNullable; - } - - public void setObjectItemsNullable(Map objectItemsNullable) { - this.objectItemsNullable = objectItemsNullable; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NullableClass {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); - sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); - sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); - sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); - sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); - sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); - sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); - sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); - sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); - sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); - sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); - sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/NumberOnly.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/NumberOnly.java deleted file mode 100644 index 3a003f97091..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/NumberOnly.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.openapitools.server.model; - -import java.math.BigDecimal; - - - -public class NumberOnly { - - private BigDecimal justNumber; - - /** - * Default constructor. - */ - public NumberOnly() { - // JSON-B / Jackson - } - - /** - * Create NumberOnly. - * - * @param justNumber justNumber - */ - public NumberOnly( - BigDecimal justNumber - ) { - this.justNumber = justNumber; - } - - - - /** - * Get justNumber - * @return justNumber - */ - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java deleted file mode 100644 index 57ee9e374e2..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ObjectWithDeprecatedFields.java +++ /dev/null @@ -1,121 +0,0 @@ -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.DeprecatedObject; - - - -public class ObjectWithDeprecatedFields { - - private String uuid; - private BigDecimal id; - private DeprecatedObject deprecatedRef; - private List bars = new ArrayList<>(); - - /** - * Default constructor. - */ - public ObjectWithDeprecatedFields() { - // JSON-B / Jackson - } - - /** - * Create ObjectWithDeprecatedFields. - * - * @param uuid uuid - * @param id id - * @param deprecatedRef deprecatedRef - * @param bars bars - */ - public ObjectWithDeprecatedFields( - String uuid, - BigDecimal id, - DeprecatedObject deprecatedRef, - List bars - ) { - this.uuid = uuid; - this.id = id; - this.deprecatedRef = deprecatedRef; - this.bars = bars; - } - - - - /** - * Get uuid - * @return uuid - */ - public String getUuid() { - return uuid; - } - - public void setUuid(String uuid) { - this.uuid = uuid; - } - - /** - * Get id - * @return id - */ - public BigDecimal getId() { - return id; - } - - public void setId(BigDecimal id) { - this.id = id; - } - - /** - * Get deprecatedRef - * @return deprecatedRef - */ - public DeprecatedObject getDeprecatedRef() { - return deprecatedRef; - } - - public void setDeprecatedRef(DeprecatedObject deprecatedRef) { - this.deprecatedRef = deprecatedRef; - } - - /** - * Get bars - * @return bars - */ - public List getBars() { - return bars; - } - - public void setBars(List bars) { - this.bars = bars; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ObjectWithDeprecatedFields {\n"); - - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); - sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Order.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Order.java deleted file mode 100644 index 39a04dc1511..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Order.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; - - - -public class Order { - - private Long id; - private Long petId; - private Integer quantity; - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private StatusEnum status; - private Boolean complete = false; - - /** - * Default constructor. - */ - public Order() { - // JSON-B / Jackson - } - - /** - * Create Order. - * - * @param id id - * @param petId petId - * @param quantity quantity - * @param shipDate shipDate - * @param status Order Status - * @param complete complete - */ - public Order( - Long id, - Long petId, - Integer quantity, - OffsetDateTime shipDate, - StatusEnum status, - Boolean complete - ) { - this.id = id; - this.petId = petId; - this.quantity = quantity; - this.shipDate = shipDate; - this.status = status; - this.complete = complete; - } - - - - /** - * Get id - * @return id - */ - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - /** - * Get petId - * @return petId - */ - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - /** - * Get quantity - * @return quantity - */ - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - /** - * Get shipDate - * @return shipDate - */ - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - /** - * Order Status - * @return status - */ - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - * Get complete - * @return complete - */ - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterComposite.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterComposite.java deleted file mode 100644 index 92eb34508d3..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterComposite.java +++ /dev/null @@ -1,101 +0,0 @@ -package org.openapitools.server.model; - -import java.math.BigDecimal; - - - -public class OuterComposite { - - private BigDecimal myNumber; - private String myString; - private Boolean myBoolean; - - /** - * Default constructor. - */ - public OuterComposite() { - // JSON-B / Jackson - } - - /** - * Create OuterComposite. - * - * @param myNumber myNumber - * @param myString myString - * @param myBoolean myBoolean - */ - public OuterComposite( - BigDecimal myNumber, - String myString, - Boolean myBoolean - ) { - this.myNumber = myNumber; - this.myString = myString; - this.myBoolean = myBoolean; - } - - - - /** - * Get myNumber - * @return myNumber - */ - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - /** - * Get myString - * @return myString - */ - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - /** - * Get myBoolean - * @return myBoolean - */ - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnum.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnum.java deleted file mode 100644 index 3cdb4cdeb79..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnum.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.server.model; - - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -public enum OuterEnum { - - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String text) { - for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java deleted file mode 100644 index c8110bd330a..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumDefaultValue.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.server.model; - - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnumDefaultValue - */ - -public enum OuterEnumDefaultValue { - - PLACED("placed"), - APPROVED("approved"), - DELIVERED("delivered"); - - private String value; - - OuterEnumDefaultValue(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnumDefaultValue fromValue(String text) { - for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumInteger.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumInteger.java deleted file mode 100644 index b6d2661725f..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumInteger.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.server.model; - - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnumInteger - */ - -public enum OuterEnumInteger { - - NUMBER_0(0), - NUMBER_1(1), - NUMBER_2(2); - - private Integer value; - - OuterEnumInteger(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnumInteger fromValue(String text) { - for (OuterEnumInteger b : OuterEnumInteger.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java deleted file mode 100644 index af1fe21752a..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterEnumIntegerDefaultValue.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.server.model; - - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnumIntegerDefaultValue - */ - -public enum OuterEnumIntegerDefaultValue { - - NUMBER_0(0), - NUMBER_1(1), - NUMBER_2(2); - - private Integer value; - - OuterEnumIntegerDefaultValue(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnumIntegerDefaultValue fromValue(String text) { - for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java deleted file mode 100644 index 7a75e0e3b60..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/OuterObjectWithEnumProperty.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.openapitools.server.model; - -import org.openapitools.server.model.OuterEnumInteger; - - - -public class OuterObjectWithEnumProperty { - - private OuterEnumInteger value; - - /** - * Default constructor. - */ - public OuterObjectWithEnumProperty() { - // JSON-B / Jackson - } - - /** - * Create OuterObjectWithEnumProperty. - * - * @param value value - */ - public OuterObjectWithEnumProperty( - OuterEnumInteger value - ) { - this.value = value; - } - - - - /** - * Get value - * @return value - */ - public OuterEnumInteger getValue() { - return value; - } - - public void setValue(OuterEnumInteger value) { - this.value = value; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterObjectWithEnumProperty {\n"); - - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Pet.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Pet.java deleted file mode 100644 index a040a9d288b..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Pet.java +++ /dev/null @@ -1,198 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.server.model.Category; -import org.openapitools.server.model.Tag; - - - -public class Pet { - - private Long id; - private Category category; - private String name; - private Set photoUrls = new LinkedHashSet<>(); - private List tags = new ArrayList<>(); - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - PENDING("pending"), - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } - } - - - private StatusEnum status; - - /** - * Default constructor. - */ - public Pet() { - // JSON-B / Jackson - } - - /** - * Create Pet. - * - * @param id id - * @param category category - * @param name name - * @param photoUrls photoUrls - * @param tags tags - * @param status pet status in the store - */ - public Pet( - Long id, - Category category, - String name, - Set photoUrls, - List tags, - StatusEnum status - ) { - this.id = id; - this.category = category; - this.name = name; - this.photoUrls = photoUrls; - this.tags = tags; - this.status = status; - } - - - - /** - * Get id - * @return id - */ - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - /** - * Get category - * @return category - */ - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - /** - * Get name - * @return name - */ - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Get photoUrls - * @return photoUrls - */ - public Set getPhotoUrls() { - return photoUrls; - } - - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - /** - * Get tags - * @return tags - */ - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - /** - * pet status in the store - * @return status - */ - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java deleted file mode 100644 index e62e2270eea..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/ReadOnlyFirst.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.server.model; - - - - -public class ReadOnlyFirst { - - private String bar; - private String baz; - - /** - * Default constructor. - */ - public ReadOnlyFirst() { - // JSON-B / Jackson - } - - /** - * Create ReadOnlyFirst. - * - * @param bar bar - * @param baz baz - */ - public ReadOnlyFirst( - String bar, - String baz - ) { - this.bar = bar; - this.baz = baz; - } - - - - /** - * Get bar - * @return bar - */ - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - /** - * Get baz - * @return baz - */ - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/SingleRefType.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/SingleRefType.java deleted file mode 100644 index 6689e8a2b60..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/SingleRefType.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.openapitools.server.model; - - - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets SingleRefType - */ - -public enum SingleRefType { - - ADMIN("admin"), - USER("user"); - - private String value; - - SingleRefType(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SingleRefType fromValue(String text) { - for (SingleRefType b : SingleRefType.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + text + "'"); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/SpecialModelName.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/SpecialModelName.java deleted file mode 100644 index 2ab0a370197..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/SpecialModelName.java +++ /dev/null @@ -1,67 +0,0 @@ -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -public class SpecialModelName { - - private Long $specialPropertyName; - - /** - * Default constructor. - */ - public SpecialModelName() { - // JSON-B / Jackson - } - - /** - * Create SpecialModelName. - * - * @param $specialPropertyName $specialPropertyName - */ - public SpecialModelName( - Long $specialPropertyName - ) { - this.$specialPropertyName = $specialPropertyName; - } - - - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Tag.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Tag.java deleted file mode 100644 index 494d8fcf928..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/Tag.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.server.model; - - - - -public class Tag { - - private Long id; - private String name; - - /** - * Default constructor. - */ - public Tag() { - // JSON-B / Jackson - } - - /** - * Create Tag. - * - * @param id id - * @param name name - */ - public Tag( - Long id, - String name - ) { - this.id = id; - this.name = name; - } - - - - /** - * Get id - * @return id - */ - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - /** - * Get name - * @return name - */ - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/User.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/User.java deleted file mode 100644 index 8110b662252..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/model/User.java +++ /dev/null @@ -1,185 +0,0 @@ -package org.openapitools.server.model; - - - - -public class User { - - private Long id; - private String username; - private String firstName; - private String lastName; - private String email; - private String password; - private String phone; - private Integer userStatus; - - /** - * Default constructor. - */ - public User() { - // JSON-B / Jackson - } - - /** - * Create User. - * - * @param id id - * @param username username - * @param firstName firstName - * @param lastName lastName - * @param email email - * @param password password - * @param phone phone - * @param userStatus User Status - */ - public User( - Long id, - String username, - String firstName, - String lastName, - String email, - String password, - String phone, - Integer userStatus - ) { - this.id = id; - this.username = username; - this.firstName = firstName; - this.lastName = lastName; - this.email = email; - this.password = password; - this.phone = phone; - this.userStatus = userStatus; - } - - - - /** - * Get id - * @return id - */ - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - /** - * Get username - * @return username - */ - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - /** - * Get firstName - * @return firstName - */ - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - * Get lastName - * @return lastName - */ - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - * Get email - * @return email - */ - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - /** - * Get password - * @return password - */ - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - /** - * Get phone - * @return phone - */ - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * User Status - * @return userStatus - */ - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - /** - * Create a string representation of this pojo. - **/ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private static String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/package-info.java b/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/package-info.java deleted file mode 100644 index 1025e91aed8..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/java/org/openapitools/server/package-info.java +++ /dev/null @@ -1 +0,0 @@ -package org.openapitools.server; \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/src/main/resources/META-INF/openapi.yml b/samples/server/petstore/helidon/se-default/src/main/resources/META-INF/openapi.yml deleted file mode 100644 index f1d51d1444b..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/resources/META-INF/openapi.yml +++ /dev/null @@ -1,2151 +0,0 @@ -openapi: 3.0.0 -info: - description: "This spec is mainly for testing Petstore server and contains fake\ - \ endpoints, models. Please do not use this for any other purpose. Special characters:\ - \ \" \\" - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- description: petstore server - url: "http://{server}.swagger.io:{port}/v2" - variables: - server: - default: petstore - enum: - - petstore - - qa-petstore - - dev-petstore - port: - default: "80" - enum: - - "80" - - "8080" -- description: The local server - url: "https://localhost:8080/{version}" - variables: - version: - default: v2 - enum: - - v1 - - v2 -- description: The local server without variables - url: https://127.0.0.1/no_varaible -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /foo: - get: - responses: - default: - content: - application/json: - schema: - $ref: '#/components/schemas/_foo_get_default_response' - description: response - x-accepts: application/json - /pet: - post: - description: "" - operationId: addPet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: Successful operation - "405": - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-content-type: application/json - x-accepts: application/json - put: - description: "" - operationId: updatePet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: Successful operation - "400": - description: Invalid ID supplied - "404": - description: Pet not found - "405": - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-webclient-blocking: true - x-content-type: application/json - x-accepts: application/json - servers: - - url: http://petstore.swagger.io/v2 - - url: http://path-server-test.petstore.local/v2 - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - deprecated: true - 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": - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-webclient-blocking: true - x-accepts: application/json - /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": - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-webclient-blocking: true - x-accepts: application/json - /pet/{petId}: - delete: - description: "" - operationId: deletePet - parameters: - - explode: false - in: header - name: api_key - required: false - schema: - type: string - style: simple - - description: Pet id to delete - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "200": - description: Successful operation - "400": - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - "400": - description: Invalid ID supplied - "404": - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-webclient-blocking: true - x-accepts: application/json - post: - description: "" - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/updatePetWithForm_request' - responses: - "200": - description: Successful operation - "405": - 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 - /pet/{petId}/uploadImage: - post: - description: "" - operationId: uploadFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - 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 - /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 - /store/order: - post: - description: "" - operationId: placeOrder - requestBody: - content: - application/json: - 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": - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-content-type: application/json - x-accepts: application/json - /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 - explode: false - in: path - name: order_id - required: true - schema: - type: string - style: simple - responses: - "400": - description: Invalid ID supplied - "404": - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - explode: false - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - "400": - description: Invalid ID supplied - "404": - description: Order not found - summary: Find purchase order by ID - tags: - - store - x-accepts: application/json - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - description: successful operation - summary: Create user - tags: - - user - x-content-type: application/json - x-accepts: application/json - /user/createWithArray: - post: - description: "" - operationId: createUsersWithArrayInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-content-type: application/json - x-accepts: application/json - /user/createWithList: - post: - description: "" - operationId: createUsersWithListInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-content-type: application/json - x-accepts: application/json - /user/login: - get: - description: "" - operationId: loginUser - parameters: - - description: The user name for login - explode: true - in: query - name: username - required: true - schema: - type: string - style: form - - description: The password for login in clear text - explode: true - in: query - name: password - required: true - schema: - type: string - style: form - 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 - explode: false - schema: - format: int32 - type: integer - style: simple - X-Expires-After: - description: date in UTC when token expires - explode: false - schema: - format: date-time - type: string - style: simple - "400": - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - /user/logout: - get: - description: "" - operationId: logoutUser - responses: - default: - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - /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 - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - "400": - description: Invalid username supplied - "404": - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - get: - description: "" - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - "400": - description: Invalid username supplied - "404": - description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - description: Invalid user supplied - "404": - description: User not found - summary: Updated user - tags: - - user - x-content-type: application/json - x-accepts: application/json - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - $ref: '#/components/requestBodies/Client' - 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-content-type: application/json - x-accepts: application/json - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - explode: true - in: query - name: required_string_group - required: true - schema: - type: integer - style: form - - description: Required Boolean in group parameters - explode: false - in: header - name: required_boolean_group - required: true - schema: - type: boolean - style: simple - - description: Required Integer in group parameters - explode: true - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - style: form - - description: String in group parameters - explode: true - in: query - name: string_group - required: false - schema: - type: integer - style: form - - description: Boolean in group parameters - explode: false - in: header - name: boolean_group - required: false - schema: - type: boolean - style: simple - - description: Integer in group parameters - explode: true - in: query - name: int64_group - required: false - schema: - format: int64 - type: integer - style: form - responses: - "400": - description: Someting wrong - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - 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 - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - explode: false - in: header - name: enum_header_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: simple - - description: Query parameter enum test (string array) - explode: true - in: query - name: enum_query_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - explode: true - in: query - name: enum_query_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_integer - required: false - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_double - required: false - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - style: form - - explode: true - in: query - name: enum_query_model_array - required: false - schema: - items: - $ref: '#/components/schemas/EnumClass' - type: array - style: form - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testEnumParameters_request' - responses: - "400": - description: Invalid request - "404": - description: Not found - summary: To test enum parameters - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-content-type: application/json - x-accepts: application/json - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testEndpointParameters_request' - responses: - "400": - description: Invalid username supplied - "404": - 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 - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-content-type: application/json - x-accepts: '*/*' - /fake/property/enum-int: - post: - description: Test serialization of enum (int) properties with examples - operationId: fakePropertyEnumIntegerSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterObjectWithEnumProperty' - description: Input enum (int) as post body - required: true - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterObjectWithEnumProperty' - description: Output enum (int) - tags: - - fake - x-content-type: application/json - x-accepts: '*/*' - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-content-type: application/json - x-accepts: '*/*' - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-content-type: application/json - x-accepts: '*/*' - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-content-type: application/json - x-accepts: '*/*' - /fake/jsonFormData: - get: - description: "" - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testJsonFormData_request' - responses: - "200": - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - /fake/inline-additionalProperties: - post: - description: "" - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-content-type: application/json - x-accepts: application/json - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - explode: true - in: query - name: query - required: true - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - description: Success - tags: - - fake - x-content-type: application/json - x-accepts: application/json - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-content-type: application/json - x-accepts: application/json - /fake/body-with-file-schema: - put: - description: "For this test, the body for this request must reference a schema\ - \ named `File`." - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - "200": - description: Success - tags: - - fake - x-content-type: application/json - x-accepts: application/json - /fake/body-with-binary: - put: - description: "For this test, the body has to be a binary file." - operationId: testBodyWithBinary - requestBody: - content: - image/png: - schema: - format: binary - nullable: true - type: string - description: image to upload - required: true - responses: - "200": - description: Success - tags: - - fake - x-content-type: image/png - x-accepts: application/json - /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: pipeDelimited - - explode: false - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - 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 - - explode: true - in: query - name: language - required: false - schema: - additionalProperties: - format: string - type: string - type: object - style: form - - allowEmptyValue: true - explode: true - in: query - name: allowEmpty - required: true - schema: - type: string - style: form - responses: - "200": - description: Success - tags: - - fake - x-accepts: application/json - /fake/{petId}/uploadImageWithRequiredFile: - post: - description: "" - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/uploadFileWithRequiredFile_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 (required) - tags: - - pet - x-content-type: multipart/form-data - x-accepts: application/json - /fake/health: - get: - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/HealthCheckResult' - description: The instance started successfully - summary: Health check endpoint - tags: - - fake - x-accepts: application/json - /fake/http-signature-test: - get: - operationId: fake-http-signature-test - parameters: - - description: query parameter - explode: true - in: query - name: query_1 - required: false - schema: - type: string - style: form - - description: header parameter - explode: false - in: header - name: header_1 - required: false - schema: - type: string - style: simple - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - "200": - description: The instance started successfully - security: - - http_signature_test: [] - summary: test http signature authentication - tags: - - fake - x-content-type: application/json - x-accepts: application/json -components: - requestBodies: - UserArray: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - Client: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - Pet: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - schemas: - Foo: - example: - bar: bar - properties: - bar: - default: bar - type: string - type: object - Bar: - default: bar - type: string - 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 - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - 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 - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - 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 - decimal: - format: number - type: string - string: - pattern: "/[a-z]/i" - type: string - byte: - format: byte - 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 - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - pattern: "^\\d{10}$" - type: string - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one - to three digits following i.e. Image_01. - pattern: "/^image_\\d{1,3}$/i" - 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' - outerEnumInteger: - $ref: '#/components/schemas/OuterEnumInteger' - outerEnumDefaultValue: - $ref: '#/components/schemas/OuterEnumDefaultValue' - outerEnumIntegerDefaultValue: - $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - 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 - maxItems: 3 - minItems: 0 - 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 - nullable: true - type: string - OuterEnumInteger: - enum: - - 0 - - 1 - - 2 - example: 2 - type: integer - OuterEnumDefaultValue: - default: placed - enum: - - placed - - approved - - delivered - type: string - OuterEnumIntegerDefaultValue: - default: 0 - enum: - - 0 - - 1 - - 2 - type: integer - 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 - _special_model.name_: - properties: - $special[property.name]: - format: int64 - type: integer - xml: - name: "$special[model.name]" - HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable - in hope to get it as pointer in generated model. - example: - NullableMessage: NullableMessage - properties: - NullableMessage: - nullable: true - type: string - type: object - NullableClass: - additionalProperties: - nullable: true - type: object - properties: - integer_prop: - nullable: true - type: integer - number_prop: - nullable: true - type: number - boolean_prop: - nullable: true - type: boolean - string_prop: - nullable: true - type: string - date_prop: - format: date - nullable: true - type: string - datetime_prop: - format: date-time - nullable: true - type: string - array_nullable_prop: - items: - type: object - nullable: true - type: array - array_and_items_nullable_prop: - items: - nullable: true - type: object - nullable: true - type: array - array_items_nullable: - items: - nullable: true - type: object - type: array - object_nullable_prop: - additionalProperties: - type: object - nullable: true - type: object - object_and_items_nullable_prop: - additionalProperties: - nullable: true - type: object - nullable: true - type: object - object_items_nullable: - additionalProperties: - nullable: true - type: object - type: object - type: object - OuterObjectWithEnumProperty: - example: - value: 2 - properties: - value: - $ref: '#/components/schemas/OuterEnumInteger' - required: - - value - type: object - DeprecatedObject: - deprecated: true - properties: - name: - type: string - type: object - ObjectWithDeprecatedFields: - properties: - uuid: - type: string - id: - deprecated: true - type: number - deprecatedRef: - $ref: '#/components/schemas/DeprecatedObject' - bars: - deprecated: true - items: - $ref: '#/components/schemas/Bar' - type: array - type: object - AllOfWithSingleRef: - properties: - username: - type: string - SingleRefType: - allOf: - - $ref: '#/components/schemas/SingleRefType' - type: object - SingleRefType: - enum: - - admin - - user - title: SingleRefType - type: string - _foo_get_default_response: - example: - string: - bar: bar - properties: - string: - $ref: '#/components/schemas/Foo' - type: object - 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 - 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 - Dog_allOf: - properties: - breed: - type: string - type: object - Cat_allOf: - properties: - declawed: - type: boolean - 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 - bearer_test: - bearerFormat: JWT - scheme: bearer - type: http - http_signature_test: - scheme: signature - type: http diff --git a/samples/server/petstore/helidon/se-default/src/main/resources/application.yaml b/samples/server/petstore/helidon/se-default/src/main/resources/application.yaml deleted file mode 100644 index 2c0422edc74..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/resources/application.yaml +++ /dev/null @@ -1,3 +0,0 @@ -server: - port: 8080 - host: petstore.swagger.io diff --git a/samples/server/petstore/helidon/se-default/src/main/resources/logging.properties b/samples/server/petstore/helidon/se-default/src/main/resources/logging.properties deleted file mode 100644 index cd238eb6615..00000000000 --- a/samples/server/petstore/helidon/se-default/src/main/resources/logging.properties +++ /dev/null @@ -1,19 +0,0 @@ - -# Example Logging Configuration File -# For more information see $JAVA_HOME/jre/lib/logging.properties - -# Send messages to the console -handlers=io.helidon.common.HelidonConsoleHandler - -# HelidonConsoleHandler uses a SimpleFormatter subclass that replaces "!thread!" with the current thread -java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$s %3$s !thread!: %5$s%6$s%n - -# Global logging level. Can be overridden by specific loggers -.level=INFO - -# Component specific log levels -#io.helidon.webserver.level=INFO -#io.helidon.config.level=INFO -#io.helidon.security.level=INFO -#io.helidon.common.level=INFO -#io.netty.level=INFO diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/MainTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/MainTest.java deleted file mode 100644 index cd1fdde073e..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/MainTest.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.openapitools.server; - -import java.util.Collections; -import java.util.concurrent.TimeUnit; - -import javax.json.Json; -import javax.json.JsonBuilderFactory; - -import io.helidon.media.jsonp.JsonpSupport; -import io.helidon.webclient.WebClient; -import io.helidon.webserver.WebServer; - -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; - -@Disabled -public class MainTest { - - private static WebServer webServer; - private static WebClient webClient; - private static final JsonBuilderFactory JSON_BUILDER = Json.createBuilderFactory(Collections.emptyMap()); - - @BeforeAll - public static void startTheServer() throws Exception { - webServer = Main.startServer().await(); - - webClient = WebClient.builder() - .baseUri("http://localhost:" + webServer.port()) - .addMediaSupport(JsonpSupport.create()) - .build(); - } - - @AfterAll - public static void stopServer() throws Exception { - if (webServer != null) { - webServer.shutdown() - .toCompletableFuture() - .get(10, TimeUnit.SECONDS); - } - } - - @Test - public void test() throws Exception { - } -} \ No newline at end of file diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java deleted file mode 100644 index 0f6ef89155f..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AdditionalPropertiesClassTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for AdditionalPropertiesClass - */ -public class AdditionalPropertiesClassTest { - private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); - - /** - * Model tests for AdditionalPropertiesClass - */ - @Test - public void testAdditionalPropertiesClass() { - // TODO: test AdditionalPropertiesClass - } - - /** - * Test the property 'mapProperty' - */ - @Test - public void mapPropertyTest() { - // TODO: test mapProperty - } - - /** - * Test the property 'mapOfMapProperty' - */ - @Test - public void mapOfMapPropertyTest() { - // TODO: test mapOfMapProperty - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java deleted file mode 100644 index feb170c64e4..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AllOfWithSingleRefTest.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.openapitools.jackson.nullable.JsonNullable; -import org.openapitools.server.model.SingleRefType; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for AllOfWithSingleRef - */ -public class AllOfWithSingleRefTest { - private final AllOfWithSingleRef model = new AllOfWithSingleRef(); - - /** - * Model tests for AllOfWithSingleRef - */ - @Test - public void testAllOfWithSingleRef() { - // TODO: test AllOfWithSingleRef - } - - /** - * Test the property 'username' - */ - @Test - public void usernameTest() { - // TODO: test username - } - - /** - * Test the property 'singleRefType' - */ - @Test - public void singleRefTypeTest() { - // TODO: test singleRefType - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AnimalTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AnimalTest.java deleted file mode 100644 index 1299d46ba6f..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/AnimalTest.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Cat; -import org.openapitools.server.model.Dog; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Animal - */ -public class AnimalTest { - private final Animal model = new Animal(); - - /** - * Model tests for Animal - */ - @Test - public void testAnimal() { - // TODO: test Animal - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java deleted file mode 100644 index d67cac0b059..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayOfArrayOfNumberOnlyTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ArrayOfArrayOfNumberOnly - */ -public class ArrayOfArrayOfNumberOnlyTest { - private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); - - /** - * Model tests for ArrayOfArrayOfNumberOnly - */ - @Test - public void testArrayOfArrayOfNumberOnly() { - // TODO: test ArrayOfArrayOfNumberOnly - } - - /** - * Test the property 'arrayArrayNumber' - */ - @Test - public void arrayArrayNumberTest() { - // TODO: test arrayArrayNumber - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java deleted file mode 100644 index 150ba7b070d..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayOfNumberOnlyTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ArrayOfNumberOnly - */ -public class ArrayOfNumberOnlyTest { - private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); - - /** - * Model tests for ArrayOfNumberOnly - */ - @Test - public void testArrayOfNumberOnly() { - // TODO: test ArrayOfNumberOnly - } - - /** - * Test the property 'arrayNumber' - */ - @Test - public void arrayNumberTest() { - // TODO: test arrayNumber - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayTestTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayTestTest.java deleted file mode 100644 index a2d4f750e1c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ArrayTestTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.ReadOnlyFirst; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ArrayTest - */ -public class ArrayTestTest { - private final ArrayTest model = new ArrayTest(); - - /** - * Model tests for ArrayTest - */ - @Test - public void testArrayTest() { - // TODO: test ArrayTest - } - - /** - * Test the property 'arrayOfString' - */ - @Test - public void arrayOfStringTest() { - // TODO: test arrayOfString - } - - /** - * Test the property 'arrayArrayOfInteger' - */ - @Test - public void arrayArrayOfIntegerTest() { - // TODO: test arrayArrayOfInteger - } - - /** - * Test the property 'arrayArrayOfModel' - */ - @Test - public void arrayArrayOfModelTest() { - // TODO: test arrayArrayOfModel - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CapitalizationTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CapitalizationTest.java deleted file mode 100644 index 084a2885fc8..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CapitalizationTest.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Capitalization - */ -public class CapitalizationTest { - private final Capitalization model = new Capitalization(); - - /** - * Model tests for Capitalization - */ - @Test - public void testCapitalization() { - // TODO: test Capitalization - } - - /** - * Test the property 'smallCamel' - */ - @Test - public void smallCamelTest() { - // TODO: test smallCamel - } - - /** - * Test the property 'capitalCamel' - */ - @Test - public void capitalCamelTest() { - // TODO: test capitalCamel - } - - /** - * Test the property 'smallSnake' - */ - @Test - public void smallSnakeTest() { - // TODO: test smallSnake - } - - /** - * Test the property 'capitalSnake' - */ - @Test - public void capitalSnakeTest() { - // TODO: test capitalSnake - } - - /** - * Test the property 'scAETHFlowPoints' - */ - @Test - public void scAETHFlowPointsTest() { - // TODO: test scAETHFlowPoints - } - - /** - * Test the property 'ATT_NAME' - */ - @Test - public void ATT_NAMETest() { - // TODO: test ATT_NAME - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CatTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CatTest.java deleted file mode 100644 index 9ca42bb5996..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CatTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Animal; -import org.openapitools.server.model.CatAllOf; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Cat - */ -public class CatTest { - private final Cat model = new Cat(); - - /** - * Model tests for Cat - */ - @Test - public void testCat() { - // TODO: test Cat - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'declawed' - */ - @Test - public void declawedTest() { - // TODO: test declawed - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CategoryTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CategoryTest.java deleted file mode 100644 index 2618c8fd934..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/CategoryTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Category - */ -public class CategoryTest { - private final Category model = new Category(); - - /** - * Model tests for Category - */ - @Test - public void testCategory() { - // TODO: test Category - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ClassModelTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ClassModelTest.java deleted file mode 100644 index f62de6d1cc0..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ClassModelTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ClassModel - */ -public class ClassModelTest { - private final ClassModel model = new ClassModel(); - - /** - * Model tests for ClassModel - */ - @Test - public void testClassModel() { - // TODO: test ClassModel - } - - /** - * Test the property 'propertyClass' - */ - @Test - public void propertyClassTest() { - // TODO: test propertyClass - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ClientTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ClientTest.java deleted file mode 100644 index a9f4c21ebf8..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ClientTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Client - */ -public class ClientTest { - private final Client model = new Client(); - - /** - * Model tests for Client - */ - @Test - public void testClient() { - // TODO: test Client - } - - /** - * Test the property 'client' - */ - @Test - public void clientTest() { - // TODO: test client - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java deleted file mode 100644 index 9ad380437ce..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/DeprecatedObjectTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for DeprecatedObject - */ -public class DeprecatedObjectTest { - private final DeprecatedObject model = new DeprecatedObject(); - - /** - * Model tests for DeprecatedObject - */ - @Test - public void testDeprecatedObject() { - // TODO: test DeprecatedObject - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/DogTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/DogTest.java deleted file mode 100644 index 11fad95bc99..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/DogTest.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.server.model.Animal; -import org.openapitools.server.model.DogAllOf; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Dog - */ -public class DogTest { - private final Dog model = new Dog(); - - /** - * Model tests for Dog - */ - @Test - public void testDog() { - // TODO: test Dog - } - - /** - * Test the property 'className' - */ - @Test - public void classNameTest() { - // TODO: test className - } - - /** - * Test the property 'color' - */ - @Test - public void colorTest() { - // TODO: test color - } - - /** - * Test the property 'breed' - */ - @Test - public void breedTest() { - // TODO: test breed - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumArraysTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumArraysTest.java deleted file mode 100644 index 42b3832090e..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumArraysTest.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for EnumArrays - */ -public class EnumArraysTest { - private final EnumArrays model = new EnumArrays(); - - /** - * Model tests for EnumArrays - */ - @Test - public void testEnumArrays() { - // TODO: test EnumArrays - } - - /** - * Test the property 'justSymbol' - */ - @Test - public void justSymbolTest() { - // TODO: test justSymbol - } - - /** - * Test the property 'arrayEnum' - */ - @Test - public void arrayEnumTest() { - // TODO: test arrayEnum - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumClassTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumClassTest.java deleted file mode 100644 index 9c02e17dac0..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumClassTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for EnumClass - */ -public class EnumClassTest { - /** - * Model tests for EnumClass - */ - @Test - public void testEnumClass() { - // TODO: test EnumClass - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumTestTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumTestTest.java deleted file mode 100644 index 7c95fed8bb8..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/EnumTestTest.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import org.openapitools.server.model.OuterEnum; -import org.openapitools.server.model.OuterEnumDefaultValue; -import org.openapitools.server.model.OuterEnumInteger; -import org.openapitools.server.model.OuterEnumIntegerDefaultValue; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for EnumTest - */ -public class EnumTestTest { - private final EnumTest model = new EnumTest(); - - /** - * Model tests for EnumTest - */ - @Test - public void testEnumTest() { - // TODO: test EnumTest - } - - /** - * Test the property 'enumString' - */ - @Test - public void enumStringTest() { - // TODO: test enumString - } - - /** - * Test the property 'enumStringRequired' - */ - @Test - public void enumStringRequiredTest() { - // TODO: test enumStringRequired - } - - /** - * Test the property 'enumInteger' - */ - @Test - public void enumIntegerTest() { - // TODO: test enumInteger - } - - /** - * Test the property 'enumNumber' - */ - @Test - public void enumNumberTest() { - // TODO: test enumNumber - } - - /** - * Test the property 'outerEnum' - */ - @Test - public void outerEnumTest() { - // TODO: test outerEnum - } - - /** - * Test the property 'outerEnumInteger' - */ - @Test - public void outerEnumIntegerTest() { - // TODO: test outerEnumInteger - } - - /** - * Test the property 'outerEnumDefaultValue' - */ - @Test - public void outerEnumDefaultValueTest() { - // TODO: test outerEnumDefaultValue - } - - /** - * Test the property 'outerEnumIntegerDefaultValue' - */ - @Test - public void outerEnumIntegerDefaultValueTest() { - // TODO: test outerEnumIntegerDefaultValue - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java deleted file mode 100644 index fbabc01db3c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FileSchemaTestClassTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.ModelFile; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for FileSchemaTestClass - */ -public class FileSchemaTestClassTest { - private final FileSchemaTestClass model = new FileSchemaTestClass(); - - /** - * Model tests for FileSchemaTestClass - */ - @Test - public void testFileSchemaTestClass() { - // TODO: test FileSchemaTestClass - } - - /** - * Test the property '_file' - */ - @Test - public void _fileTest() { - // TODO: test _file - } - - /** - * Test the property 'files' - */ - @Test - public void filesTest() { - // TODO: test files - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java deleted file mode 100644 index d0dc33cef52..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FooGetDefaultResponseTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.server.model.Foo; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for FooGetDefaultResponse - */ -public class FooGetDefaultResponseTest { - private final FooGetDefaultResponse model = new FooGetDefaultResponse(); - - /** - * Model tests for FooGetDefaultResponse - */ - @Test - public void testFooGetDefaultResponse() { - // TODO: test FooGetDefaultResponse - } - - /** - * Test the property 'string' - */ - @Test - public void stringTest() { - // TODO: test string - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FooTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FooTest.java deleted file mode 100644 index 39abe05aad6..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FooTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Foo - */ -public class FooTest { - private final Foo model = new Foo(); - - /** - * Model tests for Foo - */ - @Test - public void testFoo() { - // TODO: test Foo - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FormatTestTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FormatTestTest.java deleted file mode 100644 index 5d988452964..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/FormatTestTest.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.io.File; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for FormatTest - */ -public class FormatTestTest { - private final FormatTest model = new FormatTest(); - - /** - * Model tests for FormatTest - */ - @Test - public void testFormatTest() { - // TODO: test FormatTest - } - - /** - * Test the property 'integer' - */ - @Test - public void integerTest() { - // TODO: test integer - } - - /** - * Test the property 'int32' - */ - @Test - public void int32Test() { - // TODO: test int32 - } - - /** - * Test the property 'int64' - */ - @Test - public void int64Test() { - // TODO: test int64 - } - - /** - * Test the property 'number' - */ - @Test - public void numberTest() { - // TODO: test number - } - - /** - * Test the property '_float' - */ - @Test - public void _floatTest() { - // TODO: test _float - } - - /** - * Test the property '_double' - */ - @Test - public void _doubleTest() { - // TODO: test _double - } - - /** - * Test the property 'decimal' - */ - @Test - public void decimalTest() { - // TODO: test decimal - } - - /** - * Test the property 'string' - */ - @Test - public void stringTest() { - // TODO: test string - } - - /** - * Test the property '_byte' - */ - @Test - public void _byteTest() { - // TODO: test _byte - } - - /** - * Test the property 'binary' - */ - @Test - public void binaryTest() { - // TODO: test binary - } - - /** - * Test the property 'date' - */ - @Test - public void dateTest() { - // TODO: test date - } - - /** - * Test the property 'dateTime' - */ - @Test - public void dateTimeTest() { - // TODO: test dateTime - } - - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } - - /** - * Test the property 'password' - */ - @Test - public void passwordTest() { - // TODO: test password - } - - /** - * Test the property 'patternWithDigits' - */ - @Test - public void patternWithDigitsTest() { - // TODO: test patternWithDigits - } - - /** - * Test the property 'patternWithDigitsAndDelimiter' - */ - @Test - public void patternWithDigitsAndDelimiterTest() { - // TODO: test patternWithDigitsAndDelimiter - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java deleted file mode 100644 index 5a56ddcc24d..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/HasOnlyReadOnlyTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for HasOnlyReadOnly - */ -public class HasOnlyReadOnlyTest { - private final HasOnlyReadOnly model = new HasOnlyReadOnly(); - - /** - * Model tests for HasOnlyReadOnly - */ - @Test - public void testHasOnlyReadOnly() { - // TODO: test HasOnlyReadOnly - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'foo' - */ - @Test - public void fooTest() { - // TODO: test foo - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java deleted file mode 100644 index be4be735e57..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/HealthCheckResultTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for HealthCheckResult - */ -public class HealthCheckResultTest { - private final HealthCheckResult model = new HealthCheckResult(); - - /** - * Model tests for HealthCheckResult - */ - @Test - public void testHealthCheckResult() { - // TODO: test HealthCheckResult - } - - /** - * Test the property 'nullableMessage' - */ - @Test - public void nullableMessageTest() { - // TODO: test nullableMessage - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/MapTestTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/MapTestTest.java deleted file mode 100644 index 62bcf50935c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/MapTestTest.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for MapTest - */ -public class MapTestTest { - private final MapTest model = new MapTest(); - - /** - * Model tests for MapTest - */ - @Test - public void testMapTest() { - // TODO: test MapTest - } - - /** - * Test the property 'mapMapOfString' - */ - @Test - public void mapMapOfStringTest() { - // TODO: test mapMapOfString - } - - /** - * Test the property 'mapOfEnumString' - */ - @Test - public void mapOfEnumStringTest() { - // TODO: test mapOfEnumString - } - - /** - * Test the property 'directMap' - */ - @Test - public void directMapTest() { - // TODO: test directMap - } - - /** - * Test the property 'indirectMap' - */ - @Test - public void indirectMapTest() { - // TODO: test indirectMap - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java deleted file mode 100644 index 70ba5b36b5c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.openapitools.server.model.Animal; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ -public class MixedPropertiesAndAdditionalPropertiesClassTest { - private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); - - /** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ - @Test - public void testMixedPropertiesAndAdditionalPropertiesClass() { - // TODO: test MixedPropertiesAndAdditionalPropertiesClass - } - - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } - - /** - * Test the property 'dateTime' - */ - @Test - public void dateTimeTest() { - // TODO: test dateTime - } - - /** - * Test the property 'map' - */ - @Test - public void mapTest() { - // TODO: test map - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/Model200ResponseTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/Model200ResponseTest.java deleted file mode 100644 index 33b6d47572d..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/Model200ResponseTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Model200Response - */ -public class Model200ResponseTest { - private final Model200Response model = new Model200Response(); - - /** - * Model tests for Model200Response - */ - @Test - public void testModel200Response() { - // TODO: test Model200Response - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'propertyClass' - */ - @Test - public void propertyClassTest() { - // TODO: test propertyClass - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java deleted file mode 100644 index 43cb48513cf..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelApiResponseTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ModelApiResponse - */ -public class ModelApiResponseTest { - private final ModelApiResponse model = new ModelApiResponse(); - - /** - * Model tests for ModelApiResponse - */ - @Test - public void testModelApiResponse() { - // TODO: test ModelApiResponse - } - - /** - * Test the property 'code' - */ - @Test - public void codeTest() { - // TODO: test code - } - - /** - * Test the property 'type' - */ - @Test - public void typeTest() { - // TODO: test type - } - - /** - * Test the property 'message' - */ - @Test - public void messageTest() { - // TODO: test message - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelFileTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelFileTest.java deleted file mode 100644 index ff03280b7e5..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelFileTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ModelFile - */ -public class ModelFileTest { - private final ModelFile model = new ModelFile(); - - /** - * Model tests for ModelFile - */ - @Test - public void testModelFile() { - // TODO: test ModelFile - } - - /** - * Test the property 'sourceURI' - */ - @Test - public void sourceURITest() { - // TODO: test sourceURI - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelListTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelListTest.java deleted file mode 100644 index 7f228b19133..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelListTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ModelList - */ -public class ModelListTest { - private final ModelList model = new ModelList(); - - /** - * Model tests for ModelList - */ - @Test - public void testModelList() { - // TODO: test ModelList - } - - /** - * Test the property '_123list' - */ - @Test - public void _123listTest() { - // TODO: test _123list - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelReturnTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelReturnTest.java deleted file mode 100644 index e6af66eb003..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ModelReturnTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ModelReturn - */ -public class ModelReturnTest { - private final ModelReturn model = new ModelReturn(); - - /** - * Model tests for ModelReturn - */ - @Test - public void testModelReturn() { - // TODO: test ModelReturn - } - - /** - * Test the property '_return' - */ - @Test - public void _returnTest() { - // TODO: test _return - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NameTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NameTest.java deleted file mode 100644 index 13114ab4e7a..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NameTest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Name - */ -public class NameTest { - private final Name model = new Name(); - - /** - * Model tests for Name - */ - @Test - public void testName() { - // TODO: test Name - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'snakeCase' - */ - @Test - public void snakeCaseTest() { - // TODO: test snakeCase - } - - /** - * Test the property 'property' - */ - @Test - public void propertyTest() { - // TODO: test property - } - - /** - * Test the property '_123number' - */ - @Test - public void _123numberTest() { - // TODO: test _123number - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NullableClassTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NullableClassTest.java deleted file mode 100644 index e2f2dd91bf7..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NullableClassTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for NullableClass - */ -public class NullableClassTest { - private final NullableClass model = new NullableClass(); - - /** - * Model tests for NullableClass - */ - @Test - public void testNullableClass() { - // TODO: test NullableClass - } - - /** - * Test the property 'integerProp' - */ - @Test - public void integerPropTest() { - // TODO: test integerProp - } - - /** - * Test the property 'numberProp' - */ - @Test - public void numberPropTest() { - // TODO: test numberProp - } - - /** - * Test the property 'booleanProp' - */ - @Test - public void booleanPropTest() { - // TODO: test booleanProp - } - - /** - * Test the property 'stringProp' - */ - @Test - public void stringPropTest() { - // TODO: test stringProp - } - - /** - * Test the property 'dateProp' - */ - @Test - public void datePropTest() { - // TODO: test dateProp - } - - /** - * Test the property 'datetimeProp' - */ - @Test - public void datetimePropTest() { - // TODO: test datetimeProp - } - - /** - * Test the property 'arrayNullableProp' - */ - @Test - public void arrayNullablePropTest() { - // TODO: test arrayNullableProp - } - - /** - * Test the property 'arrayAndItemsNullableProp' - */ - @Test - public void arrayAndItemsNullablePropTest() { - // TODO: test arrayAndItemsNullableProp - } - - /** - * Test the property 'arrayItemsNullable' - */ - @Test - public void arrayItemsNullableTest() { - // TODO: test arrayItemsNullable - } - - /** - * Test the property 'objectNullableProp' - */ - @Test - public void objectNullablePropTest() { - // TODO: test objectNullableProp - } - - /** - * Test the property 'objectAndItemsNullableProp' - */ - @Test - public void objectAndItemsNullablePropTest() { - // TODO: test objectAndItemsNullableProp - } - - /** - * Test the property 'objectItemsNullable' - */ - @Test - public void objectItemsNullableTest() { - // TODO: test objectItemsNullable - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NumberOnlyTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NumberOnlyTest.java deleted file mode 100644 index dede232a8fa..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/NumberOnlyTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for NumberOnly - */ -public class NumberOnlyTest { - private final NumberOnly model = new NumberOnly(); - - /** - * Model tests for NumberOnly - */ - @Test - public void testNumberOnly() { - // TODO: test NumberOnly - } - - /** - * Test the property 'justNumber' - */ - @Test - public void justNumberTest() { - // TODO: test justNumber - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java deleted file mode 100644 index 55cf9bedb07..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ObjectWithDeprecatedFieldsTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.server.model.DeprecatedObject; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ObjectWithDeprecatedFields - */ -public class ObjectWithDeprecatedFieldsTest { - private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); - - /** - * Model tests for ObjectWithDeprecatedFields - */ - @Test - public void testObjectWithDeprecatedFields() { - // TODO: test ObjectWithDeprecatedFields - } - - /** - * Test the property 'uuid' - */ - @Test - public void uuidTest() { - // TODO: test uuid - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'deprecatedRef' - */ - @Test - public void deprecatedRefTest() { - // TODO: test deprecatedRef - } - - /** - * Test the property 'bars' - */ - @Test - public void barsTest() { - // TODO: test bars - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OrderTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OrderTest.java deleted file mode 100644 index 90607655525..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OrderTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Order - */ -public class OrderTest { - private final Order model = new Order(); - - /** - * Model tests for Order - */ - @Test - public void testOrder() { - // TODO: test Order - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'petId' - */ - @Test - public void petIdTest() { - // TODO: test petId - } - - /** - * Test the property 'quantity' - */ - @Test - public void quantityTest() { - // TODO: test quantity - } - - /** - * Test the property 'shipDate' - */ - @Test - public void shipDateTest() { - // TODO: test shipDate - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } - - /** - * Test the property 'complete' - */ - @Test - public void completeTest() { - // TODO: test complete - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterCompositeTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterCompositeTest.java deleted file mode 100644 index f61dfbaf415..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterCompositeTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import java.math.BigDecimal; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OuterComposite - */ -public class OuterCompositeTest { - private final OuterComposite model = new OuterComposite(); - - /** - * Model tests for OuterComposite - */ - @Test - public void testOuterComposite() { - // TODO: test OuterComposite - } - - /** - * Test the property 'myNumber' - */ - @Test - public void myNumberTest() { - // TODO: test myNumber - } - - /** - * Test the property 'myString' - */ - @Test - public void myStringTest() { - // TODO: test myString - } - - /** - * Test the property 'myBoolean' - */ - @Test - public void myBooleanTest() { - // TODO: test myBoolean - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java deleted file mode 100644 index 55d00b4918c..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumDefaultValueTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OuterEnumDefaultValue - */ -public class OuterEnumDefaultValueTest { - /** - * Model tests for OuterEnumDefaultValue - */ - @Test - public void testOuterEnumDefaultValue() { - // TODO: test OuterEnumDefaultValue - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java deleted file mode 100644 index 6a5e46c6124..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumIntegerDefaultValueTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OuterEnumIntegerDefaultValue - */ -public class OuterEnumIntegerDefaultValueTest { - /** - * Model tests for OuterEnumIntegerDefaultValue - */ - @Test - public void testOuterEnumIntegerDefaultValue() { - // TODO: test OuterEnumIntegerDefaultValue - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java deleted file mode 100644 index d6c32e321da..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumIntegerTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OuterEnumInteger - */ -public class OuterEnumIntegerTest { - /** - * Model tests for OuterEnumInteger - */ - @Test - public void testOuterEnumInteger() { - // TODO: test OuterEnumInteger - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumTest.java deleted file mode 100644 index 5ea29d21383..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterEnumTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OuterEnum - */ -public class OuterEnumTest { - /** - * Model tests for OuterEnum - */ - @Test - public void testOuterEnum() { - // TODO: test OuterEnum - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java deleted file mode 100644 index d40c868a41b..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/OuterObjectWithEnumPropertyTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.openapitools.server.model.OuterEnumInteger; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for OuterObjectWithEnumProperty - */ -public class OuterObjectWithEnumPropertyTest { - private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); - - /** - * Model tests for OuterObjectWithEnumProperty - */ - @Test - public void testOuterObjectWithEnumProperty() { - // TODO: test OuterObjectWithEnumProperty - } - - /** - * Test the property 'value' - */ - @Test - public void valueTest() { - // TODO: test value - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/PetTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/PetTest.java deleted file mode 100644 index bc913dd50a3..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/PetTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.server.model.Category; -import org.openapitools.server.model.Tag; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Pet - */ -public class PetTest { - private final Pet model = new Pet(); - - /** - * Model tests for Pet - */ - @Test - public void testPet() { - // TODO: test Pet - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'category' - */ - @Test - public void categoryTest() { - // TODO: test category - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - - /** - * Test the property 'photoUrls' - */ - @Test - public void photoUrlsTest() { - // TODO: test photoUrls - } - - /** - * Test the property 'tags' - */ - @Test - public void tagsTest() { - // TODO: test tags - } - - /** - * Test the property 'status' - */ - @Test - public void statusTest() { - // TODO: test status - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java deleted file mode 100644 index 2fe4c7fc6b7..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/ReadOnlyFirstTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for ReadOnlyFirst - */ -public class ReadOnlyFirstTest { - private final ReadOnlyFirst model = new ReadOnlyFirst(); - - /** - * Model tests for ReadOnlyFirst - */ - @Test - public void testReadOnlyFirst() { - // TODO: test ReadOnlyFirst - } - - /** - * Test the property 'bar' - */ - @Test - public void barTest() { - // TODO: test bar - } - - /** - * Test the property 'baz' - */ - @Test - public void bazTest() { - // TODO: test baz - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java deleted file mode 100644 index 4ae2c23f4cb..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/SingleRefTypeTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SingleRefType - */ -public class SingleRefTypeTest { - /** - * Model tests for SingleRefType - */ - @Test - public void testSingleRefType() { - // TODO: test SingleRefType - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java deleted file mode 100644 index 809e043f8ec..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/SpecialModelNameTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.junit.jupiter.api.Test; - - -/** - * Model tests for SpecialModelName - */ -public class SpecialModelNameTest { - private final SpecialModelName model = new SpecialModelName(); - - /** - * Model tests for SpecialModelName - */ - @Test - public void testSpecialModelName() { - // TODO: test SpecialModelName - } - - /** - * Test the property '$specialPropertyName' - */ - @Test - public void $specialPropertyNameTest() { - // TODO: test $specialPropertyName - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/TagTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/TagTest.java deleted file mode 100644 index 4d0d708bf97..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/TagTest.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for Tag - */ -public class TagTest { - private final Tag model = new Tag(); - - /** - * Model tests for Tag - */ - @Test - public void testTag() { - // TODO: test Tag - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'name' - */ - @Test - public void nameTest() { - // TODO: test name - } - -} diff --git a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/UserTest.java b/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/UserTest.java deleted file mode 100644 index ba936a20805..00000000000 --- a/samples/server/petstore/helidon/se-default/src/test/java/org/openapitools/server/model/UserTest.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * OpenAPI Petstore - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.server.model; - -import org.junit.jupiter.api.Test; - - -/** - * Model tests for User - */ -public class UserTest { - private final User model = new User(); - - /** - * Model tests for User - */ - @Test - public void testUser() { - // TODO: test User - } - - /** - * Test the property 'id' - */ - @Test - public void idTest() { - // TODO: test id - } - - /** - * Test the property 'username' - */ - @Test - public void usernameTest() { - // TODO: test username - } - - /** - * Test the property 'firstName' - */ - @Test - public void firstNameTest() { - // TODO: test firstName - } - - /** - * Test the property 'lastName' - */ - @Test - public void lastNameTest() { - // TODO: test lastName - } - - /** - * Test the property 'email' - */ - @Test - public void emailTest() { - // TODO: test email - } - - /** - * Test the property 'password' - */ - @Test - public void passwordTest() { - // TODO: test password - } - - /** - * Test the property 'phone' - */ - @Test - public void phoneTest() { - // TODO: test phone - } - - /** - * Test the property 'userStatus' - */ - @Test - public void userStatusTest() { - // TODO: test userStatus - } - -} diff --git a/samples/server/petstore/python-aiohttp/.gitignore b/samples/server/petstore/python-aiohttp/.gitignore deleted file mode 100644 index 43995bd42fa..00000000000 --- a/samples/server/petstore/python-aiohttp/.gitignore +++ /dev/null @@ -1,66 +0,0 @@ -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -env/ -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -*.egg-info/ -.installed.cfg -*.egg - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*,cover -.hypothesis/ -venv/ -.venv/ -.python-version -.pytest_cache - -# Translations -*.mo -*.pot - -# Django stuff: -*.log - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -#Ipython Notebook -.ipynb_checkpoints diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator-ignore b/samples/server/petstore/python-aiohttp/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/server/petstore/python-aiohttp/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/FILES b/samples/server/petstore/python-aiohttp/.openapi-generator/FILES deleted file mode 100644 index a4ced008df6..00000000000 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/FILES +++ /dev/null @@ -1,26 +0,0 @@ -.gitignore -README.md -openapi_server/__init__.py -openapi_server/__main__.py -openapi_server/controllers/__init__.py -openapi_server/controllers/pet_controller.py -openapi_server/controllers/security_controller_.py -openapi_server/controllers/store_controller.py -openapi_server/controllers/user_controller.py -openapi_server/models/__init__.py -openapi_server/models/api_response.py -openapi_server/models/base_model_.py -openapi_server/models/category.py -openapi_server/models/order.py -openapi_server/models/pet.py -openapi_server/models/tag.py -openapi_server/models/user.py -openapi_server/openapi/openapi.yaml -openapi_server/typing_utils.py -openapi_server/util.py -requirements.txt -setup.py -test-requirements.txt -tests/__init__.py -tests/conftest.py -tox.ini diff --git a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION b/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/server/petstore/python-aiohttp/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/python-aiohttp/Makefile b/samples/server/petstore/python-aiohttp/Makefile deleted file mode 100644 index 4e8fafc39bf..00000000000 --- a/samples/server/petstore/python-aiohttp/Makefile +++ /dev/null @@ -1,21 +0,0 @@ - #!/bin/bash - -REQUIREMENTS_OUT=requirements.txt.log -VENV=.venv - -clean: - rm -rf $(REQUIREMENTS_OUT) - rm -rf $(VENV) - rm -rf .pytest_cache - rm -rf .coverage - find . -name "*.py[oc]" -delete - find . -name "__pycache__" -delete - -venv: - python3 -m venv $(VENV) - -test: clean venv - bash ./test_python3.sh - -test-all: clean venv - bash ./test_python3.sh diff --git a/samples/server/petstore/python-aiohttp/README.md b/samples/server/petstore/python-aiohttp/README.md deleted file mode 100644 index b68e70a6a96..00000000000 --- a/samples/server/petstore/python-aiohttp/README.md +++ /dev/null @@ -1,46 +0,0 @@ -# OpenAPI generated server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the -[OpenAPI-Spec](https://openapis.org) from a remote server, you can easily generate a server stub. This -is an example of building a OpenAPI-enabled aiohttp server. - -This example uses the [Connexion](https://github.com/zalando/connexion) library on top of aiohttp. - -## Requirements -Python 3.5.2+ - -## Usage -To run the server, please execute the following from the root directory: - -``` -pip3 install -r requirements.txt -python3 -m openapi_server -``` - -and open your browser to here: - -``` -http://localhost:8080/v2/ui/ -``` - -Your OpenAPI definition lives here: - -``` -http://localhost:8080/v2/openapi.json -``` - -To launch the integration tests, use pytest: -``` -sudo pip install -r test-requirements.txt -pytest -``` - -## Prevent file overriding - -After first generation, add edited files to _.openapi-generator-ignore_ to prevent generator from overwriting them. Typically: -``` -server/controllers/* -test/* -*.txt -``` diff --git a/samples/server/petstore/python-aiohttp/dev-requirements.txt b/samples/server/petstore/python-aiohttp/dev-requirements.txt deleted file mode 100644 index ccdfca62949..00000000000 --- a/samples/server/petstore/python-aiohttp/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -tox -flake8 diff --git a/samples/server/petstore/python-aiohttp/openapi_server/__init__.py b/samples/server/petstore/python-aiohttp/openapi_server/__init__.py deleted file mode 100644 index 387eceb08ca..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/__init__.py +++ /dev/null @@ -1,15 +0,0 @@ -import os -import connexion - -def main(): - options = { - "swagger_ui": True - } - specification_dir = os.path.join(os.path.dirname(__file__), 'openapi') - app = connexion.AioHttpApp(__name__, specification_dir=specification_dir, options=options) - app.add_api('openapi.yaml', - arguments={'title': 'OpenAPI Petstore'}, - pythonic_params=True, - pass_context_arg_name='request') - - app.run(port=8080) diff --git a/samples/server/petstore/python-aiohttp/openapi_server/__main__.py b/samples/server/petstore/python-aiohttp/openapi_server/__main__.py deleted file mode 100644 index f20ae81db34..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/__main__.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python3 - -from . import main - -if __name__ == '__main__': - main() diff --git a/samples/server/petstore/python-aiohttp/openapi_server/controllers/__init__.py b/samples/server/petstore/python-aiohttp/openapi_server/controllers/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/server/petstore/python-aiohttp/openapi_server/controllers/pet_controller.py b/samples/server/petstore/python-aiohttp/openapi_server/controllers/pet_controller.py deleted file mode 100644 index ad7557832ba..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/controllers/pet_controller.py +++ /dev/null @@ -1,114 +0,0 @@ -from typing import List, Dict -from aiohttp import web - -from openapi_server.models.api_response import ApiResponse -from openapi_server.models.pet import Pet -from openapi_server import util - - -async def add_pet(request: web.Request, body) -> web.Response: - """Add a new pet to the store - - - - :param body: Pet object that needs to be added to the store - :type body: dict | bytes - - """ - body = Pet.from_dict(body) - return web.Response(status=200) - - -async def delete_pet(request: web.Request, pet_id, api_key=None) -> web.Response: - """Deletes a pet - - - - :param pet_id: Pet id to delete - :type pet_id: int - :param api_key: - :type api_key: str - - """ - return web.Response(status=200) - - -async def find_pets_by_status(request: web.Request, status) -> web.Response: - """Finds Pets by status - - Multiple status values can be provided with comma separated strings - - :param status: Status values that need to be considered for filter - :type status: List[str] - - """ - return web.Response(status=200) - - -async def find_pets_by_tags(request: web.Request, tags) -> web.Response: - """Finds Pets by tags - - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - - :param tags: Tags to filter by - :type tags: List[str] - - """ - return web.Response(status=200) - - -async def get_pet_by_id(request: web.Request, pet_id) -> web.Response: - """Find pet by ID - - Returns a single pet - - :param pet_id: ID of pet to return - :type pet_id: int - - """ - return web.Response(status=200) - - -async def update_pet(request: web.Request, body) -> web.Response: - """Update an existing pet - - - - :param body: Pet object that needs to be added to the store - :type body: dict | bytes - - """ - body = Pet.from_dict(body) - return web.Response(status=200) - - -async def update_pet_with_form(request: web.Request, pet_id, name=None, status=None) -> web.Response: - """Updates a pet in the store with form data - - - - :param pet_id: ID of pet that needs to be updated - :type pet_id: int - :param name: Updated name of the pet - :type name: str - :param status: Updated status of the pet - :type status: str - - """ - return web.Response(status=200) - - -async def upload_file(request: web.Request, pet_id, additional_metadata=None, file=None) -> web.Response: - """uploads an image - - - - :param pet_id: ID of pet to update - :type pet_id: int - :param additional_metadata: Additional data to pass to server - :type additional_metadata: str - :param file: file to upload - :type file: str - - """ - return web.Response(status=200) diff --git a/samples/server/petstore/python-aiohttp/openapi_server/controllers/security_controller_.py b/samples/server/petstore/python-aiohttp/openapi_server/controllers/security_controller_.py deleted file mode 100644 index 82a8ffedab3..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/controllers/security_controller_.py +++ /dev/null @@ -1,28 +0,0 @@ -from typing import List - - -def info_from_petstore_auth(token: str) -> dict: - """ - Validate and decode token. - Returned value will be passed in 'token_info' parameter of your operation function, if there is one. - 'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one. - 'scope' or 'scopes' will be passed to scope validation function. - Should return None if token is invalid or does not allow access to called API. - """ - return {'scopes': ['read:pets', 'write:pets'], 'uid': 'user_id'} - - -def validate_scope_petstore_auth(required_scopes: List[str], token_scopes: List[str]) -> bool: - """ Validate required scopes are included in token scope """ - return set(required_scopes).issubset(set(token_scopes)) - - -def info_from_api_key(api_key: str, required_scopes: None) -> dict: - """ - Check and retrieve authentication information from api_key. - Returned value will be passed in 'token_info' parameter of your operation function, if there is one. - 'sub' or 'uid' will be set in 'user' parameter of your operation function, if there is one. - Should return None if api_key is invalid or does not allow access to called API. - """ - return {'uid': 'user_id'} - diff --git a/samples/server/petstore/python-aiohttp/openapi_server/controllers/store_controller.py b/samples/server/petstore/python-aiohttp/openapi_server/controllers/store_controller.py deleted file mode 100644 index 38792ced264..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/controllers/store_controller.py +++ /dev/null @@ -1,52 +0,0 @@ -from typing import List, Dict -from aiohttp import web - -from openapi_server.models.order import Order -from openapi_server import util - - -async def delete_order(request: web.Request, order_id) -> web.Response: - """Delete purchase order by ID - - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - - :param order_id: ID of the order that needs to be deleted - :type order_id: str - - """ - return web.Response(status=200) - - -async def get_inventory(request: web.Request, ) -> web.Response: - """Returns pet inventories by status - - Returns a map of status codes to quantities - - - """ - return web.Response(status=200) - - -async def get_order_by_id(request: web.Request, order_id) -> web.Response: - """Find purchase order by ID - - For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - - :param order_id: ID of pet that needs to be fetched - :type order_id: int - - """ - return web.Response(status=200) - - -async def place_order(request: web.Request, body) -> web.Response: - """Place an order for a pet - - - - :param body: order placed for purchasing the pet - :type body: dict | bytes - - """ - body = Order.from_dict(body) - return web.Response(status=200) diff --git a/samples/server/petstore/python-aiohttp/openapi_server/controllers/user_controller.py b/samples/server/petstore/python-aiohttp/openapi_server/controllers/user_controller.py deleted file mode 100644 index 89dd0872413..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/controllers/user_controller.py +++ /dev/null @@ -1,107 +0,0 @@ -from typing import List, Dict -from aiohttp import web - -from openapi_server.models.user import User -from openapi_server import util - - -async def create_user(request: web.Request, body) -> web.Response: - """Create user - - This can only be done by the logged in user. - - :param body: Created user object - :type body: dict | bytes - - """ - body = User.from_dict(body) - return web.Response(status=200) - - -async def create_users_with_array_input(request: web.Request, body) -> web.Response: - """Creates list of users with given input array - - - - :param body: List of user object - :type body: list | bytes - - """ - body = [User.from_dict(d) for d in body] - return web.Response(status=200) - - -async def create_users_with_list_input(request: web.Request, body) -> web.Response: - """Creates list of users with given input array - - - - :param body: List of user object - :type body: list | bytes - - """ - body = [User.from_dict(d) for d in body] - return web.Response(status=200) - - -async def delete_user(request: web.Request, username) -> web.Response: - """Delete user - - This can only be done by the logged in user. - - :param username: The name that needs to be deleted - :type username: str - - """ - return web.Response(status=200) - - -async def get_user_by_name(request: web.Request, username) -> web.Response: - """Get user by user name - - - - :param username: The name that needs to be fetched. Use user1 for testing. - :type username: str - - """ - return web.Response(status=200) - - -async def login_user(request: web.Request, username, password) -> web.Response: - """Logs user into the system - - - - :param username: The user name for login - :type username: str - :param password: The password for login in clear text - :type password: str - - """ - return web.Response(status=200) - - -async def logout_user(request: web.Request, ) -> web.Response: - """Logs out current logged in user session - - - - - """ - return web.Response(status=200) - - -async def update_user(request: web.Request, username, body) -> web.Response: - """Updated user - - This can only be done by the logged in user. - - :param username: name that need to be deleted - :type username: str - :param body: Updated user object - :type body: dict | bytes - - """ - body = User.from_dict(body) - return web.Response(status=200) diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/__init__.py b/samples/server/petstore/python-aiohttp/openapi_server/models/__init__.py deleted file mode 100644 index 8b108a5fe89..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# coding: utf-8 - -# import models into model package -from openapi_server.models.api_response import ApiResponse -from openapi_server.models.category import Category -from openapi_server.models.order import Order -from openapi_server.models.pet import Pet -from openapi_server.models.tag import Tag -from openapi_server.models.user import User diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/api_response.py b/samples/server/petstore/python-aiohttp/openapi_server/models/api_response.py deleted file mode 100644 index 2fc7342b8bc..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/api_response.py +++ /dev/null @@ -1,110 +0,0 @@ -# coding: utf-8 - -from datetime import date, datetime - -from typing import List, Dict, Type - -from openapi_server.models.base_model_ import Model -from openapi_server import util - - -class ApiResponse(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, code: int=None, type: str=None, message: str=None): - """ApiResponse - a model defined in OpenAPI - - :param code: The code of this ApiResponse. - :param type: The type of this ApiResponse. - :param message: The message of this ApiResponse. - """ - self.openapi_types = { - 'code': int, - 'type': str, - 'message': str - } - - self.attribute_map = { - 'code': 'code', - 'type': 'type', - 'message': 'message' - } - - self._code = code - self._type = type - self._message = message - - @classmethod - def from_dict(cls, dikt: dict) -> 'ApiResponse': - """Returns the dict as a model - - :param dikt: A dict. - :return: The ApiResponse of this ApiResponse. - """ - return util.deserialize_model(dikt, cls) - - @property - def code(self): - """Gets the code of this ApiResponse. - - - :return: The code of this ApiResponse. - :rtype: int - """ - return self._code - - @code.setter - def code(self, code): - """Sets the code of this ApiResponse. - - - :param code: The code of this ApiResponse. - :type code: int - """ - - self._code = code - - @property - def type(self): - """Gets the type of this ApiResponse. - - - :return: The type of this ApiResponse. - :rtype: str - """ - return self._type - - @type.setter - def type(self, type): - """Sets the type of this ApiResponse. - - - :param type: The type of this ApiResponse. - :type type: str - """ - - self._type = type - - @property - def message(self): - """Gets the message of this ApiResponse. - - - :return: The message of this ApiResponse. - :rtype: str - """ - return self._message - - @message.setter - def message(self, message): - """Sets the message of this ApiResponse. - - - :param message: The message of this ApiResponse. - :type message: str - """ - - self._message = message diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/base_model_.py b/samples/server/petstore/python-aiohttp/openapi_server/models/base_model_.py deleted file mode 100644 index 54f342e5670..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/base_model_.py +++ /dev/null @@ -1,66 +0,0 @@ -import pprint - -import typing - -from openapi_server import util - -T = typing.TypeVar('T') - - -class Model(object): - # openapiTypes: The key is attribute name and the - # value is attribute type. - openapi_types = {} - - # attributeMap: The key is attribute name and the - # value is json key in definition. - attribute_map = {} - - @classmethod - def from_dict(cls: T, dikt: dict) -> T: - """Returns the dict as a model""" - return util.deserialize_model(dikt, cls) - - def to_dict(self) -> dict: - """Returns the model properties as a dict - """ - result = {} - - for attr_key, json_key in self.attribute_map.items(): - value = getattr(self, attr_key) - if value is None: - continue - if isinstance(value, list): - result[json_key] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[json_key] = value.to_dict() - elif isinstance(value, dict): - result[json_key] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[json_key] = value - - return result - - def to_str(self) -> str: - """Returns the string representation of the model - """ - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/category.py b/samples/server/petstore/python-aiohttp/openapi_server/models/category.py deleted file mode 100644 index 930eef70829..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/category.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -from datetime import date, datetime - -from typing import List, Dict, Type - -from openapi_server.models.base_model_ import Model -from openapi_server import util - - -class Category(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, id: int=None, name: str=None): - """Category - a model defined in OpenAPI - - :param id: The id of this Category. - :param name: The name of this Category. - """ - self.openapi_types = { - 'id': int, - 'name': str - } - - self.attribute_map = { - 'id': 'id', - 'name': 'name' - } - - self._id = id - self._name = name - - @classmethod - def from_dict(cls, dikt: dict) -> 'Category': - """Returns the dict as a model - - :param dikt: A dict. - :return: The Category of this Category. - """ - return util.deserialize_model(dikt, cls) - - @property - def id(self): - """Gets the id of this Category. - - - :return: The id of this Category. - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Category. - - - :param id: The id of this Category. - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Category. - - - :return: The name of this Category. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Category. - - - :param name: The name of this Category. - :type name: str - """ - - self._name = name diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/order.py b/samples/server/petstore/python-aiohttp/openapi_server/models/order.py deleted file mode 100644 index 88df4eb7e8f..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/order.py +++ /dev/null @@ -1,193 +0,0 @@ -# coding: utf-8 - -from datetime import date, datetime - -from typing import List, Dict, Type - -from openapi_server.models.base_model_ import Model -from openapi_server import util - - -class Order(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, id: int=None, pet_id: int=None, quantity: int=None, ship_date: datetime=None, status: str=None, complete: bool=False): - """Order - a model defined in OpenAPI - - :param id: The id of this Order. - :param pet_id: The pet_id of this Order. - :param quantity: The quantity of this Order. - :param ship_date: The ship_date of this Order. - :param status: The status of this Order. - :param complete: The complete of this Order. - """ - self.openapi_types = { - 'id': int, - 'pet_id': int, - 'quantity': int, - 'ship_date': datetime, - 'status': str, - 'complete': bool - } - - self.attribute_map = { - 'id': 'id', - 'pet_id': 'petId', - 'quantity': 'quantity', - 'ship_date': 'shipDate', - 'status': 'status', - 'complete': 'complete' - } - - self._id = id - self._pet_id = pet_id - self._quantity = quantity - self._ship_date = ship_date - self._status = status - self._complete = complete - - @classmethod - def from_dict(cls, dikt: dict) -> 'Order': - """Returns the dict as a model - - :param dikt: A dict. - :return: The Order of this Order. - """ - return util.deserialize_model(dikt, cls) - - @property - def id(self): - """Gets the id of this Order. - - - :return: The id of this Order. - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Order. - - - :param id: The id of this Order. - :type id: int - """ - - self._id = id - - @property - def pet_id(self): - """Gets the pet_id of this Order. - - - :return: The pet_id of this Order. - :rtype: int - """ - return self._pet_id - - @pet_id.setter - def pet_id(self, pet_id): - """Sets the pet_id of this Order. - - - :param pet_id: The pet_id of this Order. - :type pet_id: int - """ - - self._pet_id = pet_id - - @property - def quantity(self): - """Gets the quantity of this Order. - - - :return: The quantity of this Order. - :rtype: int - """ - return self._quantity - - @quantity.setter - def quantity(self, quantity): - """Sets the quantity of this Order. - - - :param quantity: The quantity of this Order. - :type quantity: int - """ - - self._quantity = quantity - - @property - def ship_date(self): - """Gets the ship_date of this Order. - - - :return: The ship_date of this Order. - :rtype: datetime - """ - return self._ship_date - - @ship_date.setter - def ship_date(self, ship_date): - """Sets the ship_date of this Order. - - - :param ship_date: The ship_date of this Order. - :type ship_date: datetime - """ - - self._ship_date = ship_date - - @property - def status(self): - """Gets the status of this Order. - - Order Status - - :return: The status of this Order. - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Order. - - Order Status - - :param status: The status of this Order. - :type status: str - """ - allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" - .format(status, allowed_values) - ) - - self._status = status - - @property - def complete(self): - """Gets the complete of this Order. - - - :return: The complete of this Order. - :rtype: bool - """ - return self._complete - - @complete.setter - def complete(self, complete): - """Sets the complete of this Order. - - - :param complete: The complete of this Order. - :type complete: bool - """ - - self._complete = complete diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/pet.py b/samples/server/petstore/python-aiohttp/openapi_server/models/pet.py deleted file mode 100644 index d3e68e105e3..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/pet.py +++ /dev/null @@ -1,199 +0,0 @@ -# coding: utf-8 - -from datetime import date, datetime - -from typing import List, Dict, Type - -from openapi_server.models.base_model_ import Model -from openapi_server.models.category import Category -from openapi_server.models.tag import Tag -from openapi_server import util - - -class Pet(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, id: int=None, category: Category=None, name: str=None, photo_urls: List[str]=None, tags: List[Tag]=None, status: str=None): - """Pet - a model defined in OpenAPI - - :param id: The id of this Pet. - :param category: The category of this Pet. - :param name: The name of this Pet. - :param photo_urls: The photo_urls of this Pet. - :param tags: The tags of this Pet. - :param status: The status of this Pet. - """ - self.openapi_types = { - 'id': int, - 'category': Category, - 'name': str, - 'photo_urls': List[str], - 'tags': List[Tag], - 'status': str - } - - self.attribute_map = { - 'id': 'id', - 'category': 'category', - 'name': 'name', - 'photo_urls': 'photoUrls', - 'tags': 'tags', - 'status': 'status' - } - - self._id = id - self._category = category - self._name = name - self._photo_urls = photo_urls - self._tags = tags - self._status = status - - @classmethod - def from_dict(cls, dikt: dict) -> 'Pet': - """Returns the dict as a model - - :param dikt: A dict. - :return: The Pet of this Pet. - """ - return util.deserialize_model(dikt, cls) - - @property - def id(self): - """Gets the id of this Pet. - - - :return: The id of this Pet. - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Pet. - - - :param id: The id of this Pet. - :type id: int - """ - - self._id = id - - @property - def category(self): - """Gets the category of this Pet. - - - :return: The category of this Pet. - :rtype: Category - """ - return self._category - - @category.setter - def category(self, category): - """Sets the category of this Pet. - - - :param category: The category of this Pet. - :type category: Category - """ - - self._category = category - - @property - def name(self): - """Gets the name of this Pet. - - - :return: The name of this Pet. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Pet. - - - :param name: The name of this Pet. - :type name: str - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") - - self._name = name - - @property - def photo_urls(self): - """Gets the photo_urls of this Pet. - - - :return: The photo_urls of this Pet. - :rtype: List[str] - """ - return self._photo_urls - - @photo_urls.setter - def photo_urls(self, photo_urls): - """Sets the photo_urls of this Pet. - - - :param photo_urls: The photo_urls of this Pet. - :type photo_urls: List[str] - """ - if photo_urls is None: - raise ValueError("Invalid value for `photo_urls`, must not be `None`") - - self._photo_urls = photo_urls - - @property - def tags(self): - """Gets the tags of this Pet. - - - :return: The tags of this Pet. - :rtype: List[Tag] - """ - return self._tags - - @tags.setter - def tags(self, tags): - """Sets the tags of this Pet. - - - :param tags: The tags of this Pet. - :type tags: List[Tag] - """ - - self._tags = tags - - @property - def status(self): - """Gets the status of this Pet. - - pet status in the store - - :return: The status of this Pet. - :rtype: str - """ - return self._status - - @status.setter - def status(self, status): - """Sets the status of this Pet. - - pet status in the store - - :param status: The status of this Pet. - :type status: str - """ - allowed_values = ["available", "pending", "sold"] # noqa: E501 - if status not in allowed_values: - raise ValueError( - "Invalid value for `status` ({0}), must be one of {1}" - .format(status, allowed_values) - ) - - self._status = status diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/tag.py b/samples/server/petstore/python-aiohttp/openapi_server/models/tag.py deleted file mode 100644 index d494277441c..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/tag.py +++ /dev/null @@ -1,85 +0,0 @@ -# coding: utf-8 - -from datetime import date, datetime - -from typing import List, Dict, Type - -from openapi_server.models.base_model_ import Model -from openapi_server import util - - -class Tag(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, id: int=None, name: str=None): - """Tag - a model defined in OpenAPI - - :param id: The id of this Tag. - :param name: The name of this Tag. - """ - self.openapi_types = { - 'id': int, - 'name': str - } - - self.attribute_map = { - 'id': 'id', - 'name': 'name' - } - - self._id = id - self._name = name - - @classmethod - def from_dict(cls, dikt: dict) -> 'Tag': - """Returns the dict as a model - - :param dikt: A dict. - :return: The Tag of this Tag. - """ - return util.deserialize_model(dikt, cls) - - @property - def id(self): - """Gets the id of this Tag. - - - :return: The id of this Tag. - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this Tag. - - - :param id: The id of this Tag. - :type id: int - """ - - self._id = id - - @property - def name(self): - """Gets the name of this Tag. - - - :return: The name of this Tag. - :rtype: str - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Tag. - - - :param name: The name of this Tag. - :type name: str - """ - - self._name = name diff --git a/samples/server/petstore/python-aiohttp/openapi_server/models/user.py b/samples/server/petstore/python-aiohttp/openapi_server/models/user.py deleted file mode 100644 index 24e024c54ab..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/models/user.py +++ /dev/null @@ -1,237 +0,0 @@ -# coding: utf-8 - -from datetime import date, datetime - -from typing import List, Dict, Type - -from openapi_server.models.base_model_ import Model -from openapi_server import util - - -class User(Model): - """NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - - Do not edit the class manually. - """ - - def __init__(self, id: int=None, username: str=None, first_name: str=None, last_name: str=None, email: str=None, password: str=None, phone: str=None, user_status: int=None): - """User - a model defined in OpenAPI - - :param id: The id of this User. - :param username: The username of this User. - :param first_name: The first_name of this User. - :param last_name: The last_name of this User. - :param email: The email of this User. - :param password: The password of this User. - :param phone: The phone of this User. - :param user_status: The user_status of this User. - """ - self.openapi_types = { - 'id': int, - 'username': str, - 'first_name': str, - 'last_name': str, - 'email': str, - 'password': str, - 'phone': str, - 'user_status': int - } - - self.attribute_map = { - 'id': 'id', - 'username': 'username', - 'first_name': 'firstName', - 'last_name': 'lastName', - 'email': 'email', - 'password': 'password', - 'phone': 'phone', - 'user_status': 'userStatus' - } - - self._id = id - self._username = username - self._first_name = first_name - self._last_name = last_name - self._email = email - self._password = password - self._phone = phone - self._user_status = user_status - - @classmethod - def from_dict(cls, dikt: dict) -> 'User': - """Returns the dict as a model - - :param dikt: A dict. - :return: The User of this User. - """ - return util.deserialize_model(dikt, cls) - - @property - def id(self): - """Gets the id of this User. - - - :return: The id of this User. - :rtype: int - """ - return self._id - - @id.setter - def id(self, id): - """Sets the id of this User. - - - :param id: The id of this User. - :type id: int - """ - - self._id = id - - @property - def username(self): - """Gets the username of this User. - - - :return: The username of this User. - :rtype: str - """ - return self._username - - @username.setter - def username(self, username): - """Sets the username of this User. - - - :param username: The username of this User. - :type username: str - """ - - self._username = username - - @property - def first_name(self): - """Gets the first_name of this User. - - - :return: The first_name of this User. - :rtype: str - """ - return self._first_name - - @first_name.setter - def first_name(self, first_name): - """Sets the first_name of this User. - - - :param first_name: The first_name of this User. - :type first_name: str - """ - - self._first_name = first_name - - @property - def last_name(self): - """Gets the last_name of this User. - - - :return: The last_name of this User. - :rtype: str - """ - return self._last_name - - @last_name.setter - def last_name(self, last_name): - """Sets the last_name of this User. - - - :param last_name: The last_name of this User. - :type last_name: str - """ - - self._last_name = last_name - - @property - def email(self): - """Gets the email of this User. - - - :return: The email of this User. - :rtype: str - """ - return self._email - - @email.setter - def email(self, email): - """Sets the email of this User. - - - :param email: The email of this User. - :type email: str - """ - - self._email = email - - @property - def password(self): - """Gets the password of this User. - - - :return: The password of this User. - :rtype: str - """ - return self._password - - @password.setter - def password(self, password): - """Sets the password of this User. - - - :param password: The password of this User. - :type password: str - """ - - self._password = password - - @property - def phone(self): - """Gets the phone of this User. - - - :return: The phone of this User. - :rtype: str - """ - return self._phone - - @phone.setter - def phone(self, phone): - """Sets the phone of this User. - - - :param phone: The phone of this User. - :type phone: str - """ - - self._phone = phone - - @property - def user_status(self): - """Gets the user_status of this User. - - User Status - - :return: The user_status of this User. - :rtype: int - """ - return self._user_status - - @user_status.setter - def user_status(self, user_status): - """Sets the user_status of this User. - - User Status - - :param user_status: The user_status of this User. - :type user_status: int - """ - - self._user_status = user_status diff --git a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml b/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml deleted file mode 100644 index 7f83054c4a7..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/openapi/openapi.yaml +++ /dev/null @@ -1,829 +0,0 @@ -openapi: 3.0.1 -info: - description: "This is a sample server Petstore server. For this sample, you can\ - \ use the api key `special-key` to test the authorization filters." - 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/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: add_pet - 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 - x-body-name: body - responses: - "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-openapi-router-controller: openapi_server.controllers.pet_controller - put: - operationId: update_pet - 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 - x-body-name: body - responses: - "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-openapi-router-controller: openapi_server.controllers.pet_controller - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: find_pets_by_status - 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-openapi-router-controller: openapi_server.controllers.pet_controller - /pet/findByTags: - get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." - operationId: find_pets_by_tags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - 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 tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-openapi-router-controller: openapi_server.controllers.pet_controller - /pet/{petId}: - delete: - operationId: delete_pet - 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: - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-openapi-router-controller: openapi_server.controllers.pet_controller - get: - description: Returns a single pet - operationId: get_pet_by_id - 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-openapi-router-controller: openapi_server.controllers.pet_controller - post: - operationId: update_pet_with_form - 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' - x-body-name: body - 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-openapi-router-controller: openapi_server.controllers.pet_controller - x-codegen-request-body-name: body - /pet/{petId}/uploadImage: - post: - operationId: upload_file - 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' - x-body-name: body - 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-openapi-router-controller: openapi_server.controllers.pet_controller - x-codegen-request-body-name: body - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: get_inventory - 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-openapi-router-controller: openapi_server.controllers.store_controller - /store/order: - post: - operationId: place_order - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - x-body-name: body - 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-openapi-router-controller: openapi_server.controllers.store_controller - /store/order/{orderId}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: delete_order - parameters: - - description: ID of the order that needs to be deleted - in: path - name: orderId - 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-openapi-router-controller: openapi_server.controllers.store_controller - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generate exceptions - operationId: get_order_by_id - parameters: - - description: ID of pet that needs to be fetched - in: path - name: orderId - 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-openapi-router-controller: openapi_server.controllers.store_controller - /user: - post: - description: This can only be done by the logged in user. - operationId: create_user - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - x-body-name: body - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-openapi-router-controller: openapi_server.controllers.user_controller - /user/createWithArray: - post: - operationId: create_users_with_array_input - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - x-body-name: body - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-openapi-router-controller: openapi_server.controllers.user_controller - /user/createWithList: - post: - operationId: create_users_with_list_input - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - x-body-name: body - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-openapi-router-controller: openapi_server.controllers.user_controller - /user/login: - get: - operationId: login_user - 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-openapi-router-controller: openapi_server.controllers.user_controller - /user/logout: - get: - operationId: logout_user - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-openapi-router-controller: openapi_server.controllers.user_controller - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: delete_user - 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-openapi-router-controller: openapi_server.controllers.user_controller - get: - operationId: get_user_by_name - 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-openapi-router-controller: openapi_server.controllers.user_controller - put: - description: This can only be done by the logged in user. - operationId: update_user - 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 - x-body-name: body - 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-openapi-router-controller: openapi_server.controllers.user_controller -components: - schemas: - Order: - description: An order for a pets from the pet store - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - title: id - type: integer - petId: - format: int64 - title: petId - type: integer - quantity: - format: int32 - title: quantity - type: integer - shipDate: - format: date-time - title: shipDate - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - title: status - type: string - complete: - default: false - title: complete - type: boolean - title: Pet Order - type: object - xml: - name: Order - Category: - description: A category for a pet - example: - name: name - id: 6 - properties: - id: - format: int64 - title: id - type: integer - name: - title: name - type: string - title: Pet category - type: object - xml: - name: Category - User: - description: A User who is purchasing from the pet store - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - title: id - type: integer - username: - title: username - type: string - firstName: - title: firstName - type: string - lastName: - title: lastName - type: string - email: - title: email - type: string - password: - title: password - type: string - phone: - title: phone - type: string - userStatus: - description: User Status - format: int32 - title: userStatus - type: integer - title: a User - type: object - xml: - name: User - Tag: - description: A tag for a pet - example: - name: name - id: 1 - properties: - id: - format: int64 - title: id - type: integer - name: - title: name - type: string - title: Pet Tag - type: object - xml: - name: Tag - Pet: - description: A pet for sale in the pet store - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - title: id - type: integer - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - title: name - type: string - photoUrls: - items: - type: string - title: photoUrls - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - title: tags - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - title: status - type: string - required: - - name - - photoUrls - title: a Pet - type: object - xml: - name: Pet - ApiResponse: - description: Describes the result of uploading an image resource - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - title: code - type: integer - type: - title: type - type: string - message: - title: message - type: string - title: An uploaded response - type: object - 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 - 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 - x-tokenInfoFunc: openapi_server.controllers.security_controller_.info_from_petstore_auth - x-scopeValidateFunc: openapi_server.controllers.security_controller_.validate_scope_petstore_auth - api_key: - in: header - name: api_key - type: apiKey - x-apikeyInfoFunc: openapi_server.controllers.security_controller_.info_from_api_key -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/python-aiohttp/openapi_server/typing_utils.py b/samples/server/petstore/python-aiohttp/openapi_server/typing_utils.py deleted file mode 100644 index 0563f81fd53..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/typing_utils.py +++ /dev/null @@ -1,32 +0,0 @@ -# coding: utf-8 - -import sys - -if sys.version_info < (3, 7): - import typing - - def is_generic(klass): - """ Determine whether klass is a generic class """ - return type(klass) == typing.GenericMeta - - def is_dict(klass): - """ Determine whether klass is a Dict """ - return klass.__extra__ == dict - - def is_list(klass): - """ Determine whether klass is a List """ - return klass.__extra__ == list - -else: - - def is_generic(klass): - """ Determine whether klass is a generic class """ - return hasattr(klass, '__origin__') - - def is_dict(klass): - """ Determine whether klass is a Dict """ - return klass.__origin__ == dict - - def is_list(klass): - """ Determine whether klass is a List """ - return klass.__origin__ == list diff --git a/samples/server/petstore/python-aiohttp/openapi_server/util.py b/samples/server/petstore/python-aiohttp/openapi_server/util.py deleted file mode 100644 index c446943677e..00000000000 --- a/samples/server/petstore/python-aiohttp/openapi_server/util.py +++ /dev/null @@ -1,131 +0,0 @@ -import datetime - -import typing -from typing import Union -from openapi_server import typing_utils - -T = typing.TypeVar('T') -Class = typing.Type[T] - - -def _deserialize(data: Union[dict, list, str], klass: Union[Class, str]) -> Union[dict, list, Class, int, float, str, bool, datetime.date, datetime.datetime]: - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if klass in (int, float, str, bool): - return _deserialize_primitive(data, klass) - elif klass == object: - return _deserialize_object(data) - elif klass == datetime.date: - return deserialize_date(data) - elif klass == datetime.datetime: - return deserialize_datetime(data) - elif typing_utils.is_generic(klass): - if typing_utils.is_list(klass): - return _deserialize_list(data, klass.__args__[0]) - if typing_utils.is_dict(klass): - return _deserialize_dict(data, klass.__args__[1]) - else: - return deserialize_model(data, klass) - - -def _deserialize_primitive(data, klass: Class) -> Union[Class, int, float, str, bool]: - """Deserializes to primitive type. - - :param data: data to deserialize. - :param klass: class literal. - - :return: int, float, str, bool. - """ - try: - value = klass(data) - except (UnicodeEncodeError, TypeError): - value = data - return value - - -def _deserialize_object(value: T) -> T: - """Return an original value. - - :return: object. - """ - return value - - -def deserialize_date(string: str) -> datetime.date: - """Deserializes string to date. - - :param string: str. - :return: date. - """ - try: - from dateutil.parser import parse - return parse(string).date() - except ImportError: - return string - - -def deserialize_datetime(string: str) -> datetime.datetime: - """Deserializes string to datetime. - - The string should be in iso8601 datetime format. - - :param string: str. - :return: datetime. - """ - try: - from dateutil.parser import parse - return parse(string) - except ImportError: - return string - - -def deserialize_model(data: Union[dict, list], klass: T) -> T: - """Deserializes list or dict to model. - - :param data: dict, list. - :param klass: class literal. - :return: model object. - """ - instance = klass() - - if not instance.openapi_types: - return data - - if data is not None and isinstance(data, (list, dict)): - for attr, attr_type in instance.openapi_types.items(): - attr_key = instance.attribute_map[attr] - if attr_key in data: - value = data[attr_key] - setattr(instance, attr, _deserialize(value, attr_type)) - - return instance - - -def _deserialize_list(data: list, boxed_type) -> list: - """Deserializes a list and its elements. - - :param data: list to deserialize. - :param boxed_type: class literal. - - :return: deserialized list. - """ - return [_deserialize(sub_data, boxed_type) for sub_data in data] - - -def _deserialize_dict(data: dict, boxed_type) -> dict: - """Deserializes a dict and its elements. - - :param data: dict to deserialize. - :param boxed_type: class literal. - - :return: deserialized dict. - """ - return {k: _deserialize(v, boxed_type) for k, v in data.items()} diff --git a/samples/server/petstore/python-aiohttp/pom.xml b/samples/server/petstore/python-aiohttp/pom.xml deleted file mode 100644 index ebefe4df063..00000000000 --- a/samples/server/petstore/python-aiohttp/pom.xml +++ /dev/null @@ -1,47 +0,0 @@ - - 4.0.0 - org.openapitools - PythonAiohttpServer - pom - 1.0-SNAPSHOT - Python Aiohttp Server - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - test - integration-test - - exec - - - make - - test-all - - - - - - - - - diff --git a/samples/server/petstore/python-aiohttp/requirements.txt b/samples/server/petstore/python-aiohttp/requirements.txt deleted file mode 100644 index 70c264978d3..00000000000 --- a/samples/server/petstore/python-aiohttp/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -connexion[aiohttp,swagger-ui] >= 2.6.0; python_version>="3.6" -# 2.3 is the last version that supports python 3.5 -connexion[aiohttp,swagger-ui] <= 2.3.0; python_version=="3.5" or python_version=="3.4" -# connexion requires werkzeug but connexion < 2.4.0 does not install werkzeug -# we must peg werkzeug versions below to fix connexion -# https://github.com/zalando/connexion/pull/1044 -werkzeug == 0.16.1; python_version=="3.5" or python_version=="3.4" -swagger-ui-bundle == 0.0.9 -aiohttp_jinja2 == 1.5.0 diff --git a/samples/server/petstore/python-aiohttp/setup.py b/samples/server/petstore/python-aiohttp/setup.py deleted file mode 100644 index d464315706a..00000000000 --- a/samples/server/petstore/python-aiohttp/setup.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -import sys -from setuptools import setup, find_packages - -NAME = "openapi_server" -VERSION = "1.0.0" - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = [ - "connexion==2.14.1", - "swagger-ui-bundle==0.0.9", - "aiohttp_jinja2==1.5.0", -] - -setup( - name=NAME, - version=VERSION, - description="OpenAPI Petstore", - author_email="", - url="", - keywords=["OpenAPI", "OpenAPI Petstore"], - install_requires=REQUIRES, - packages=find_packages(), - package_data={'': ['openapi/openapi.yaml']}, - include_package_data=True, - entry_points={ - 'console_scripts': ['openapi_server=openapi_server.__main__:main']}, - long_description="""\ - This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - """ -) - diff --git a/samples/server/petstore/python-aiohttp/test-requirements.txt b/samples/server/petstore/python-aiohttp/test-requirements.txt deleted file mode 100644 index bb7df90d4b2..00000000000 --- a/samples/server/petstore/python-aiohttp/test-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -pytest~=7.1.0 -pytest-cov>=2.8.1 -pytest-randomly>=1.2.3 -pytest-aiohttp>=0.3.0 diff --git a/samples/server/petstore/python-aiohttp/test_python3.sh b/samples/server/petstore/python-aiohttp/test_python3.sh deleted file mode 100755 index 43fab931f00..00000000000 --- a/samples/server/petstore/python-aiohttp/test_python3.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -REQUIREMENTS_FILE=dev-requirements.txt -REQUIREMENTS_OUT=dev-requirements.txt.log -SETUP_OUT=*.egg-info -VENV=.venv -DEACTIVE=false - -export LC_ALL=en_US.UTF-8 -export LANG=en_US.UTF-8 - -### set virtualenv -if [ -z "$VIRTUAL_ENV" ]; then - virtualenv $VENV --always-copy --python python3 - source $VENV/bin/activate - DEACTIVE=true -fi - -### install dependencies -pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT - -### run tests -tox || exit 1 - -### static analysis of code -flake8 --show-source petstore_api/ - -### deactivate virtualenv -if [ $DEACTIVE == true ]; then - deactivate -fi diff --git a/samples/server/petstore/python-aiohttp/tests/__init__.py b/samples/server/petstore/python-aiohttp/tests/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/samples/server/petstore/python-aiohttp/tests/conftest.py b/samples/server/petstore/python-aiohttp/tests/conftest.py deleted file mode 100644 index 182760e678b..00000000000 --- a/samples/server/petstore/python-aiohttp/tests/conftest.py +++ /dev/null @@ -1,21 +0,0 @@ -import logging -import pytest -import os - -import connexion - - -@pytest.fixture -def client(loop, aiohttp_client): - logging.getLogger('connexion.operation').setLevel('ERROR') - options = { - "swagger_ui": True - } - specification_dir = os.path.join(os.path.dirname(__file__), '..', - 'openapi_server', - 'openapi') - app = connexion.AioHttpApp(__name__, specification_dir=specification_dir, - options=options) - app.add_api('openapi.yaml', pythonic_params=True, - pass_context_arg_name='request') - return loop.run_until_complete(aiohttp_client(app.app)) diff --git a/samples/server/petstore/python-aiohttp/tests/test_pet_controller.py b/samples/server/petstore/python-aiohttp/tests/test_pet_controller.py deleted file mode 100644 index de3d3eeb82e..00000000000 --- a/samples/server/petstore/python-aiohttp/tests/test_pet_controller.py +++ /dev/null @@ -1,200 +0,0 @@ -# coding: utf-8 - -import pytest -import json -from aiohttp import web -from aiohttp import FormData - -from openapi_server.models.api_response import ApiResponse -from openapi_server.models.pet import Pet - - -@pytest.mark.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760") -async def test_add_pet(client): - """Test case for add_pet - - Add a new pet to the store - """ - body = { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -} - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer special-key', - } - response = await client.request( - method='POST', - path='/v2/pet', - headers=headers, - json=body, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_delete_pet(client): - """Test case for delete_pet - - Deletes a pet - """ - headers = { - 'api_key': 'api_key_example', - 'Authorization': 'Bearer special-key', - } - response = await client.request( - method='DELETE', - path='/v2/pet/{pet_id}'.format(pet_id=56), - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_find_pets_by_status(client): - """Test case for find_pets_by_status - - Finds Pets by status - """ - params = [('status', ['available'])] - headers = { - 'Accept': 'application/json', - 'Authorization': 'Bearer special-key', - } - response = await client.request( - method='GET', - path='/v2/pet/findByStatus', - headers=headers, - params=params, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_find_pets_by_tags(client): - """Test case for find_pets_by_tags - - Finds Pets by tags - """ - params = [('tags', ['tags_example'])] - headers = { - 'Accept': 'application/json', - 'Authorization': 'Bearer special-key', - } - response = await client.request( - method='GET', - path='/v2/pet/findByTags', - headers=headers, - params=params, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_get_pet_by_id(client): - """Test case for get_pet_by_id - - Find pet by ID - """ - headers = { - 'Accept': 'application/json', - 'api_key': 'special-key', - } - response = await client.request( - method='GET', - path='/v2/pet/{pet_id}'.format(pet_id=56), - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -@pytest.mark.skip("Connexion does not support multiple consumes. See https://github.com/zalando/connexion/pull/760") -async def test_update_pet(client): - """Test case for update_pet - - Update an existing pet - """ - body = { - "photoUrls" : [ "photoUrls", "photoUrls" ], - "name" : "doggie", - "id" : 0, - "category" : { - "name" : "name", - "id" : 6 - }, - "tags" : [ { - "name" : "name", - "id" : 1 - }, { - "name" : "name", - "id" : 1 - } ], - "status" : "available" -} - headers = { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer special-key', - } - response = await client.request( - method='PUT', - path='/v2/pet', - headers=headers, - json=body, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -@pytest.mark.skip("application/x-www-form-urlencoded not supported by Connexion") -async def test_update_pet_with_form(client): - """Test case for update_pet_with_form - - Updates a pet in the store with form data - """ - headers = { - 'Content-Type': 'application/x-www-form-urlencoded', - 'Authorization': 'Bearer special-key', - } - data = { - 'name': 'name_example', - 'status': 'status_example' - } - response = await client.request( - method='POST', - path='/v2/pet/{pet_id}'.format(pet_id=56), - headers=headers, - data=data, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -@pytest.mark.skip("multipart/form-data not supported by Connexion") -async def test_upload_file(client): - """Test case for upload_file - - uploads an image - """ - headers = { - 'Accept': 'application/json', - 'Content-Type': 'multipart/form-data', - 'Authorization': 'Bearer special-key', - } - data = FormData() - data.add_field('additional_metadata', 'additional_metadata_example') - data.add_field('file', '/path/to/file') - response = await client.request( - method='POST', - path='/v2/pet/{pet_id}/uploadImage'.format(pet_id=56), - headers=headers, - data=data, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - diff --git a/samples/server/petstore/python-aiohttp/tests/test_store_controller.py b/samples/server/petstore/python-aiohttp/tests/test_store_controller.py deleted file mode 100644 index 9625a8b35e6..00000000000 --- a/samples/server/petstore/python-aiohttp/tests/test_store_controller.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 - -import pytest -import json -from aiohttp import web - -from openapi_server.models.order import Order - - -async def test_delete_order(client): - """Test case for delete_order - - Delete purchase order by ID - """ - headers = { - } - response = await client.request( - method='DELETE', - path='/v2/store/order/{order_id}'.format(order_id='order_id_example'), - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_get_inventory(client): - """Test case for get_inventory - - Returns pet inventories by status - """ - headers = { - 'Accept': 'application/json', - 'api_key': 'special-key', - } - response = await client.request( - method='GET', - path='/v2/store/inventory', - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_get_order_by_id(client): - """Test case for get_order_by_id - - Find purchase order by ID - """ - headers = { - 'Accept': 'application/json', - } - response = await client.request( - method='GET', - path='/v2/store/order/{order_id}'.format(order_id=1), - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -@pytest.mark.skip("*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760") -async def test_place_order(client): - """Test case for place_order - - Place an order for a pet - """ - body = openapi_server.Order() - headers = { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } - response = await client.request( - method='POST', - path='/v2/store/order', - headers=headers, - json=body, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - diff --git a/samples/server/petstore/python-aiohttp/tests/test_user_controller.py b/samples/server/petstore/python-aiohttp/tests/test_user_controller.py deleted file mode 100644 index c695e4f0c95..00000000000 --- a/samples/server/petstore/python-aiohttp/tests/test_user_controller.py +++ /dev/null @@ -1,149 +0,0 @@ -# coding: utf-8 - -import pytest -import json -from aiohttp import web - -from openapi_server.models.user import User - - -@pytest.mark.skip("*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760") -async def test_create_user(client): - """Test case for create_user - - Create user - """ - body = openapi_server.User() - headers = { - 'Content-Type': 'application/json', - } - response = await client.request( - method='POST', - path='/v2/user', - headers=headers, - json=body, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -@pytest.mark.skip("*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760") -async def test_create_users_with_array_input(client): - """Test case for create_users_with_array_input - - Creates list of users with given input array - """ - body = [openapi_server.User()] - headers = { - 'Content-Type': 'application/json', - } - response = await client.request( - method='POST', - path='/v2/user/createWithArray', - headers=headers, - json=body, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -@pytest.mark.skip("*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760") -async def test_create_users_with_list_input(client): - """Test case for create_users_with_list_input - - Creates list of users with given input array - """ - body = [openapi_server.User()] - headers = { - 'Content-Type': 'application/json', - } - response = await client.request( - method='POST', - path='/v2/user/createWithList', - headers=headers, - json=body, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_delete_user(client): - """Test case for delete_user - - Delete user - """ - headers = { - } - response = await client.request( - method='DELETE', - path='/v2/user/{username}'.format(username='username_example'), - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_get_user_by_name(client): - """Test case for get_user_by_name - - Get user by user name - """ - headers = { - 'Accept': 'application/json', - } - response = await client.request( - method='GET', - path='/v2/user/{username}'.format(username='username_example'), - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_login_user(client): - """Test case for login_user - - Logs user into the system - """ - params = [('username', 'username_example'), - ('password', 'password_example')] - headers = { - 'Accept': 'application/json', - } - response = await client.request( - method='GET', - path='/v2/user/login', - headers=headers, - params=params, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -async def test_logout_user(client): - """Test case for logout_user - - Logs out current logged in user session - """ - headers = { - } - response = await client.request( - method='GET', - path='/v2/user/logout', - headers=headers, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - - -@pytest.mark.skip("*/* not supported by Connexion. Use application/json instead. See https://github.com/zalando/connexion/pull/760") -async def test_update_user(client): - """Test case for update_user - - Updated user - """ - body = openapi_server.User() - headers = { - 'Content-Type': 'application/json', - } - response = await client.request( - method='PUT', - path='/v2/user/{username}'.format(username='username_example'), - headers=headers, - json=body, - ) - assert response.status == 200, 'Response body is : ' + (await response.read()).decode('utf-8') - diff --git a/samples/server/petstore/python-aiohttp/tox.ini b/samples/server/petstore/python-aiohttp/tox.ini deleted file mode 100644 index f66b2d84cda..00000000000 --- a/samples/server/petstore/python-aiohttp/tox.ini +++ /dev/null @@ -1,11 +0,0 @@ -[tox] -envlist = py3 -skipsdist=True - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - {toxinidir} - -commands= - pytest --cov=openapi_server diff --git a/samples/server/petstore/spring-stubs/.openapi-generator/VERSION b/samples/server/petstore/spring-stubs/.openapi-generator/VERSION deleted file mode 100644 index 757e6740040..00000000000 --- a/samples/server/petstore/spring-stubs/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index c591fdafd6a..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,387 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "pet", description = "Everything about your Pets") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Add a new pet to the store", - nickname = "addPet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = "application/json" - ) - default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return Invalid pet value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Deletes a pet", - nickname = "deletePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid pet value") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @ApiParam(value = "Pet id to delete", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "") @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by status", - nickname = "findPetsByStatus", - notes = "Multiple status values can be provided with comma separated strings", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid status value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = "application/json" - ) - default ResponseEntity> findPetsByStatus( - @NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @ApiOperation( - tags = { "pet" }, - value = "Finds Pets by tags", - nickname = "findPetsByTags", - notes = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - response = Pet.class, - responseContainer = "List", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class, responseContainer = "List"), - @ApiResponse(code = 400, message = "Invalid tag value") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = "application/json" - ) - default ResponseEntity> findPetsByTags( - @NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) List tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @ApiOperation( - tags = { "pet" }, - value = "Find pet by ID", - nickname = "getPetById", - notes = "Returns a single pet", - response = Pet.class, - authorizations = { - @Authorization(value = "api_key") - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = Pet.class), - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = "application/json" - ) - default ResponseEntity getPetById( - @ApiParam(value = "ID of pet to return", required = true) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Update an existing pet", - nickname = "updatePet", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid ID supplied"), - @ApiResponse(code = 404, message = "Pet not found"), - @ApiResponse(code = 405, message = "Validation exception") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = "application/json" - ) - default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @ApiOperation( - tags = { "pet" }, - value = "Updates a pet in the store with form data", - nickname = "updatePetWithForm", - notes = "", - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 405, message = "Invalid input") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = "application/x-www-form-urlencoded" - ) - default ResponseEntity updatePetWithForm( - @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "pet" }, - value = "uploads an image", - nickname = "uploadFile", - notes = "", - response = ModelApiResponse.class, - authorizations = { - @Authorization(value = "petstore_auth", scopes = { - @AuthorizationScope(scope = "write:pets", description = "modify pets in your account"), - @AuthorizationScope(scope = "read:pets", description = "read your pets") - }) - } - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = "application/json", - consumes = "multipart/form-data" - ) - default ResponseEntity uploadFile( - @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 950357107c0..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,285 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.0.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.annotations.*; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Api(value = "user", description = "Operations about user") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Create user", - nickname = "createUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithArrayInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Creates list of users with given input array", - nickname = "createUsersWithListInput", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Delete user", - nickname = "deleteUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @ApiParam(value = "The name that needs to be deleted", required = true) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Get user by user name", - nickname = "getUserByName", - notes = "", - response = User.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = User.class), - @ApiResponse(code = 400, message = "Invalid username supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = "application/json" - ) - default ResponseEntity getUserByName( - @ApiParam(value = "The name that needs to be fetched. Use user1 for testing.", required = true) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs user into the system", - nickname = "loginUser", - notes = "", - response = String.class - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation", response = String.class), - @ApiResponse(code = 400, message = "Invalid username/password supplied") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = "application/json" - ) - default ResponseEntity loginUser( - @NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @ApiOperation( - tags = { "user" }, - value = "Logs out current logged in user session", - nickname = "logoutUser", - notes = "" - ) - @ApiResponses({ - @ApiResponse(code = 200, message = "successful operation") - }) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @ApiOperation( - tags = { "user" }, - value = "Updated user", - nickname = "updateUser", - notes = "This can only be done by the logged in user." - ) - @ApiResponses({ - @ApiResponse(code = 400, message = "Invalid user supplied"), - @ApiResponse(code = 404, message = "User not found") - }) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index ce02f3c7d4e..00000000000 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,282 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * A pet for sale in the pet store - */ - -@ApiModel(description = "A pet for sale in the pet store") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private List photoUrls = new ArrayList<>(); - - @JsonProperty("tags") - @Valid - private List<@Valid Tag> tags; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - /** - * Default constructor - * @deprecated Use {@link Pet#Pet(String, List)} - */ - @Deprecated - public Pet() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Pet(String name, List photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @ApiModelProperty(example = "doggie", required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - if (this.photoUrls == null) { - this.photoUrls = new ArrayList<>(); - } - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { - return photoUrls; - } - - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List<@Valid Tag> tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @ApiModelProperty(value = "") - public List<@Valid Tag> getTags() { - return tags; - } - - public void setTags(List<@Valid Tag> tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} -